Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授。

PDF笔记下载(Academia.edu)

PRACTICE PROBLEMS FOR THE MIDTERM

PROBLEM 1

In a group of 5 high school students, 2 are in 9th grade, 2 are in 10th grade, and 1 is in 12th grade. Two of the students are picked at random without replacement.

a) the first student picked is not in 10th grade

b) both of the students are in 9th grade

c) the second student picked is in 12th grade

d) the second student picked is in 12th grade, given that the first student picked is in 9th grade

e) at least one of the students is in 10th grade

f) the two students are at least two grades apart

Solution:

a) $$P(\text{first student is not in 10th grade})=\frac{3}{5}$$

b) $$P(\text{both are in 9th grade})=\frac{2}{5}\times\frac{1}{4}=\frac{1}{10}$$

c) $$P(\text{second student is in 12th grade})=\frac{4}{5}\times\frac{1}{4}=\frac{1}{5}$$

d) $$P(\text{second student is in 12th grade | first student is in 9th grade})$$ $$=\frac{P(\text{first is in 9th grade & second is in 12th grade})}{P(\text{first student is in 9th grade})}=\frac{\frac{2}{5}\times\frac{1}{4}}{\frac{2}{5}}=\frac{1}{4}$$

e) $$P(\text{at least one student is in 10th grade})$$ $$=1-P(\text{no student is in 10th grade})=1-\frac{3}{5}\times\frac{2}{4}=\frac{7}{10}$$

f) $$P(\text{at least two grades apart})=P(\text{grade 9 & 12})+P(\text{grade 10 & 12})$$ $$=(\frac{2}{5}\times\frac{1}{4}+\frac{1}{5}\times\frac{2}{4})+(\frac{2}{5}\times\frac{1}{4}+\frac{1}{5}\times\frac{2}{4})=\frac{2}{5}$$

PROBLEM 2

In a raffle there are 100 tickets of which 1 is the winner. I pick 2 tickets at random. Find the chance that at least one of the tickets that I pick is the winner, if I pick

a) with replacement

b) without replacement

Solution:

a) $$P(\text{at least one is the winner with replacement})$$ $$=1-P(\text{none of the two is the winner})=1-\frac{99}{100}\times\frac{99}{100}=0.0199$$

b) $$P(\text{at least one is the winner without replacement})$$ $$=1-P(\text{none of the two is the winner})=1-\frac{99}{100}\times\frac{98}{99}=0.02$$

PROBLEM 3

In an undergraduate class, 70% of the students are juniors and the rest are seniors. Of the juniors, 40% are math majors. Of the seniors, 25% are math majors. One student is picked at random. Find

a) $P(\text{junior})$

b) $P(\text{senior})$

c) $P(\text{math major | junior})$

d) $P(\text{not a math major | junior})$

e) $P(\text{math major | senior})$

f) $P(\text{not a math major | senior})$

g) $P(\text{junior math major})$

h) $P(\text{senior math major})$

i) $P(\text{math major})$

j) $P(\text{junior | math major})$

k) $P(\text{senior | math major})$

l) $P(\text{junior | not a math major})$

Solution:

a) $$P(\text{junior})=0.7$$

b) $$P(\text{senior})=1-0.7=0.3$$

c) $$P(\text{math major | junior})=0.4$$

d) $$P(\text{not a math major | junior})=1-0.4=0.6$$

e) $$P(\text{math major | senior})=0.25$$

f) $$P(\text{not a math major | senior})=1-0.25=0.75$$

g) $$P(\text{junior math major})=0.7\times0.4=0.28$$

h) $$P(\text{senior math major})=0.3\times0.25=0.075$$

i) $$P(\text{math major})=P(\text{junior math major})+P(\text{senior math major})$$ $$=0.28+0.075=0.355$$

j) $$P(\text{junior | math major})=\frac{P(\text{junior math major})}{P(\text{math major})}=\frac{0.28}{0.355}\doteq0.7887324$$

k) $$P(\text{senior | math major})=\frac{P(\text{senior math major})}{P(\text{math major})}=\frac{0.075}{0.355}\doteq0.2112676$$

l) $$P(\text{junior | not a math major})=\frac{P(\text{junior not a math major})}{P(\text{not a math major})}$$ $$=\frac{0.7\times(1-0.4)}{1-0.355}\doteq0.6511628$$

