Warning

This page is located in archive.

Introduction / refresher of some probabilities concept + α,β exercise solution

- Calculate some probabilities about siblings
- submit your solution to BRUTE
**lab05quiz**by March 20, midnight - format: text file, photo of your solution on paper, pdf - what is convenient for you
- solution will be discussed on the next lab
- 0.5 points

In certain board game, the dice are rolled in the following way:

- We roll the die a first time.
- If we get an odd number, we roll a second time.
- The value of such a roll is denoted as
*H*and it is the highest number that was rolled (i.e. the even number that was rolled on the first roll, or the greater of the numbers from both rolls if an odd number was rolled the first time).

What is the mean (expected) value of such a roll? Try to solve first theoretically and then by simulation.

Instructions:

- First, define the space $\cal S$ of elementary events (outcomes of the experiment).
- Determine the probabilities of these elementary events. Are they all the same? What should their sum be? Is this condition met?
- Define the random variable (r.v.) $H$, i.e. determine what real value $H(s)$ is assigned to each elementary event $s \in \cal S$.
- What is the support of r.v. $H$? (that is, which real values will have a non-zero probability?)
- Define the probability distribution of r.v. $H$, i.e. determine the value of the function $p_H(x)$ for all values of $x$.
- Determine the expected value $E(H)$ of r.v. $H$.

Instructions:

- Create a function that will return a single value of $H$ according to the above rules.
- Find out the results of many such rolls and calculate their average.
- Try to run the script many times and observe differences in the estimated $E(X)$.

If you have time, try to solve other probability problems by simulation, e.g:

- The probability for a family to have two daughters, one of whom is born on a Monday (see the 3rd bonus exercise question).
- A task about a screening test for a disease X (try to randomly generate people, determine whether they have the disease or not according to a given probability, determine whether they test positive or negative according to known conditional probabilities, and estimate what proportion of people with a test that came out positive really had the disease);
- A problem about the probability that a student will catch the bus if he arrives at the bus stop anytime between 6:58 and 7:02, while the bus leaves anytime between 7:00 and 7:03.
- “anytime” here means that you are to assume a uniform distribution.
- How would the simulation change if the equal distribution of the student's arrival time at the bus stop and bus departure time were changed, for example, to a normal distribution?

Although I don't have any symptoms yet, I'm worried about disease X. I'm considering getting tested for it, but haven't yet. I therefore want to study the following phenomena:

- $X$ - the person is sick (has disease X)
- $\bar X$ - the person is healthy (does not have disease X)
- $\ominus$ - the test for disease X came out negative (according to the test, the person does not have disease X)
- $\oplus$ - the test for disease X came out positive (according to the test, the person has disease X)

For the test I'm considering taking, the manufacturer says it has 90% accuracy for both healthy and sick people. The prevalence of disease X in the population is 5%. Try to answer the following questions:

- What is the probability that a person randomly selected from the population has disease X?
- What is the probability that I have disease X?
- How to understand (and denote) test information from the manufacturer?
- What is the probability that I have disease X if I test positive?
- What is the probability that I have disease X if I test negative?

courses/be5b33kui/labs/weekly/week_05.txt · Last modified: 2024/02/13 14:35 by gamafili