Bayes’s formula for Conditional Probability
Conditional Probability
Example:
In a batch, there are 80% C programmers, and 40% are Java and C programmers. What is the probability that a C programmer is also Java programmer?
Let A --> Event that a student is Java programmer
B --> Event that a student is C programmer
P(A|B) = P(A ∩ B) / P(B)
= (0.4) / (0.8)
= 0.5
So there are 50% chances that student that knows C also
knows Java
Exercise:
1) What is the value of P(A|A)?
2) Let P(E) denote the probability of the event E. Given P(A) = 1, P(B) = 1/2, the values of P(A | B) and P(B | A) respectively are (GATE CS 2003)
(A) 1/4, 1/2
(B) 1/2, 1/14
(C) 1/2, 1
(D) 1, 1/2
Bayes’s formula for Conditional Probability
Example : Box P has 2 red balls and 3 blue balls and box Q has 3 red balls and 1 blue ball. A ball is selected as follows:
(i) Select a box
(ii) Choose a ball from the selected box such that each ball in
the box is equally likely to be chosen. The probabilities of
selecting boxes P and Q are (1/3) and (2/3), respectively.
Given that a ball selected in the above process is a red ball, the probability that it came from the box P is (GATE CS 2005)
(A) 4/19
(B) 5/19
(C) 2/9
(D) 19/30
Solution:
R --> Event that red ball is selected
B --> Event that blue ball is selected
P --> Event that box P is selected
Q --> Event that box Q is selected We need to calculate P(P|R)?
P(R|P) = A red ball selected from box P
= 2/5
P(P) = 1/3
P(R) = P(P)*P(R|P) + P(Q)*P(R|Q)
= (1/3)*(2/5) + (2/3)*(3/4)
= 2/15 + 1/2
= 19/30 Putting above values in the Bayes's Formula
P(P|R) = (2/5)*(1/3) / (19/30)
= 4/19
Exercise A company buys 70% of its computers from company X and 30% from company Y. Company X produces 1 faulty computer per 5 computers and company Y produces 1 faulty computer per 20 computers. A computer is found faulty what is the probability that it was bought from company X?
Bayes’s formula for Conditional Probability的更多相关文章
- 【概率论】2-1:条件概率(Conditional Probability)
title: [概率论]2-1:条件概率(Conditional Probability) categories: Mathematic Probability keywords: Condition ...
- 条件概率和链式法则 conditional probability & chain rule
顾名思义, 条件概率指的是某个事件在给定其他条件时发生的概率, 这个非常符合人的认知:我们通常就是在已知一定的信息(条件)情况下, 去估计某个事件可能发生的概率. 概率论中,用 | 表示条件, 条件概 ...
- [PGM] Bayes Network and Conditional Independence
2 - 1 - Semantics & Factorization 2 - 2 - Reasoning Patterns 2 - 3 - Flow of Probabilistic Influ ...
- Fuzzy Probability Theory---(2)Computing Fuzzy Probabilities
Let $X=\{x_1,x_2,...,x_n\}$ be a finite set and let $P$ be a probability function defined on all sub ...
- 数据挖掘十大经典算法(9) 朴素贝叶斯分类器 Naive Bayes
贝叶斯分类器 贝叶斯分类器的分类原理是通过某对象的先验概率,利用贝叶斯公式计算出其后验概率,即该对象属于某一类的概率,选择具有最大后验概率的类作为该对象所属的类.眼下研究较多的贝叶斯分类器主要有四种, ...
- [Machine Learning] Probabilistic Graphical Models:二、Bayes Network Fundamentals(1、Semantics & Factorization)
一.How to construct the dependency? 1.首字母即随机变量名称 2.I->G是更加复杂的模型,但Bayes里不考虑,因为Bayes只是无环图. 3.CPD = c ...
- 关于Bayes网络新解
经典贝叶斯网络 贝叶斯分类器的分类原理是通过某对象的先验概率,利用贝叶斯公式计算出其后验概率,即该对象属于某一类的概率,选择具有最大后验概率的类作为该对象所属的类.目前研究较多的贝叶斯分类器主要有四种 ...
- 十大经典数据挖掘算法(9) 朴素贝叶斯分类器 Naive Bayes
贝叶斯分类器 贝叶斯分类分类原则是一个对象的通过先验概率.贝叶斯后验概率公式后计算,也就是说,该对象属于一类的概率.选择具有最大后验概率的类作为对象的类属.现在更多的研究贝叶斯分类器,有四个,每间:N ...
- Study notes for Discrete Probability Distribution
The Basics of Probability Probability measures the amount of uncertainty of an event: a fact whose o ...
随机推荐
- Python __import__() 函数
Python OS 文件/目录方法 Python 面向对象 Python __import__() 函数 Python 内置函数 描述 __import__() 函数用于动态加载类和函数 . 如 ...
- RxJS之BehaviorSubject
Subject 的其中一个变体就是 BehaviorSubject,它有一个“当前值”的概念.它保存了发送给消费者的最新值.并且当有新的观察者订阅时,会立即从 BehaviorSubject 那接收到 ...
- django的request介绍和APIView流程分析和CBV的流程分析
首先get请求的数据都在request.GET中,request.body中没有,因为只有post请求有请求体,request.body中的数据是请求体的数据 首先,我们还是用cbv的方式来讲解 我们 ...
- js中json知识点
首先,json是一种数据格式,而不能说是一种对象(object).这一点是非常重要的. 起源是不同的语言中数据对象的形式是不一样的,我们为了在不同的语言中传递数据,发明了一种json格式用于消除这种差 ...
- jsplumb流程器使用2
jsplumb默认注册在浏览器的窗口,为整个页面提供静态实例 1. 单独实例化的方法: var firstInstance = jsPlumb.getInstance(); 内部传入可定义对象 全 ...
- springboot 日志1
技术交流群: 816227112 Spring Boot在所有内部日志中使用Commons Logging,但是默认配置也提供了对常用日志的支持,如:Java Util Logging,Log4J, ...
- YII2表单中上传单个文件
有些时候我们提交的表单中含有文件.怎么样让表单里的数据和文件一起提交. 我的数据表tb_user内容如下: CREATE TABLE `tb_user` ( `id` int(11) unsigned ...
- Faiss教程:索引(2)
索引的I/O与复制 所有的函数都是深复制,我们不需要关心对象关系. I/O函数: write_index(index, "large.index"): 写索引到文件 Index * ...
- Python 列表推导实例
#!/usr/bin/python # -*- coding: utf-8 -*- with open('e:/123.txt') as fp:row = fp.readlines() #打开并读取所 ...
- admin 的流程 Xadmin
提交根评论 显示根评论 --- render显示 --- ajax显示 提交子评论 显示子评论 ---- render显示 ---- Ajax显示(扩展) 评论树 博客:富文本编辑器 beautful ...