PROBLEM 4

There are two events, $A$ and $B$. $P(A)=0.2$ and $P(B)=0.3$.

a) Are $A$ and $B$ independent?

i) Yes. ii) No. iii) Maybe, or maybe not; there is not enough information to decide.

b) What is the biggest that $P(\text{A or B})$ can be?

c) What is the smallest that $P(\text{A or B})$ can be?

Solution:

a) Maybe, or maybe not; there is not enough information to decide.

b) $$P(\text{A or B})=P(A)+P(B)-P(A \cap B)\le P(A)+P(B)=0.5$$

c) $$P(\text{A or B})\ge \max\{P(A), P(B)\}=0.3$$

PROBLEM 5

There are two events, $A$ and $B$. $P(A)=0.2$, $P(B)=0.3$, and $P(\text{A or B})=0.4$. Are $A$ and $B$ independent?

i) Yes. ii) No. iii) Maybe, or maybe not; there is not enough information to decide.

Solution:

No. $$P(A \cup B)=P(A)+P(B)-P(A\cap B)=0.2+0.3-P(A\cap B)=0.4$$ $$\Rightarrow P(A\cap B)=0.1\neq P(A)\cdot P(B)=0.06$$

PROBLEM 6

A die is rolled repeatedly. Find the chance that

a) each of the first three rolls shows one spot

b) the first three rolls all show the same face

c) the face with six spots appears at most once among the first 5 rolls

d) the face with six spots appears for the first time on the 5th roll

e) the face with six spots appears for the second time on the 5th roll

Solution:

a) $$P(\text{each of the first three rolls is one spot})=(\frac{1}{6})^3=\frac{1}{216}$$

b) $$P(\text{each of the first three rolls is the same spot})=6\times(\frac{1}{6})^3=\frac{1}{36}$$

c) Binomial distribution $n=5, k=0:1, p=\frac{1}{6}$: $$P(\text{six spots appears at most once among the first 5 rolls})$$ $$=\sum_{k=0}^{1}C_{5}^{k}\cdot (\frac{1}{6})^{k}\cdot (\frac{5}{6})^{5-k}\doteq0.8037551$$ R code:

> sum(dbinom(x = 0:1, size = 5, prob = 1/6))
[1] 0.8037551

d) $$P(\text{six spots appears for the first time on the 5th roll})$$ $$=(\frac{5}{6})^4\times(\frac{1}{6})\doteq0.08037551$$ R code:

> dgeom(x = 4, prob = 1/6)
[1] 0.08037551

e) There is one roll appearing six spots among the first 4 rolls and the 5th roll is six spots, that is, it is binomial distribution that $n=4, k=1, p=1/6$ among the first 4 rolls: $$P(\text{six spots appears for the second time on the 5th roll})$$ $$=C_{4}^{1}\times\frac{1}{6}\times(\frac{5}{6})^3\times\frac{1}{6}\doteq0.06430041$$ R code:

> dbinom(x = 1, size = 4, prob = 1/6) * 1/6
[1] 0.06430041

PROBLEM 7

I toss a coin 2 times; then my friend tosses it 2 times. Find the chance that we get the same number of heads.

Solution:

The outcome of one person is: $\{HH, HT, TH, TT\}$. Hence $$P(\text{zero head})=\frac{1}{4}\times\frac{1}{4}=\frac{1}{16}$$ $$P(\text{1 head})=\frac{1}{2}\times\frac{1}{2}=\frac{1}{4}$$ $$P(\text{2 heads})=\frac{1}{4}\times{1}{4}=\frac{1}{16}$$ $$P(\text{we get the same number of heads})=\frac{1}{16}+\frac{1}{4}+\frac{1}{16}=\frac{3}{8}$$

PROBLEM 8

A standard deck consists of 52 cards; 26 are red and 26 are black; there are 4 cards of each rank: Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King. Cards are dealt at random without replacement. Find the chance that

a) the first 3 cards are of three different ranks

b) at least one of the first three cards is a king

c) either the first card is a king or the second is a queen, but not both

d) there is at most one king among the first 5 cards

e) the 10th card is a king

f) the 19th and 27th cards are both kings

g) it takes more than 10 cards for the first king to appear

h) it takes more than 10 cards for the second king to appear

i) it takes exactly 10 cards for the second king to appear

