概率论快速学习03:概率公理补充

简介:

Written In The Font

  I  like maths when i was young,but I need to record them. So I am writing with some demos of Python

 

Content

  If two events, A and B are independent then the joint probability is

   P(A \mbox{ and }B) =  P(A \cap B) = P(A) P(B),\,

          Durchschnitt.png                                         

 

For example, if two coins are flipped the chance of both being heads is

\tfrac{1}{2}\times\tfrac{1}{2} = \tfrac{1}{4}.

 

In Python

A = set([1,2,3,4,5])
B = set([2,4,3,5,6])
C = set([4,6,7,4,2,1])

print(A & B & C)

Output:

{2, 4}

# & find the objects  the same in Set


         

   If either event A or event B or both events occur on a single performance of an experiment this is called the union of the events A and B denoted as:

   P(A \cup B).

  If two events are mutually exclusive then the probability of either occurring is

  P(A\mbox{ or }B) =  P(A \cup B)= P(A) + P(B).

            Vereinigung.png

 

For example, the chance of rolling a 1 or 2 on a six-sided die is

 P(1\mbox{ or }2) = P(1) + P(2) = \tfrac{1}{6} + \tfrac{1}{6} = \tfrac{1}{3}.

 

In Python

A = set([1,2,3,4,5])
B = set([2,4,3,5,6])
C = set([4,6,7,4,2,1])

print(A | B | C)
Output:
{1, 2, 3, 4, 5, 6, 7}

# | find all the objects the set has


  If the events are not mutually exclusive then

  P\left(A \hbox{ or } B\right)=P\left(A\right)+P\left(B\right)-P\left(A \mbox{ and } B\right).

Proved

  
\begin{align}
P(A\cup B) & =P(A\setminus B)+P(A\cap B)+P(B\setminus A)\\
& =P(A)-P(A\cap B)+P(A\cap B)+P(B)-P(A\cap B)\\
& =P(A)+P(B)-P(A\cap B)
\end{align}

 

For example:

  Let’s use Python to show u an example about devil's bones (骰子,不是 魔鬼的骨头哈87B7B1~1_thumb)

A = set([1,2,3,4,5,6])  # the all results of devil's bones
B = set([2,4,3])        # the A event results 
C = set([4,6])          # the B event results 

P_B =  1/2
P_C =  1/3

D = B | C
print(D)

P_D = 2/3

print(P_D == (P_B+P_C - 1/6))
Output:
{2, 3, 4, 6}
True

Let me show u some others :


         P(A)\in[0,1]\,
         P(A^c)=1-P(A)\,
         \begin{align}
P(A\cup B) & = P(A)+P(B)-P(A\cap B) \\
P(A\cup B) & = P(A)+P(B) \qquad\mbox{if A and B are mutually exclusive} \\
\end{align}
         \begin{align}
P(A\cap B) & = P(A|B)P(B) = P(B|A)P(A)\\
P(A\cap B) &  = P(A)P(B) \qquad\mbox{if A and B are independent}\\
\end{align} 
        P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{P(B|A)P(A)}{P(B)} \, 

 

If u r tired , please have a tea , or look far to make u feel better.If u r ok, Go on!


  Conditional probability is the probability of some event A, given the occurrence of some other event B. Conditional probability is written:

   P(A \mid B),

   Some authors, such as De Finetti, prefer to introduce conditional probability as an axiom of probability:

P(A \cap B) = P(A|B)P(B)

Given two events A and B from the sigma-field of a probability space with P(B) > 0, the conditional probability of A given Bis defined as the quotient of the probability of the joint of events A and B, and the probability of B:  

  P(A|B) = \frac{P(A \cap B)}{P(B)}

  the ①② expressions  are the same. Maybe u can remember one , the other will be easy to be coverted.So I am going to tell an excemple to let u remmeber it(them):

  

  “the phone has a power supply (B), the phone can be used to call others(A).”

  One →  P(A \mid B) : When the phone has a full power supply , u can call others.

  Two →P(B): has   a power supply           

  Three = One +  Two → U can call others about your love with others.

 

do u remember it?

                                                                 u=2234442768,3895906646&fm=21&gp=0_thumb[1]

 

Editor's Note

    “路漫漫其修远兮,吾将上下而求索”

 

The Next

            cya soon. We meet a big mess called The total probability and Bayes .

 

      The total probability

      P( A )=P( A | H_1) \cdot P( H_1)+\ldots +P( A | H_n) \cdot P( H_n)
P(A)=\sum_{j=1}^n P(A|H_j)\cdot P(H_j)

      Bayes (Thomas, 1702-1761,) ; 

       P(A \vert B) = \frac {P(B \vert A) \cdot P(A)} {P(B)}

if u wanna talk with me , add the follow:

 

QQ截图20140525001523_thumb[3]

相关文章
|
5天前
|
云安全 人工智能 安全
AI被攻击怎么办?
阿里云提供 AI 全栈安全能力,其中对网络攻击的主动识别、智能阻断与快速响应构成其核心防线,依托原生安全防护为客户筑牢免疫屏障。
|
15天前
|
域名解析 人工智能
【实操攻略】手把手教学,免费领取.CN域名
即日起至2025年12月31日,购买万小智AI建站或云·企业官网,每单可免费领1个.CN域名首年!跟我了解领取攻略吧~
|
9天前
|
安全 Java Android开发
深度解析 Android 崩溃捕获原理及从崩溃到归因的闭环实践
崩溃堆栈全是 a.b.c?Native 错误查不到行号?本文详解 Android 崩溃采集全链路原理,教你如何把“天书”变“说明书”。RUM SDK 已支持一键接入。
614 216
|
存储 人工智能 监控
从代码生成到自主决策:打造一个Coding驱动的“自我编程”Agent
本文介绍了一种基于LLM的“自我编程”Agent系统,通过代码驱动实现复杂逻辑。该Agent以Python为执行引擎,结合Py4j实现Java与Python交互,支持多工具调用、记忆分层与上下文工程,具备感知、认知、表达、自我评估等能力模块,目标是打造可进化的“1.5线”智能助手。
857 61
|
7天前
|
人工智能 移动开发 自然语言处理
2025最新HTML静态网页制作工具推荐:10款免费在线生成器小白也能5分钟上手
晓猛团队精选2025年10款真正免费、无需编程的在线HTML建站工具,涵盖AI生成、拖拽编辑、设计稿转代码等多种类型,均支持浏览器直接使用、快速出图与文件导出,特别适合零基础用户快速搭建个人网站、落地页或企业官网。
1287 157
|
5天前
|
编解码 Linux 数据安全/隐私保护
教程分享免费视频压缩软件,免费视频压缩,视频压缩免费,附压缩方法及学习教程
教程分享免费视频压缩软件,免费视频压缩,视频压缩免费,附压缩方法及学习教程
241 138
|
7天前
|
存储 安全 固态存储
四款WIN PE工具,都可以实现U盘安装教程
Windows PE是基于NT内核的轻量系统,用于系统安装、分区管理及故障修复。本文推荐多款PE制作工具,支持U盘启动,兼容UEFI/Legacy模式,具备备份还原、驱动识别等功能,操作简便,适合新旧电脑维护使用。
531 109