About the Authors |
|
ix | |
About the Technical Reviewer |
|
xi | |
Acknowledgments |
|
xiii | |
Introduction |
|
xv | |
|
Chapter 1 Calculating Pi with Monte Carlo Simulation |
|
|
1 | (18) |
|
|
1 | (1) |
|
The Wise Persons' Competition |
|
|
1 | (1) |
|
Estimating Pi by Sprinkling Grains |
|
|
2 | (8) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
11 | (7) |
|
|
18 | (1) |
|
|
18 | (1) |
|
Chapter 2 Markov Chain, a Peek into the Future |
|
|
19 | (20) |
|
|
19 | (6) |
|
Eigenstates of Markov Chains |
|
|
25 | (2) |
|
|
27 | (1) |
|
Markov Chain Applications |
|
|
27 | (1) |
|
A Random Walk That Has an End |
|
|
28 | (3) |
|
Sonnet Written by Drunk Shakespeare |
|
|
31 | (5) |
|
|
36 | (1) |
|
|
37 | (2) |
|
Chapter 3 Multi-armed Bandits, Probability Simulation, and Bayesian Statistics |
|
|
39 | (16) |
|
Random Pick and Naive Greedy Approach |
|
|
40 | (4) |
|
Greedy-Epsilon: Greedy but Not Always |
|
|
44 | (1) |
|
An Improved Greedy-Epsilon Algorithm |
|
|
45 | (1) |
|
|
46 | (1) |
|
The Bayesian Way, a Primer on Bayesian Statistics |
|
|
47 | (6) |
|
|
53 | (1) |
|
|
54 | (1) |
|
Chapter 4 Balls in a 2-D Box, a Simple Physics Engine |
|
|
55 | (22) |
|
|
55 | (2) |
|
|
57 | (3) |
|
|
60 | (5) |
|
|
65 | (1) |
|
Multiple Balls in a 2-D Box |
|
|
65 | (1) |
|
Update of Positions and Velocity upon Collision |
|
|
65 | (9) |
|
Collision Detection in Multiple-Ball Scenario |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
Chapter 5 Percolation, Threshold, and Phase Change |
|
|
77 | (18) |
|
|
78 | (4) |
|
Percolation and the Critical Probability |
|
|
82 | (1) |
|
An Analytical Solution for the 1-D Case |
|
|
82 | (1) |
|
A Simulation for the 2-D Case |
|
|
83 | (7) |
|
|
90 | (1) |
|
Another Interesting Statistic in 2-D Grid Percolation |
|
|
90 | (3) |
|
|
93 | (1) |
|
|
94 | (1) |
|
Chapter 6 Queuing System: How Stock Trades Are Made |
|
|
95 | (16) |
|
Trading Process Fundamentals |
|
|
95 | (1) |
|
|
96 | (2) |
|
Create the Interfaces and Determine the Data Schema |
|
|
98 | (4) |
|
Implement Order Book Logic |
|
|
102 | (5) |
|
Hook the Bots and Engine Together |
|
|
107 | (2) |
|
Exercises and Extension Ideas |
|
|
109 | (1) |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
110 | (1) |
|
Order Cancellation Support |
|
|
110 | (1) |
|
|
110 | (1) |
|
|
110 | (1) |
|
Chapter 7 Rock, Scissors, and Paper: Multi-agent Simulation |
|
|
111 | (16) |
|
Community Formation on a Street |
|
|
112 | (4) |
|
|
116 | (1) |
|
How to Win a Global Rock, Paper, and Scissors Contest |
|
|
116 | (9) |
|
|
125 | (1) |
|
|
126 | (1) |
|
Chapter 8 Disease Spreading, Simulating C0VID-19 Outbreak |
|
|
127 | (12) |
|
Simplifying the Real World |
|
|
127 | (2) |
|
|
129 | (4) |
|
|
133 | (1) |
|
|
133 | (4) |
|
|
137 | (1) |
|
|
137 | (2) |
|
Chapter 9 Misinformation Spreading and Simulations on a Graph |
|
|
139 | (24) |
|
|
139 | (4) |
|
Simulate Misinformation Spreading |
|
|
143 | (1) |
|
|
144 | (8) |
|
Misinformation Spreading on Different Networks |
|
|
152 | (9) |
|
|
161 | (1) |
|
|
161 | (2) |
Index |
|
163 | |