加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 3 The law of averages, and expected values
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授。
Summary
- Law of Large Numbers As the number of trials increases, the chance that the proportion of successes is in the range $$p\pm\text{a fixed amount}$$ goes to $1$.
- Expected value of the Binomial If a random variable $X$ has the binomial distribution with parameters $n$ and $p$, then $$E(x)=n\cdot p$$
PRACTICE
PROBLEM 1
In each pair of events below, pick the one that has the higher chance.
1a)
A: 50,000 heads in 100,000 tosses of a coin
B: 500,000 heads in 1,000,000 tosses of a coin
1b)
A: In 60 rolls of a die, the number of times “six” shows up is in the range 10 plus or minus 3
B: In 600 rolls of a die, the number of times “six” shows up is in the range 100 plus or minus 3
1c)
A: In 1000 draws by a random number generator, the percent of times “0” shows up is in the range 10% plus or minus 1%
B: In 10,000 draws by a random number generator, the percent of times “0” shows up is in the range 10% plus or minus 1%
1d)
A: In 1000 draws by a random number generator, the percent of times “0” appears is less than 11%
B: In 10,000 draws by a random number generator, the percent of times “0” appears is less than 11%
Solution
1a) A. The chance of getting exactly half heads goes down (i.e. goes to 0) with more tosses. For example:
dbinom(x = 50000, size = 100000, prob = 0.5)
[1] 0.002523126
dbinom(x = 500000, size = 1000000, prob = 0.5)
[1] 0.0007978844
1b) A. The chance that the number of successes falls in the range “most likely value plus or minus a fixed amount” goes down with more rolls. For example:
sum(dbinom(x = 7:13, size = 60, prob = 1/6))
[1] 0.7767122
sum(dbinom(x = 97:103, size = 600, prob = 1/6))
[1] 0.2985048
1c) B. This follows the "Law of Large Numbers".
sum(dbinom(x = 90:110, size = 1000, prob = 1/10))
[1] 0.7318197
sum(dbinom(x = 900:1100, size = 10000, prob = 1/10))
[1] 0.9991879
1d) B. “less than $11\%$” includes $10\%$, which is where the percent of 0’s is going as the number of draws increases. More formally, the chance that the percent of 0’s exceeds the actual probability (i.e. $0.1$) plus any fixed amount (e.g. $0.01$) gets smaller as the number of draws increases. So the probability of the complement gets larger.
PROBLEM 2
My friend and I gamble on a roll of a die as follows: if the die shows 1 spot or 6 spots, I give my friend $\$2$. If the die show 2, 3, 4, or 5 spots, my friend gives me $\$1$. Suppose we play this game 100 times. What is my expected net gain?
Solution
$P(\text{lose})=\frac{1}{3},\ P(\text{win})=\frac{2}{3}$. Therefore $$E=\frac{1}{3}\times(-2)+\frac{2}{3}\times1=0$$
PROBLEM 3
A die is rolled 600 times. The “multiples of 3” are the faces with 3 spots and 6 spots. Find the expected value of:
a) the proportion of times multiples of 3 appear
b) the number of times multiples of 3 appear
Solution
3a) $$P(\text{multiples of 3 appear})=\frac{2}{6}=\frac{1}{3}$$
3b) Binomial distribution, $$E=np=600\times\frac{1}{3}=200$$
PROBLEM 4
If you bet on a “split” in roulette, your chance of winning is 2/38. The bets pays 17 to 1; this means that if you bet \$1 on a split and win the bet, your net gain is \$17; if you lose the bet, you lose your dollar and so your net gain is -\$1. Suppose you place 200 bets on a split; assume your bets are independent of each other. Find your expected net gain.
Solution
The expected value of the proportion of the net gain is $$E_p=\frac{2}{38}\times 17+\frac{36}{38}\times(-1)=-\frac{1}{19}$$ Hence the expected value of the net gain is $$E=200\times(-\frac{1}{19})\doteq-10.52632$$ In other words you expect to come out losing about \$10.53.
EXERCISE SET 3
PROBLEM 1
In a roll of a die, let a "six" be the face with six spots. Consider the two events below.
Event A: more than 16,000 sixes in 100,000 rolls
Event B: more than 160,000 sixes in 1,000,000 rolls.
Which probability is larger?
Solution
According to the Law of Large Numbers, $P(A) < P(B)$. Alternatively, we can test it using smaller examples: $$P(\text{more than 160 sixes in 1000 rolls})$$ $$=\sum_{k=161}^{1000}C_{1000}^{k}\cdot(\frac{1}{6})^k\cdot(\frac{5}{6})^{1000-k}\doteq0.6971976$$ And $$P(\text{more than 1600 sixes in 10000 rolls})$$ $$=\sum_{k=1601}^{10000}C_{10000}^{k}\cdot(\frac{1}{6})^k\cdot(\frac{5}{6})^{10000-k}\doteq0.9626252$$ R code:
sum(dbinom(161:1000, 1000, 1/6))
[1] 0.6971976
sum(dbinom(1601:10000, 10000, 1/6))
[1] 0.9626252
PROBLEM 2
In the bet on a “single number” at roulette, there is chance 1/38 of winning. The bet pays 35 to 1; you can take this to mean that if you win the bet, your net gain is $\$35$, and if you lose the bet then you lose $\$1$ (that is, your net gain is $-\$1$).
You don’t need to know any more about roulette to solve this problem, but the description given above is what would happen if you were to bet $\$1$ on a single number at a Las Vegas roulette table.
Suppose you bet repeatedly on a single number; assume that the bets are independent of each other. Find the expected value of your net gain from 38 bets.
Solution
$$E=38\times(\frac{1}{38}\times35+\frac{37}{38}\times(-1))=38\times(-\frac{2}{38})=-2$$
PROBLEM 3
400 draws are made at random with replacement from 5 tickets that are marked -2, -1, 0, 1, and 2 respectively. Find the expected value of:
3A the number of times positive numbers appear
3B the sum of all the numbers drawn
3C the sum of the positive numbers drawn
Solution
3A) $$E(\text{number of times positive numbers appear})=400\times\frac{2}{5}=160$$
3B) $$E(\text{sum of all the numbers drawn})=0$$
3C) $$E(\text{sum of the positive numbers drawn})$$ $$=400\times(1\times\frac{1}{5}+2\times\frac{1}{5})=400\times\frac{3}{5}=240$$
加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 3 The law of averages, and expected values的更多相关文章
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 5 The accuracy of simple random samples
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 4 The Central Limit Theorem
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 2 Random sampling with and without replacement
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 1 The Two Fundamental Rules (1.5-1.6)
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Final
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Midterm
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: FINAL
Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: Section 2 Testing Statistical Hypotheses
Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: Section 1 Estimating unknown parameters
Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
随机推荐
- Android -- Adapter
体系 public interface Adapter----0层(表示继承体系中的层次) public interface ExpandableListAdapter---(无所谓层次因为没有其他 ...
- Messenger
Messenger Mvvm提倡View和ViewModel的分离,View只负责数据的显示,业务逻辑都尽可能放到ViewModel中, 保持View.xaml.cs中的简洁(没有任何代码,除了构造函 ...
- Python2.3-原理之语句和语法
此节来自于<Python学习手册第四版>第三部分 一.python语句简介(第10章) 1.首先记得一个概念:a.程序由模块构成:b.模块包含语句:c.语句包含表达式:d.表达式建立并处理 ...
- .NET基于Redis缓存实现单点登录SSO的解决方案
一.基本概念 最近公司的多个业务系统要统一整合使用同一个登录,这就是我们耳熟能详的单点登录,现在就NET基于Redis缓存实现单点登录做一个简单的分享. 单点登录(Single Sign On),简称 ...
- 关于安装Visual Studio 2015 RC版卡主不动的解决方案
在官方网站下载了vs_community.exe自动下载安装的软件进行安装,安装到github时候 卡了1个小时 一直显示正在获取,遂感觉不大对劲,使用了FQ程序,过了2分钟果然正常获取安装,进入了下 ...
- ElasticSearch入门系列(四)分布式初探
序言:ElasticSearch致力于隐藏分布式系统的复杂性,以下的操作都是在底层自动完成的: 将你的文档分区到不同的容器或者分片(shards),他们可以存在于一个或多个节点中 将分片均匀的分配到各 ...
- IOS_SearchBar搜索栏及关键字高亮
搜索框的效果演示: 这个就是所谓的搜索框了,那么接下来我们看看如何使用代码来实现这个功能. 我所使用的数据是英雄联盟的英雄名单,是一个JSON数据的txt文件, JSON数据的处理代码如下所示: ? ...
- 消息队列写入内容后,读出来的自动包裹了<string>标签,自定义格式化器解决该issue
/// <summary> /// 该格式化器使输入即输出 /// </summary> public class StringFormatter : IMessageForm ...
- 软件工程(FZU2015)学生博客列表(最终版)
FZU:福州大学软件工程 张老师的博客:http://www.cnblogs.com/easteast/ 经过前两周选课,最后正式选上课程的所有学生博客如下: 序号 学号后3位 博客 1 629 li ...
- ceph calamari 监控系统安装 on ubuntu 14.04
在 ubuntu 14.04 上安装ceph calamari时,遇到calamari web界面中node server可以正常添加,但cluster 集群无法显示的问题. 经过定位,是因为salt ...