当前位置:网站首页>【概率和计数】
【概率和计数】
2022-07-20 01:18:00 【菜鸟炼丹师】
一些基本概念
样本空间:样本空间表示某个实验所有可能结果的集合
事件:事件是样本空间的子集
概率的简单定义: P ( A ) = 事件 A 发生的频数 样本空间事件个数 P(A)=\frac{事件A发生的频数}{样本空间事件个数} P(A)=样本空间事件个数事件A发生的频数
例如假设我们投掷2枚硬币,那么其可能的结果有{HH,HT,TH,TT}
因此 P ( 两次都是反面朝上 ) = 1 4 P(两次都是反面朝上)=\frac14 P(两次都是反面朝上)=41
同时这个定义有两个前提假设
- 样本空间的事件个数是有限的
- 样本空间中所有事件发生的概率是相同的
计数规则
整体上我们使用的是乘法规则,即假设我们做了 r r r个独立的实验,第一次实验的实验结果有 n 1 n_1 n1种,第二次实验结果有 n 2 n_2 n2种,第 r r r次实验结果有 n r n_r nr种,那么这些组合实验的实验结果有 n 1 n 2 . . . n r n_1n_2...n_r n1n2...nr种
下面再来看一个例子:
假设我们从52张扑克牌中任取5张,选出来的牌打出三代二的可能性是多少?
首先我们看分母的概率是 C 52 5 = 52 ! ( 52 − 5 ) ! 5 ! C_{52}^5=\frac{52!}{(52-5)!~5!} C525=(52−5)! 5!52!(这是高中二项分布的知识)
再来看分子,我们具体看其中的一种可能(三张7,两张10)
- 首先选出三张牌出自7的可能性为 13 C 4 3 13C_4^3 13C43
- 其次剩下的两张牌出自10的可能性为 12 C 4 2 12C_4^2 12C42
因此我们可以得到答案: 13 C 4 3 12 C 4 2 C 52 5 \frac{13C_4^312C_4^2}{C_{52}^5} C52513C4312C42
再来看一下从 n n n个人中选择 k k k个人的问题
- 我们可以综合考虑是否就可以重复选择,以及选择顺序是否重要得到以下划分:
order | don’t order | |
---|---|---|
replace | n k n^k nk | C n + k − 1 k C_{n+k-1}^k Cn+k−1k |
don’t replace | n ( n − 1 ) . . . ( n − k + 1 ) n(n-1)...(n-k+1) n(n−1)...(n−k+1) | C n k C_n^k Cnk |
如果我们熟悉了乘法规则,上述表格中的三种情况我们都可以轻松的填上,但对于replace & don’t order还是比较费力,我们来看一下这种情况应该如何去分析
- 首先我们来讨论一些极端情况:
- k = 0 k=0 k=0,此时结果就变成了 C n − 1 0 = 1 C_{n-1}^0=1 Cn−10=1,答案正确
- k = 1 k=1 k=1,此时结果变成了 C n 1 = n C_{n}^1=n Cn1=n,答案正确
- n = 2 n=2 n=2,此时结果变成了 C k + 1 k = k + 1 C_{k+1}^k=k+1 Ck+1k=k+1,这个答案也是正确的,因为如果只有两个人,并且不考虑顺序,不选择A只可能选择B,因此我们只需要观察一个人的被选择次数即可,可能的结果是 { 0 , 1 , . . . , k } \{0,1,...,k\} { 0,1,...,k},一共有 k + 1 k+1 k+1种可能性。
- 相对泛化一些,这种情况我们可以看做是从 n n n个盒子中选择出 k k k个小球来,由于他们是无序的,因此我们可以用 n − 1 n-1 n−1个间隔来区分来自于哪个盒子。因此结果就可以看作从 n − 1 + k n-1+k n−1+k个位置中选出 k k k个位置放小球,剩下的位置放间隔,即 C n + k − 1 k C_{n+k-1}^k Cn+k−1k
对于4个盒子取9个球,其效果如下图所示:
边栏推荐
- Unlock high scores | eBay deepens user experience and optimizes large screen device applications
- 2022/7/19
- Net question and answer: is there the most efficient way to check large files in C?
- [translation] dynamic query in C # expression
- Example of conventional deployment configuration of Huawei campus network
- AVL 树
- 网络流,二分图与图的匹配
- 解锁高评分 | eBay 深耕用户体验,优化大屏幕设备应用
- CCTV news news "Suzhou restaurant manual tearing quota invoice" news channel_ People's network
- 【731. 我的日程安排表 II】
猜你喜欢
云计算与边缘计算有什么区别和联系?
Operation of variables in MySQL
归并排序及优化
LeetCode_90_子集Ⅱ
Arduino读取传感器数据存进Excel中
Net question and answer: is there the most efficient way to check large files in C?
零信任和SASE有什么不一样?答案其实并不重要
VMware 启动报错:Exception 0xc0000005和windwos11没有Hyper-V的解决方法
校验码在线计算工具
C # understand these 100 + lines of code, and you will really get started (Classic)
随机推荐
全局事件总线概述
Why has API strategy become a magic weapon for enterprises' digital transformation?
CCTV news "Chengdu rent quota invoice by hand" news channel_ People's network
C# 看懂这100+行代码,你就真正入门了(经典)
[leetcode] split the basic template and find the left and right boundaries
想低成本保障軟件安全?五大安全任務值得考慮
"Oserror: [winerror 126] cannot find the specified module"
NVIDIA NX usage notes
读取Geotiff栅格文件赋值给点
CCTV news news news channel of Guangzhou catering manual tearing quota invoice_ People's network
CCTV news news channel "Nanjing opens catering quota invoice by hand"_ People's network
解锁高评分 | eBay 深耕用户体验,优化大屏幕设备应用
DeiT:注意力也能蒸馏
Network flow, bipartite graph and graph matching
What are the differences and connections between cloud computing and edge computing?
建模杂谈系列144 SCLC工程化实验
小程序:页面滚动到某个位置导航条固定效果
Create the future and enjoy extraordinary. Opengauss Developer Day 2022 was successfully held
如何入门.NET Core ? 推荐这10个优秀的开源项目!
【JVM 系列】JVM 对象的分配策略