概率计算器
将两种独立的事件概率合并:和或两者兼而有之。
输入结果时更新 。
关于此计算器
This probability calculator takes the chance of two independent events A and B and works out the key combined probabilities: both happening (A and B), at least one happening (A or B), only one of them, and neither happening. It assumes the events are independent, meaning one occurring does not change the chance of the other. Enter each probability as a percentage between 0 and 100.
The rules it applies are the standard ones for independent events: P(A and B) = P(A) × P(B); P(A or B) = P(A) + P(B) − P(A and B); P(neither) = (1 − P(A)) × (1 − P(B)); and "only A" is P(A) − P(A and B). A pie chart splits the sample space into the four mutually exclusive outcomes (both, A only, B only, neither).
Worked example: with P(A) = 50% and P(B) = 30%, both happen with probability 0.5 × 0.3 = 15%, at least one happens with probability 0.5 + 0.3 − 0.15 = 65%, and neither happens with probability 0.5 × 0.7 = 35%. These four outcomes always add up to 100%.
经常问到的问题
我如何发现两起事件的发生概率?
对于独立事件,乘以概率:P(A和B) = P(A) · P(B) 。 50% 和30% 的事件 都发生0.5 × 0.3 = 0.15 或 15%。
独立在这里意味着什么?
独立是指一个事件的结果对另一个事件没有影响,比如两个不同的硬币翻转。 如果事件相互影响(是依赖的),则这些公式不适用,你需要有条件的概率。
"A或B"怎么算?
P(A或B) = P(A) + P(B) + P(B) - P(A和B)。 减去重叠,使得共同结果无法两次计算,因此结果永远不超过100%。
我如何发现 发生任何意外的可能性?
乘以每一事件未发生的可能性:P(两者均不发生):P(P)(1-P(A)) = x (1-P(P(B) ) x (1-P(B) ) 。 50%和30%的事件为0.5 × 0.7 = 0.35 或35%。
"A"和"B"有什么区别?
“A”或“B”包括两种情况,而“只有一人”排除了这两种情况。“只有一人”等于P(A)或B减去P(A)和P(B),计算两个结果的独一结果,但不计算重叠。
如果这两件事不是独立的呢?
这些公式假定独立。如果一个事件影响另一个事件,您需要有条件概率,P(A和B) = P(A) × P(B | A),而这个计算器会高报或低估总概率。
这些概率是否可达到100%以上?
四个相互排斥的结果 — — 两者均为A,B均不及,均不及,总和等于100%。 个人数字,如“A或B”可能很大,但从未超过100%,因为重叠被减去。
API - 使用代码中的计算器
将此计算器称为自由 JSON 端点 。 不需要按键 。 将字段值发送到下面作为查询参数或 JSON 。 任何您省略的, 都会使用相同的默认值, 此页面预填的默认值是预填的; 未知参数是 400, 而不是静音零 。 读取 API 全部文件 →
终点
GET https://calculator.free/api/v1/probability/
curl
curl "https://calculator.free/api/v1/probability/?pa=50&pb=30"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/probability/?" + new URLSearchParams({
"pa": "50",
"pb": "30"
}));
const data = await r.json();
console.log(data.results);
成果仅是一般指导的估计数,而不是财务、医疗或税务咨询。