Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the probabilities and statistics associated with tossing a coin
ResourceFunction["IdealCoinTossStatistics"][n] computes probabilities and statistics associated with tossing n fair coins. | |
ResourceFunction["IdealCoinTossStatistics"][n,h] computes probabilities and statistics associated with tossing n fair coins, of which h are heads. | |
ResourceFunction["IdealCoinTossStatistics"][{n,w}] computes probabilities and statistics associated with tossing n coins having a probability of heads w. | |
ResourceFunction["IdealCoinTossStatistics"][{n,w},h] computes probabilities and statistics associated with tossing n coins, of which h are heads. | |
ResourceFunction["IdealCoinTossStatistics"][…,prop] returns property prop for the coin toss. |
| All | default method that returns probabilities and statistics associated with tossing coins |
| "ProbabilityAllHeads" | probability that all coins tossed display heads |
| "ProbabilityAllTails" | probability that all coins tossed display tails |
| "ProbabilityHalfHeads" | probability that Floor[n/2] tossed coins display heads |
| "ProbabilityAtLeastOneHeads" | probability that at least one tossed coin displays heads |
| "ProbabilityAtLeastOneTails" | probability that at least one tossed coin displays tails |
| "ProbabilitySetNumberHeads" | formula for the probability of tossing a given number of heads |
| "ExpectedNumberHeads" | expected value of the number of heads |
| "PDFPlot" | plot of the normal approximation probability density function |
| "CDFPlot" | plot of the normal approximation cumulative density function |
| "PercentHeads | percent heads in the given number of coin tosses |
| "PercentTails" | percent tails in the given number of coin tosses |
| "ProbabilityGivenOrFewerHeads" | probability that the number of heads displayed is at most the given number |
| "ProbabilityMoreThanGivenHeads" | probability that the number of heads displayed is more than the given number |
| "ProbabilityGivenOrMoreHeads" | probability that the number of heads displayed is at least the given number |
| "ProbabilityFewerThanGivenHeads" | probability that the number of heads displayed is fewer than the given number |
Compute the probability and associated statistics of tossing 5 fair coins:
| In[1]:= |
|
| Out[1]= |
|
Compute the probability and associated statistics of tossing 5 unfair coins:
| In[2]:= |
|
| Out[2]= |
|
Return only the probability density function plot:
| In[3]:= |
|
| Out[3]= |
|
Compute the probability and associated statistics of tossing 5 unfair coins, of which 3 are heads:
| In[4]:= |
|
| Out[4]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License