If the last three digits of a whole number are divisible by 8, then the entire number is divisible by 8. (By googling)
I don't have an effective way to determine a 3 digit number wehether is multiple of 8 or not.
So I list all 3 digit number consist only numbers 1-6,which are
112,136,144,152,216,232,224,256,264,336,344,312,352,416,456,424,464,432,536,544,512,552,616,624,632,664,656
27 numbers divisible 8 in total (I did that by adding multiple of 40, so it is a bit out of order.)
I also wrote a stupid Java program to check my answer.
public static void main(String []args){
int c=0;
for (int i = 1;i<=6;i++){
for (int j = 1;j<=6;j++)
{
for(int k = 1;k<=6;k++)
{
int n=i*100+j*10+k;
if(n%8==0)
{
c++;
}
}
}
}
System.out.println(c);
}
The first five dight can be any integer in {1,2,3,4,5,6}.Therefore, the probability that the number formed is a multiple of eight is \(\frac{6^5*27}{6^8}=\frac{3^3}{6^3}=\frac{1}{2^3}=\frac{1}{8}\).
PS: I believe there is a way to do this problem in abstract algebra, which I rusted at.