-
Notifications
You must be signed in to change notification settings - Fork 10
/
simulation.html
52 lines (42 loc) · 1.81 KB
/
simulation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bingo Simulator</title>
<link rel="stylesheet" href="simulation.css">
</head>
<body>
<h1>Bingo Simulator</h1>
<p>This tries to help answer the question, "how many different items do I need to include if <em><strong>n</strong></em> people are playing so that no one wins on the same bingo call?"</p>
<p>The real answer is, there's no guarantee of anything if the cards and the calls are randomly generated. But this simulation will give you a sense of the probabilities. This assumes a 5x5 bingo card without free spaces.</p>
<p>See <a href="/bingo-card-generator/faq.html">Bingo Card Generator - Frequently Asked Questions</a> for details.</p>
<form onsubmit="BINGO.runSimulation(1000); return false;">
<fieldset>
<legend>Simulation Parameters</legend>
<label for="items"># of items</label> <input type="text" name="items" id="items" value="25" size="3">
<label for="cards"># of cards/players</label> <input type="text" name="cards" id="cards" value="25" size="3">
<label><input id="runSimulation" type="submit" value="Run Simulation"></label>
</fieldset>
</form>
<p>(This may be slow if you have a lot of items and/or cards!)</p>
<h2>Results of 1000 simulated games (<span id="numberOfItems"></span> items, <span id="numberOfCards"></span> players)</h2>
<table>
<thead>
<tr>
<th>Calls</th>
<th>average (mean) # of winning cards per simulation</th>
<th>% chance of a winner on this call</th>
<th>% chance of a winner by this call</th>
</tr>
</thead>
<tfoot></tfoot>
<tbody id="simulationResults">
</tbody>
</table>
<script type="text/javascript" src="simulation.js"></script>
<script type="text/javascript">
BINGO.runSimulation(1000);
</script>
</body>
</html>