ผลต่างระหว่างรุ่นของ "Probstat/week4 practice 1"
Jittat (คุย | มีส่วนร่วม) |
Jittat (คุย | มีส่วนร่วม) |
||
(ไม่แสดง 13 รุ่นระหว่างกลางโดยผู้ใช้คนเดียวกัน) | |||
แถว 1: | แถว 1: | ||
+ | : ''This is part of [[probstat]]''. | ||
+ | == Practice problems == | ||
+ | 1. We toss a fair dice 2 times. Let random variable '''X''' be the product of the values from the dices. Plot the pmf of '''X'''. | ||
+ | |||
+ | 2. In roulette, there are 38 pockets on the roulette wheel. The pockets are numbered 0,00,1,2,3,...,36. If you bet 1 baht on 00 and win, you will get 35 baht (not including your 1-baht bet). If you bet 1 baht on 00, what is the expected value of money that you get in return? | ||
+ | |||
+ | 3. We toss a fair coin many times until we get a Head. Let random variable '''X''' be the number of times we have to toss the coin. For a non-negative integer '''i''', find '''P{X > i}'''. (You should leave '''i''' as a variable in your answer.) | ||
+ | |||
+ | 4. Under the same condition as in question 3, but we toss a coin that turns up head with probability '''p'''. Also, let '''q = 1 - p'''. Let random variable '''X''' be the number of times we have to toss the coin. For a non-negative integer '''i''', find '''P{X > i}'''. | ||
+ | |||
== Two experiments == | == Two experiments == | ||
In this section, we shall analyze two experiments. | In this section, we shall analyze two experiments. | ||
แถว 25: | แถว 35: | ||
2. Let '''n''' = 500. Write a program that estimates the probability that '''X''' is greater than 0. Plot the probability distribution of '''X'''. | 2. Let '''n''' = 500. Write a program that estimates the probability that '''X''' is greater than 0. Plot the probability distribution of '''X'''. | ||
− | === No one gets her/his own hat back === | + | === <del>No one gets her/his own hat back</del> === |
− | + | ||
+ | : '''''Notes:''' I am sorry this question is wrong... please ignore it.'' | ||
+ | |||
+ | == No empty bins: Sterling's approximation == | ||
− | + | Let's reconsider the balls-and-bins experiment and try to approximate the probability that there is no empty bins. | |
− | This is the Sterling's approximation of factorial (See [ | + | 1. What is the probability that there is no empty bin? |
+ | |||
+ | This is the Sterling's approximation of factorial (See [http://en.wikipedia.org/wiki/Stirling%27s_approximation wikipedia entry]) | ||
:<math>n! \sim \sqrt{2 \pi n}\left(\frac{n}{e}\right)^n</math> | :<math>n! \sim \sqrt{2 \pi n}\left(\frac{n}{e}\right)^n</math> | ||
แถว 37: | แถว 52: | ||
== Binomial random variable == | == Binomial random variable == | ||
+ | Consider the following standard experiment. We perform some experiment that has success probability '''p''' for '''n''' times. Let random variable '''X''' be the number of successful outcomes. This type of random variables appears very frequently, so there is a name for it: '''binomial random variables'''. (You can guess why from the following question.) | ||
+ | |||
+ | 1. What is '''P{X = i}'''? | ||
+ | |||
+ | 2. Define appropriate indicator random variables and use them to derive '''E[X]'''. | ||
+ | |||
+ | 3. (Bonus) Try to derive the same formula for '''E[X]''' directly from the definition of the expectation. (You may find [http://en.wikipedia.org/wiki/Binomial_theorem Binomial theorem] useful in this problem.) |
รุ่นแก้ไขปัจจุบันเมื่อ 07:30, 18 กันยายน 2557
- This is part of probstat.
เนื้อหา
Practice problems
1. We toss a fair dice 2 times. Let random variable X be the product of the values from the dices. Plot the pmf of X.
2. In roulette, there are 38 pockets on the roulette wheel. The pockets are numbered 0,00,1,2,3,...,36. If you bet 1 baht on 00 and win, you will get 35 baht (not including your 1-baht bet). If you bet 1 baht on 00, what is the expected value of money that you get in return?
3. We toss a fair coin many times until we get a Head. Let random variable X be the number of times we have to toss the coin. For a non-negative integer i, find P{X > i}. (You should leave i as a variable in your answer.)
4. Under the same condition as in question 3, but we toss a coin that turns up head with probability p. Also, let q = 1 - p. Let random variable X be the number of times we have to toss the coin. For a non-negative integer i, find P{X > i}.
Two experiments
In this section, we shall analyze two experiments.
Random hats
A group of n people, each wearing a different hat, go to the museum. They have to leave their hats at the entrance. When they get back, each gets a random hat back. We are interested in the number of people who get their own hat back.
Let random variable X be the number of people who get their own hat back. As a typical way of using linearity of expectation, we shall define an indicator random variable Xi to be 1 if person i gets her/his hat back, and 0, otherwise.
1. What is E[Xi]?
2. What is E[X]? (Show your work.)
Dinner on a circle table
The same group of n people go into a Chinese restaurant. They sit on a circular table with a circular turntable (see wikipedia article). Each person orders one different dish and gets her/his order exactly in front of her/him. To make a fun dinner, they decide to randomly rotate the turntable so that each one of them will hopefully get a random dish.
Let random variable Y be the number of people who get their own dish after the random rotation.
1. What is E[Y]? (In this case, you probably don't need to use the linearity of expectation.)
Expectation and probability
Note that E[X] = E[Y], but these two random variables behave fairly differently.
1. What is the probability that Y is greater than 0? (I.e., what is P{Y > 0}?)
2. Let n = 500. Write a program that estimates the probability that X is greater than 0. Plot the probability distribution of X.
No one gets her/his own hat back
- Notes: I am sorry this question is wrong... please ignore it.
No empty bins: Sterling's approximation
Let's reconsider the balls-and-bins experiment and try to approximate the probability that there is no empty bins.
1. What is the probability that there is no empty bin?
This is the Sterling's approximation of factorial (See wikipedia entry)
2. Use Sterling's approximation to estimate the probability from question 1.
Binomial random variable
Consider the following standard experiment. We perform some experiment that has success probability p for n times. Let random variable X be the number of successful outcomes. This type of random variables appears very frequently, so there is a name for it: binomial random variables. (You can guess why from the following question.)
1. What is P{X = i}?
2. Define appropriate indicator random variables and use them to derive E[X].
3. (Bonus) Try to derive the same formula for E[X] directly from the definition of the expectation. (You may find Binomial theorem useful in this problem.)