hope u are taking only integral values from [0,5] if that is the case , total number of ways would be 6 x 6 x 6 = 216 and favourable ways will be 1) 0,0,5 -> 3!/2! = 3 2) 0,3,4 -> 3! = 6 ( Is there any other combination where you would get a² + b² + c² = 25 ? if yes please do reply.. ) Hence the required probability = ( 3 + 6 ) / 216 = 1/24