Tag: probability
You have some coins. The i-th coin has a probability prob of facing heads when tossed. Return the probability that the number of coins facing heads equals target if …
The Interview Question: Assume the Rand5() gives a random integer from 1 to 5. Each possible return is given with the same probability. How do you construct the Rand7() …
We all know the area of a circle is computed as . Suppose the radius is ONE for simplicity to compute the value of , we can have the …
In , the algorithm is introduced that counts the average number of addition for sum to reach one, which approximates the math constant . The following will count the …
It is said this question is an interview question for some Software Engineer job. The question is like this. In Australia, each family prefer the girls rather than boys. …