if number of sides are s,
The number of diagonals D = s(s-3)/2
by solve this equation 40 = s^2-3s
By solve this we get s = 8, -5
so the number of sides are 8
First digit can be any of 1,7,3,4 => 4
second digit can be any of 1, 3,7,0,4 =>5
for a odd number last digit can be any of 1,3,7 =>3
total number of digits are => 4*5*3
60
No. of methods of selecting 3 men out of 4 are 4*3*2/3*2*1 = 4
No. of methods of selecting 3 out of total 8 persons are 8*7*6/3*2*1 = 56
Hence probability = 4/56 = 1/14