Week 3 Homework
10. Eigen's Paradox
Probability - Fundamentals
!hw_part2, p.4
Probability of a mutation per nucleotide without enzymes:
Probability of no mutation:
Since each nucleotides chance of mutation is independent, the probability of no mutation in strand of length
To have 1 mutation in 5 copies -
So given this probability, maximum length of nucleotide chain that is 1 mutation in 5 is 160
14. Frequency of identical twin births
Bayes' Theorem
!hw_part2, p.5
This is the prior probability - the probability that twins are monozygotic (identical) given that they are twins.
Using Bayes' theorem we can get the posterior probability given that the twins are the same sex:
Total probability:
If we skip the first part where we determine the probability that they are monozygotic given that they are twins and only use the probability from all births in our Bayes' Theorem, we will still get the same result. We are dividing each number by 0.02, so these could be factored out. However it's probably best to include this step, since the numbers make more logical sense in this case.
Now, let's see what happens when the frequency of fraternal twin births goes up:
New frequency:
This gives a new posterior probability of 0.1818 - lower than the previous one. A lower prior probability results in a lower posterior prob.
17. Cohort survival
Binomial Distribution
!hw_part2, p.7
(a) Plotting the binomial distributions
We build a binomial distribution
Formula:
bottom=-0.1
top=1
right=7
left=-0.5
---
n=5
p=0.7
y = (n! / (x!(n-x)!)) * p^x * (1-p)^{n-x}|red|dashed
\binomialdist(n,p)|red
y = (n! / (x!(n-x)!)) * p^{3x} * (1-p^3)^{n-x}|green|dashed
\binomialdist(n,p^3)|green
y = (n! / (x!(n-x)!)) * p^{10x} * (1-p^{10})^{n-x}|blue|dashed
\binomialdist(n,p^{10})|blue
(b) Years until 95% chance that all birds have died
This is where surviving birds
bottom=-0.1
top=1
right=20
left=-1
---
n=5
p=0.7
y = (n! / (0!(n-0)!)) * p^{0x} * (1-p^x)^{n-0}|red
y=0.95|blue|dashed
Again, imagine that this is using discrete histogram bars or dots on the integer values of
We can see that these intersect around
Alternatively we could solve this with some algebra. It's not so bad if we start with
So our equation is:
Same as before - we need to wait 13 years to be at least 95% sure. If we assume it was a constant rate, then we would have 12 years and 10 months, but this was not stated and its likely that it is not constant throughout the year.
18. Cancer diagnosis
Binomial Distribution
!hw_part2, p.7
19. Binomial random number generators
Binomial Distribution
(a) In a uniform distribution, the probability of getting a number between 0 and 0.2 is just 0.2.
(b) A random number from a uniform distribution below