Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Dynamically simulate tossing a coin
ResourceFunction["CoinTossSimulator"][] creates an interface for dynamically simulating coin tosses. | |
ResourceFunction["CoinTossSimulator"][w] uses probability w of getting "heads". |
Simulate tossing a fair coin:
In[1]:= |
Out[1]= |
Simulate an unfair coin:
In[2]:= |
Out[2]= |
Clicking the "Report" button returns a summary of the simulation statistics:
In[3]:= |
Out[3]= |
Out[3]= |
The information returned by the "Ideal results" button is also available via the resource function IdealCoinTossStatistics:
In[4]:= |
Out[4]= |
Out[4]= |
In[5]:= |
Out[5]= |
This work is licensed under a Creative Commons Attribution 4.0 International License