Texts: probability answer d, numpy
2. Fair Coin
One of the fundamental models of probability theory is for n tosses of a fair coin, where n is a fixed positive integer. The model says that all sequences that have length n and consist only of heads (H) and tails (T) are equally likely.
Unless otherwise specified, coins in this course are assumed to be fair.
This exercise is a series of quick observations. Before you start, look over the reference in the Basic Counting section of the Math Prerequisites page.
Suppose you toss a coin n times and note down the sequence of heads (H) and tails (T).
Fix an integer k such that 0 < k < n.
a) In total, how many possible sequences are there? How many sequences have k heads?
[That means exactly k heads, now and throughout the course. To answer the second question, it might help to imagine that there are n empty spaces and you have to write the letter H in k of them.]
b) What is the chance that you get k heads in your n tosses? Why?
c) Does your answer in b make sense in the cases k = 0 and k = n? Explain.
d) SciPy is a Python library for scientific computing. You will be using it a lot in this course. In particular, the special module of SciPy computes combinatorial terms and has been imported in this notebook.
To calculate n choose k, use special.comb(n, k) as in the example below.
In [13]: # 10 choose 2
special.comb(10, 2)
Out[13]: 45.0
Each student in a probability class is asked to toss a coin 20 times and note the number of heads. Six students do this exercise during office hours. What is the chance that none of these six students notes 10 heads?
[Review Part a for what "10 heads" means, and do not import any further libraries.]
In [15]: # Answer to d