Solution:

a) $$P(\text{first 3 cards are different ranks})=\frac{52}{52}\times\frac{48}{51}\times\frac{44}{50}\doteq0.8282353$$

b) $$P(\text{at least one king among the first 3 cards})$$ $$=1-P(\text{no king among the first 3 cards})=1-\frac{48}{52}\times\frac{47}{51}\times\frac{46}{50}\doteq0.2173756$$

c) $$P(\text{either the 1st is king or the 2nd is queen but not both})$$ $$=P(\text{1st is K, 2nd is not Q})+P(\text{1st is not K, 2nd is Q})$$ $$=P(\text{1st is K, 2nd is not Q})+P(\text{1st is Q, 2nd is Q})+P(\text{1st is neither K nor Q, 2nd is Q})$$ $$=\frac{4}{52}\times\frac{47}{51}+\frac{4}{52}\times\frac{3}{51}+\frac{44}{52}\times\frac{4}{51}\doteq0.1417798$$ Alternatively $$P(\text{either the 1st is king or the 2nd is queen but not both})$$ $$=P(\{\text{1st is K}\}\cup\{\text{2nd is Q}\})-P(\{\text{1st is K}\}\cap\{\text{2nd is Q}\})$$ $$=P(\text{1st is K})+P(\text{2nd is Q})-2\times P(\{\text{1st is K}\}\cap\{\text{2nd is Q}\})$$ $$=\frac{4}{52}+\frac{4}{52}-2\times\frac{4}{52}\times{4}{51}\doteq0.1417798$$ Note that $$P(\text{2nd is Q})=P(\text{1st is no Q, 2nd is Q})+P(\text{1st is Q, 2nd is Q})$$ $$=\frac{4}{52}\times\frac{3}{51}+\frac{48}{52}\times\frac{4}{51}=\frac{4}{52}$$

d) Hypergeometric distribution $x=0:1, m=4, n=48, k=5$: $$P(\text{at most 1 king among the first 5 cards})$$ $$=\frac{\sum_{x=0}^{1}C_{4}^{x}\cdot C_{48}^{5-x}}{C_{52}^{5}}\doteq0.9583156$$ R code:

> sum(dhyper(x = 0:1, m = 4, n = 48, k = 5))
[1] 0.9583156

e) $$P(\text{10th is K})=\frac{4}{52}$$

f) $$P(\text{19th & 27th are both K})=\frac{4}{52}\times\frac{3}{51}\doteq0.004524887$$

g) $$P(\text{more than 10 cards for the 1st K to appear})=P(\text{no K among the first 10 cards})=\frac{C_{4}^{0}\cdot C_{48}^{10}}{C_{52}^{10}}\doteq0.4134454$$ This is hypergeometric distribution, R code:

> dhyper(x = 0, m = 4, n = 48, k = 10)
[1] 0.4134454

h) There might be 0 or 1 king among the first 10 cards. Hypergeometric distribution $x=0:1, m=4, n=48, k=10$: $$P(\text{more than 10 cards for the 2nd K to appear})=P(\text{at most 1 K among the first 10 cards})$$ $$=\frac{\sum_{x=0}^{1}C_{4}^{x}\cdot C_{48}^{10-x}}{C_{52}^{10}}\doteq0.8374919$$ R code:

> sum(dhyper(x = 0:1, m = 4, n = 48, k = 10))
[1] 0.8374919

i) $$P(\text{exactly 10 cards for the 2nd K to appear})$$ $$=P(\text{1 K among the first 9 cards & the 10th is K})$$ $$=\frac{C_{4}^{1}\cdot C_{48}^{8}}{C_{52}^{9}}\times\frac{3}{43}\doteq0.02862314$$ R code:

> dhyper(x = 1, m = 4, n = 48, k = 9) * 3/43
[1] 0.02862314

THE MIDTERM

PROBLEM 1

According to genetic theory, every plant of a particular species has a 25% chance of being red-flowering, independently of all other plants. Among 10 plants of this species, what is the chance that fewer than 4 are red-flowering?

Solution:

Binomial distribution $n=10, k=0:3, p=0.25$: $$P(\text{fewer than 4 are red-flowering})=\sum_{k=0}^{3}C_{10}^{k}\cdot {0.25}^{k}\cdot{0.75}^{10-k}\doteq0.7758751$$ R code:

