Amazon Interview Question
Software Engineer / DevelopersA normal dice has numbers from 1-6. So, if u are asked to fill the second dice from 0-6, then fill up all sides of second dice with 0s. so, that we have an equal probability of getting results.
That was quite smart! ;-)
I really doubt if most of the posters reread the question before they hit the submit key! Confusing and waste of time.
No but in this case the probability of getting 0 is 6/12 = 1/2 and any other digit like 1 has the probability = 1/12
mark all face by 6 , Or all face by 0 , or 3 face by 6 and by 0.
probability of all possible appearing number will be same in all above three case
Isn't having the numbers on the second dice such that each number on the second dice has equal probability of coming should be the answer to this question?
Thus, the possible solutions could be
- (1,2,3,4,5,6)
- (0,0,0,0,0,0,0)
- (1,1,1,1,1,1)
.......(6,6,6,6,6,6)
- (0,0,0, 6,6,6)
and so on
Considering your argument. I think correct solution be only.
mark 3 face by 0 and 3 by 6. Because this is the only case in which we will be able to roll all number from 1-12 with equal probability. In all other case we won't be able to roll all numbers. though its not given in Q that we have to roll number from 1-12. I am assuming it.
yes...this is the correct answer...as in this case, the probability of getting a number in the range [1,6] or [7,12] is same = 1\2 (due to dice with three faces with 0 and three faces with 6) * 1\6 (due to normal dice)
No, it's not correct.
See, I thought the same thing.. BUT I REREAD the question and didn't it say FROM 0-6 ..which means 0, 1, 2, 3, 4, 5, 6 inclusive?? which means you HAVE to you use 0, 1, 2, 3, 4, 5, 6.
Either the poster got the question wrong, or the interviewer is inexperience.
If it was rephrased to something like:
"Given a normal dice and a dice with blank faces, fill in the blank dice with ANY NUMBER OR NUMBERS from 0 to 6, so that the probability of each number coming up, when you roll the two dice together, is equal."
Then it's a possible solution.
So it's either the poster got the question wrong, or the interviewer is inexperience. Post it correctly next time.
My interpretation of the question is that we have to get the same prob distribution of the sum of the nos. on the 2 rolled dices ( total 36 possible outcomes and prob of getting 2 is 1/36 , 3 is 2/36 , 4 is 3/36 and so on upto 12 which is 1/36 ) . If we are asked to fill the blank dice with nos from 0 to 6 , then obv the same nos. i.e. 1,2,3,4,5,6 would solve the prob ( if my interpretation is correct )
I think the question was to get a uniform distribution between 1 to 12. So mark 3 faces with 0 and the other 3 with 6. Then each number from 1-12 has the same probability of 1/12.
- Anonymous July 01, 2010