Dice Rolls From Continuous Uniform
Start Timer
0:00:00
You are given a function that generates a floating-point number between 0
and 1
from a continuous uniform distribution.
Write a function dice_rolls
that takes the continuous random generator and simulates a dice roll (return a number between 1
and 6
, with all numbers having a uniform distribution).
Example:
Output:
dice_roll(continuous_random_generator) -> 1
dice_roll(continuous_random_generator) -> 2
dice_roll(continuous_random_generator) -> 6
#and so on ...
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments