You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning! Here's your coding interview problem for today.
4
+
5
+
This problem was asked by Two Sigma.
6
+
7
+
Using a function `rand7()` that returns an integer from `1` to `7` (inclusive) with uniform probability, implement a function `rand5()` that returns an integer from `1` to `5` (inclusive).
8
+
9
+
# Source
10
+
11
+
Received by email from the [Daily Coding Problem](https://www.dailycodingproblem.com)
Similar to the fair coin problem, we just need to use the function `rand7()` until we get something between `1` and `5` since we were told in advance that `rand7()` is already supposed to be unbiased.
0 commit comments