Probability
Probability#
Probability is the study of random events. Computers are particularly helpful here as they can be used to carry out a number of experiments to confirm and/or explore theoretic results.
In practice studying probability will often involve:
calculating expected chances of an event occurring;
calculating the conditional chances of an event occurring given another event occurring.
Here we will see how to instruct a computer to sample such events.
Important
In this chapter we will cover:
Generating random numbers.
Randomly sample from a given collection of items.
Write python functions to be able to repeat experiments.