Probstat/week5 practice 1

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
This is part of probstat.

Practice exercises

Variances

1. Consider a random variable Z that becomes -1 with probability 1/3, 0 with probability 1/3, and 1 with probability 1/3. Find E[Z], and Var(Z).

2. Let random variable X be the outcome after tossing a fair die (with 6 faces of values 1,2,3,...,6). Find E[X] and Var(X).

3. You have observed the distribution of the score for a probability class. You notice that, from an exercise, students get 5 points with probability 0.1, 4 points with probability 0.2, 3 points with probability 0.3, 2 points with probability 0.1, 1 point with probability 0.2, and 0 points with probability 0.1. Let random variable X be the points a student will get. Find E[X] and Var(X).

Binomial and geometric random variables

1. Your friend claims to have a fair coin. You would like to prove it so you take her coin and toss it for 20 times. You got 15 heads. Suppose that the coin is truely a fair coin, what is the probability that this happens. Now, given that result, do you believe that the coin is indeed a fair one?

2. (IPSES, ex 3.1a) A thumb drive produced by a certain company is defective with probability 0.01. What is the probability that a person buys 10 thumb drives and get 1 defective drive?

3. An airline knows that a passenger will miss the flight independently with probability 0.05. Given an airplane with the capacity of 300 passengers, the airline would like to allow over-booking, i.e., it will allow the booking of more than 300 passengers. However, if they allow too many extra passengers, it might be the case that more than 300 passengers show up and they run into problems. What should be the number of extra passengers that the airline should allow to make sure that with probability at least 0.95, no more than 300 passengers will show up? (Notes: in this problem, to figure out the right value, it might be useful to write a computer program.)

Geometric random variables

1. You toss a fair die. You will stop when you the die shows up with a value larger than 4.

  • 1.1 What is the probability that you only toss once?
  • 1.2 What is the probability that you have to toss more than 2 times?
  • 1.3 What is the expected number of tosses?

2. You are the first person in the hat experiment, so you do not want to be part of it. There are n hats in the hat locker room and your hat is one of them. You randomly pick a hat, if it is your hat you will keep it and go home happy. If it is not your hat, you return the hat to the room and keep randomly picking another hat. What is the expected number of times you have to pick the hats until you can go home.

3. You start tossing a coin. You repeatedly toss a coin until you get the same coin as the most recent previous toss. For example if your first toss is head and the second toss is tail, you will stop at the third toss if you get a tail. (Note that you definitely make the first two tosses.) What is the expected number of coin tosses that you have to make.

4. In a certain game there are 2 stages. You have the probability 0.3 of passing the first stage, and probability of 0.2 of passing the second stage. Passing any stages are independent events. Playing the game for 1 round on any stage takes 10 minutes.

  • 4.1 Suppose that the game allow saving, so you can play until you pass the first stage, and then you can keep playing only the second stage until you finish the game. What is the expected time you need to finish the game (i.e., finishing both stage 1 and stage 2)?
  • 4.2 Suppose now that the game does not allow saving. I.e., if you fail in the second stage, you will have to start playing again from the first stage. What is the expected time you need to play to finish the game?

Theoretical exercises

1. For a random variable X with variance Var(X). For a constant a, prove that .

2. For a non-negative discrete random variable that takes on values 0,1,2,..., show that .

Programming exercises

The fullest bins

Perform the balls-and-bins experiment on various values of n = 10,50,100,200,500,1000,2000,5000,10000,20000. For each experiment, you should record the maximum load X.

For each value of n, perform 10 independent experiments and record the average maximum load, the minimum X (over these 10 experiments), and the minimum X (over these 10 experiments). Plot a graph. See how the values of X grow.

Distribution of the binomial random variables

Try to plot the pmf of the binomial random variables with the following parameters.

  • n = 10. (Try to plot them in the same graph.)
    • n = 10, p = 0.5
    • n = 10, p = 0.7
    • n = 10, p = 0.9
  • n = 100. (Try to plot them in the same graph.)
    • n = 100, p = 0.5
    • n = 100, p = 0.2
    • n = 100, p = 0.1
  • These are the case where np remains the same, but we change the value of n. Try to plot them in the same graph. Also, you can truncate the x-axis to just 40.
    • n = 10, p = 0.8
    • n = 20, p = 0.4
    • n = 40, p = 0.2
    • n = 100, p = 0.08
    • n = 200, p = 0.04
    • n = 1000, p = 0.008