> sum(dbinom(x = 0:3, size = 10, prob = 0.25))
[1] 0.7758751

PROBLEM 2

A population consists of 25 men and 25 women. A simple random sample (draws at random without replacement) of 4 people is chosen. Find the chance that in the sample:

2A all the people are of the same gender

2B there are more women than men

2C the fourth person is a woman

2D the third person is a woman, given that the first person and fourth person are both men

Solution:

2A $$P(\text{all people are same gender})=\frac{2\times C_{25}^{4}}{C_{50}^{4}}\doteq0.1098567$$

2B $$P(\text{more women than men})=P(\text{4 women 0 man})+P(\text{3 women 1 man})$$ $$=\frac{C_{25}^{4}\times C_{25}^{0}+C_{25}^{3}\times C_{25}^{1}}{C_{50}^{4}}\doteq0.3046027$$

2C $$P(\text{fourth person is woman})=\frac{25}{50}=0.5$$

2D $$P(\text{third person is woman | first and fourth are men})=\frac{25}{48}\doteq0.5208333$$

PROBLEM 3

An edX multiple choice question has 5 available options, only 1 of which is correct. Students are allowed 2 attempts at the answer. A student who does not know the answer decides to guess at random, as follows: On the first attempt, he guesses at random among the 5 options. If his guess is right, he stops. If his guess is wrong, then on the second attempt he guesses at random from among the 4 remaining options.

3A Find the chance that the student gets the right answer at his first attempt.

3B Find the chance that the student has to make two attempts and gets the right answer the second time.

3C Find the chance that the student gets the right answer.

Solution:

3A $$P(\text{gets the right answer at first attempt})=\frac{1}{5}=0.2$$

3B $$P(\text{gets the right answer the second time})$$ $$=P(\text{second time correct | first time incorrect})=\frac{4}{5}\times\frac{1}{4}=0.2$$

3C $$P(\text{gets the right answer})$$ $$=P(\text{right answer first time})+P(\text{right answer second time})=0.2+0.2=0.4$$

PROBLEM 4

On a true-false test, each question has exactly one correct answer: true, or false. A student knows the correct answer to 70% of the questions on the test, and gives the correct answer to each of those questions. Each of the remaining answers she guesses at random, independently of all other answers. After the test has been graded, one of the questions is picked at random. Given that she got the answer right, what is the chance that she knew the answer?

Solution:

According to Bayes Theorem, we have $$P(\text{knew the answer | correct})$$ $$=\frac{P(\text{knew the correct answer})}{P(\text{correct})}$$ $$=\frac{P(\text{knew the correct answer})}{P(\text{knew the correct answer})+P(\text{guessed correct answer})}$$ $$=\frac{0.7}{0.7+0.3\times0.5}\doteq0.8235294$$

PROBLEM 5

I roll a die repeatedly. Find the chance that the first 4 rolls all show different faces, and the 5th roll shows a face that has appeared before.

Solution: $$P(\text{first 4 rolls different & the 5th has appeared before})$$ $$=\frac{6}{6}\times\frac{5}{6}\times\frac{4}{6}\times\frac{3}{6}\times\frac{4}{6}\doteq0.1851852$$

PROBLEM 6

I throw darts repeatedly. Assume that on each single throw, my chance of hitting the bullseye is 10%, independently of all other throws. I decide to throw until I have hit the bullseye 3 times. What is the chance that I throw exactly 30 times?

Solution:

The first 29 throws follow the binomial distribution that $n=29, k=2, p=0.1$: $$P(\text{hit the bullseye 3 times among exact 30 throws})$$ $$=P(\text{hit 2 times among the first 29 throws and hit the bullseye on the 30th throw})$$ $$=C_{29}^{2}\times{0.1}^2\times{0.9}^{27}\times0.1\doteq0.02360879$$ R code:

> dbinom(x = 2, size = 29, prob = 0.1) * 0.1
[1] 0.02360879

PROBLEM 7

A deck of cards consists of 8 blue cards and 5 white cards. A simple random sample (random draws without replacement) of 6 cards is selected. What is the chance that one of the colors appears twice as many times as the other?

Solution:

