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. 【java】企业级分布式搜索平台Solr视频教程

    课程背景为了满足高可用.可扩展并容错的分布式搜索引擎.Solr是一个高性能,采用Java5开发, 基于Lucene的全文搜索服务器.同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现 ...

  2. mongodb .net core 调用

    MongoClient _client; IMongoDatabase _db; MongoCredential credential = MongoCredential.CreateMongoCRC ...

  3. Python2.3-原理之语句和语法

    此节来自于<Python学习手册第四版>第三部分 一.python语句简介(第10章) 1.首先记得一个概念:a.程序由模块构成:b.模块包含语句:c.语句包含表达式:d.表达式建立并处理 ...

  4. Theano2.1.18-基础知识之theano的扩展

    来自:http://deeplearning.net/software/theano/tutorial/extending_theano.html Extending Theano 该教程覆盖了如何使 ...

  5. 如何在 Apache 中为你的网站设置404页面

    一个好的网站,拥有一个好的 404页面 是标配. 为何要有 404页面?如何设置一个 404页面? why 404 pages? 在本地,比如我打开 localhost/fuck.htm(该文件不存在 ...

  6. WPF 让子元素动起来!

    在没有接触Blend之前,自己整出了一个MultiTouchHelper,这东西是做什么的呢?就是利用附加属性让元素可以多点触控. 然后某一天发现Blend里面有一个Behavior的东西,我去,原来 ...

  7. 深入理解计算机系统(4.1)---X86的孪生兄弟,Y86指令体系结构

    引言 各位猿友们好,计算机系统系列很久没更新了,实在是抱歉之极.新的一年,为了给计算机系统系列添加一些新的元素,LZ将其更改为书的原名<深入理解计算机系统>.这本书非常厚,而且难度较高,L ...

  8. 重叠(Overlapping) NAT

    当内部网络也使用公网注册地址(或者是外网合法地址)时,如果仍使用标准的静态或者动态NAT转换,则可能使得转换的内网地址与外网中合法地址冲突,使数据包又返回到了本地网络,这肯定是不行的.这时我们就要使用 ...

  9. iOS -- cocopods使用

  10. Beta版本冲刺———第七天

    会议照片: 项目燃尽图: 1.项目进展: 明天就验收了,今天做的是对项目的所有功能进行复查(由郭怡锋和洪大钊负责); 对于新增的功能:排行榜和撤销一步依然没有做出来.