当前位置:网站首页>binom二项分布,
binom二项分布,
2022-07-31 03:40:00 【人工智能曾小健】
二项分布(英语:Binomial distribution)是n个独立的是/非试验中成功的次数的离散概率分布,其中每次试验的成功概率为p。这样的单次成功/失败试验又称为伯努利试验。实际上,当n = 1时,二项分布就是伯努利分布。二项分布是显著性差异的二项试验的基础。
from scipy.stats import binom
import matplotlib.pyplot as plt
# setting the values
# of n and p
n = 6
p = 0.5
# defining list of r values
r_values = list(range(n + 1))
# list of pmf values
dist = [binom.pmf(r, n, p) for r in r_values ]
# plotting the graph
plt.bar(r_values, dist)
plt.show()
边栏推荐
- 【Exception】The field file exceeds its maximum permitted size of 1048576 bytes.
- 自己的一些思考
- [Compilation principle] Lexical analysis program design principle and implementation
- SIP协议标准和实现机制
- PMP WeChat group daily exercises
- [C language] General method of expression evaluation
- Redis 统计用户新增和留存
- beforeDestroy与destroyed的使用
- [Dynamic programming] Maximum sum of consecutive subarrays
- Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
猜你喜欢

BP神经网络

A brief introduction to the CheckBox component of the basic components of Flutter
![[C language] General method of base conversion](/img/28/954af5f47a79ff02d3cc0792ac8586.jpg)
[C language] General method of base conversion

A brief introduction to the showDatePicker method of the basic components of Flutter

Database implements distributed locks

SIP协议标准和实现机制

「 每日一练,快乐水题 」1331. 数组序号转换

端口排查步骤-7680端口分析-Dosvc服务

"A daily practice, happy water problem" 1331. Array serial number conversion

Safety 20220712
随机推荐
log level and print log note
type_traits metaprogramming library learning
Understanding and Using Unity2D Custom Scriptable Tiles (4) - Start to build a custom tile based on the Tile class (below)
"A daily practice, happy water problem" 1331. Array serial number conversion
Redis counts new and retained users
(Line segment tree) Summary of common problems of basic line segment tree
No qualifying bean of type question
LeetCode每日一练 —— OR36 链表的回文结构
[C language] Three-pointed chess (classic solution + list diagram)
Port inspection steps - 7680 port analysis - Dosvc service
The Map Entry understanding and application
[shell basics] determine whether the directory is empty
Observer pattern
C语言从入门到如土——数据的存储
(tree) Last Common Ancestor (LCA)
(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
[AUTOSAR-RTE]-5-Explicit (explicit) and Implicit (implicit) Sender-Receiver communication
Web container and IIS --- Middleware penetration method 1
Recursive query single table - single table tree structure - (self-use)
Why don't you programmers make a living off your own projects?And have to work for someone else?