Follow the hypergeometric distribution that $x = 2,4, m=8, n=5, k=6$: $$P(\text{one colors appears twice as many times as the other})$$ $$=P(\text{4 blue cards & 2 white cards})+P(\text{2 blue cards & 4 white cards})$$ $$=\frac{C_{8}^{4}\times C_{5}^{2}+C_{8}^{2}\times C_{5}^{4}}{C_{13}^{6}}\doteq0.4895105$$ R code:

> sum(dhyper(x = c(2, 4), m = 8, n = 5, k = 6))
[1] 0.4895105

PROBLEM 8

A class has 3 Teaching Assistants (TAs). Each TA tosses a coin 10 times. Find the chance that at least one of the TAs gets exactly 5 heads.

Solution:

There are two processes of the binomial distribution. $$P(\text{at least one of the TAs gets exactly 5 heads among 10 tosses})$$ $$=1-P(\text{none of the TAs gets exactly 5 heads among 10 tosses})$$ $$=1-C_{3}^{0}\cdot p^0\cdot{(1-p)}^{3}\doteq0.5714988$$ where $p=C_{10}^{5}\times0.5^5\times0.5^5$. R code:

> p = dbinom(5, 10, 1/2)
> 1 - dbinom(0, 3, p)
[1] 0.5714988

加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Midterm的更多相关文章

  1. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Final

    Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  2. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 5 The accuracy of simple random samples

    Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  3. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 4 The Central Limit Theorem

    Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  4. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 3 The law of averages, and expected values

    Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  5. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 2 Random sampling with and without replacement

    Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  6. 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 1 The Two Fundamental Rules (1.5-1.6)

    Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  7. 加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: FINAL

    Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  8. 加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: Section 2 Testing Statistical Hypotheses

    Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

  9. 加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: Section 1 Estimating unknown parameters

    Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...

随机推荐

  1. OFFSET IN 使用举例

    本文将结合具体实例阐述OFFSET IN的使用方法.注意:这是我第一次写OFFSET IN约束,本文仅供参考.阅读本文前需要了解时序收敛的基本概念,OFFSET IN和Period的相关知识,可先阅读 ...

  2. 分享:关于之前锤子手机刷MIUI之后,现在有事跌宕起伏的刷回了Smartisan OS!

     序言: 距离上次把锤子手机刷成MIUI之后已经一个半月了,我是一个刷机党,一个半月足够让我适应一个系统,了解一个系统.刷机有风险,不过我愿意冒这个风险,因为兴趣,没别的.刷机之后,肯定是有问题的,没 ...

  3. 基于DDD的.NET开发框架 - ABP启动配置

    返回ABP系列 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)”的简称. ASP.NET Boilerplate是一个用最佳实践和流行技术开发现代WEB应 ...

  4. 深入理解OOP(二):多态和继承(继承)

    本文是深入浅出OOP第二篇,主要说说继承的话题. 深入理解OOP(一):多态和继承(初期绑定和编译时多态) 深入理解OOP(二):多态和继承(继承) 深入理解OOP(三):多态和继承(动态绑定和运行时 ...

  5. MongoDB数据库GroupBy查询使用Spring-data-mongondb的实现

    以前用MongoDB数据库都是简单的查询,直接用Query就可以,最近项目中用到了分组查询,完全不一样.第一次遇到,搞了好几天终于有点那意思了. 先上代码: import java.math.BigD ...

  6. make the innerText in the html element can not be selected

    approach style="-moz-user-select:none;" onselectstart="javascript:return false;" ...

  7. LINQ日常使用记录

    1.公司一位美女程序媛写的 2.技术总监提供(来自互联网) var query = from f in db.TField join fw in db.TFieldWel on f.emp_no eq ...

  8. 转 -- linux IO子系统和文件系统读写流程

    我们含有分析的,是基于2.6.32及其后的内核. 我们在linux上总是要保存数据,数据要么保存在文件系统里(如ext3),要么就保存在裸设备里.我们在使用这些数据的时候都是通过文件这个抽象来访问的, ...

  9. Struts2进行url重写

    一般来说我们在用Struts2进行开发的时候我们的访问url都是带上一些类似于.action或者.do还有用?传递参数,这种访问方式与静态页面的访问相比,我就可以用一些开源的组件来进行url的重写,以 ...

  10. Ubuntu下tftp服务器的搭建

    参考博客:http://blog.chinaunix.net/uid-26495963-id-3206829.html 1. 安装 $ apt-get install tftp-hpa tftpd-h ...