Learn Before
Simulating a Fair Coin Toss
To simulate a fair coin toss (an event with a 0.5 probability), we can use a random number generator that outputs continuous values uniformly distributed in the interval [0, 1]. Since the probability of a generated value falling into any sub-interval [a, b] subset [0, 1] is , the probability of the value falling in [0, 0.5] is 0.5, and in (0.5, 1] is also 0.5. Therefore, we can simulate the two equally likely outcomes of a coin toss by testing whether the generated float is greater than 0.5.
0
1
Tags
D2L
Dive into Deep Learning @ D2L
Related
Simulating a Fair Coin Toss
Simulating Draws from a Multinomial Variable
A data scientist is evaluating different scenarios to model. Which of the following scenarios does NOT represent a single experiment with exactly two mutually exclusive outcomes?
Quality Control Scenario Analysis
Modeling a Binary Outcome
Evaluating the Bernoulli Trial Model for User Clicks
Simulating a Fair Coin Toss