Total number of points in a plane is 3p. ∴ Maximum number of triangles =3pC3−3⋅pC3
[Here, we subtract those triangles which points are in a line] =(3p−3)!3!(3p)!−3⋅(p−3)!3!p! =3×23p(3p−1)(3p−2)−3×23×p(p−1)(p−2) =2p[9p2−9p+2−(p2−3p+2)] =p2(4p−3)