<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>ベイズ確率 | KENブログ 風のように、しなやかに</title>
	<atom:link href="https://kenyu.red/archives/tag/%e3%83%99%e3%82%a4%e3%82%ba%e7%a2%ba%e7%8e%87/feed" rel="self" type="application/rss+xml" />
	<link>https://kenyu.red</link>
	<description>気づいたこと思ったことなどを、気ままに書き連ねています。</description>
	<lastBuildDate>Sun, 28 Feb 2021 19:41:37 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="https://kenyu.red/archives/tag/%e3%83%99%e3%82%a4%e3%82%ba%e7%a2%ba%e7%8e%87/feed" />
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>ベイズの定理の証明！？意外と簡単な確率の計算でした！</title>
		<link>https://kenyu.red/archives/3434.html</link>
					<comments>https://kenyu.red/archives/3434.html#respond</comments>
		
		<dc:creator><![CDATA[kenken]]></dc:creator>
		<pubDate>Thu, 18 Jun 2015 08:52:47 +0000</pubDate>
				<category><![CDATA[教養・趣味・娯楽]]></category>
		<category><![CDATA[ベイズ推定]]></category>
		<category><![CDATA[ベイズ確率]]></category>
		<category><![CDATA[ベイズ統計]]></category>
		<category><![CDATA[数学]]></category>
		<category><![CDATA[確率]]></category>
		<guid isPermaLink="false">http://kenyu.red/?p=3434</guid>

					<description><![CDATA[<p>ベイズ推定・統計の基本となる、ベイズの定理。 この定理、なんだかなじめないという人が、意外と多いんですよね。 ベイズ推定・統計を使いこなす「ベイジアン」になるには、まず、このベイズ確率の基本となる、ベイズの定理を覚えなく [&#8230;]</p>
The post <a href="https://kenyu.red/archives/3434.html">ベイズの定理の証明！？意外と簡単な確率の計算でした！</a> first appeared on <a href="https://kenyu.red">KENブログ　風のように、しなやかに</a>.]]></description>
										<content:encoded><![CDATA[<p>
<p>ベイズ推定・統計の基本となる、<strong><span style="font-size: 24px;">ベイズの定理</span></strong>。<br />
この定理、なんだかなじめないという人が、意外と多いんですよね。</p>
<br />
<br />
<div id="attachment_3568" style="width: 290px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-3568" src="https://kenyu.red/wp-content/uploads/2015/06/Thomas_Bayes-280x300.gif" alt="Thomas Byayes 1702-1761" width="280" height="300" class="size-medium wp-image-3568" /><p id="caption-attachment-3568" class="wp-caption-text">Thomas Byayes 1702-1761</p></div><br />
<p>ベイズ推定・統計を使いこなす「<strong>ベイジアン</strong>」になるには、まず、このベイズ確率の基本となる、ベイズの定理を覚えなくてはいけません。</p>
<p><img decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/132947-250x300.png" alt="132947" width="118" height="142" class="  wp-image-3282 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/132947-250x300.png 250w, https://kenyu.red/wp-content/uploads/2015/06/132947-855x1024.png 855w, https://kenyu.red/wp-content/uploads/2015/06/132947.png 869w" sizes="(max-width: 118px) 100vw, 118px" />この定理の証明は、とても簡単です。<br />
また、意味が分かれば、簡単に覚えてしまいます。</p>
<p>ここでは、そんなベイズの定理の証明を、誰でも分かるように、確率の基礎から丁寧に、解説をしていきます。</p>
<p>勉強ではなく、ゲームの解説でも聞くような気楽な気持ちで、楽しんで見て下さい（笑）</p>
<br />

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2" checked><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">ベイズの定理</a></li><li><a href="#toc2" tabindex="0">確率の基本</a><ol><li><a href="#toc3" tabindex="0">乗法定理（積の法則）</a></li></ol></li><li><a href="#toc4" tabindex="0">条件付確率：同時確率との関係</a><ol><li><a href="#toc5" tabindex="0">B と A の同時確率</a></li></ol></li><li><a href="#toc6" tabindex="0">ベイズの定理の証明</a><ol><li><a href="#toc7" tabindex="0">A と B の同時確率</a></li><li><a href="#toc8" tabindex="0">証明最終段階</a></li></ol></li><li><a href="#toc9" tabindex="0">まとめ</a></li><li><a href="#toc10" tabindex="0">あとがき</a></li></ol>
    </div>
  </div>

<h2 style="border-bottom: 1px solid #426579; border-left: 10px solid #426579; padding: 7px;"><span id="toc1">ベイズの定理</span></h2>
<p>さて、まず最初にベイズの定理について、見てみましょう。</p>
<br />
<div style="padding: 20px; padding-bottom: 0px; border: solid 2px darkblue; border-radius: 10px; background-color: lemonchiffon; margin-top: 30px; margin-bottom: 30px; box-shadow: 5px 5px 5px #AAA;"><span style="font-size: 24px; background-color: #ffcc00;"><strong><span style="background-color: #ff6600;"> <span style="color: #ffffff;">ベイズの定理 </span> </span><br />
</strong></span><br />
<img decoding="async" src="https://kenyu.red/wp-content/uploads/2015/05/ff414f56816dd7f5cf71bf79c58bd468.png" alt="ベイズの定理" width="315" height="73" class="alignnone  wp-image-2761" />
<p></p>
<p></p>
<br />
<ul>
 	<li>P(A) : A が起きる確率</li>
 	<li>P(B) : B が起きる確率（<strong>事前確率</strong>）</li>
 	<li>P(A|B) : B の後でA が起きる確率（条件付き確率、<strong>尤度</strong>）</li>
 	<li>P(B|A) : A の後でB が起きる確率（条件付き確率、<strong>事後確率</strong>）</li>
</ul>
</div>
<p>さて、それではこれを簡単に解説をしていきます。<br />
まずは、ベイズの定理の理解に必要な確率の基本を、簡単におさらいしましょう。</p>
<br />
<h2 style="border-bottom: 1px solid #426579; border-left: 10px solid #426579; padding: 7px;"><span id="toc2">確率の基本</span></h2>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/081805-282x300.png" alt="081805" width="129" height="137" class="  wp-image-2934 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/081805-282x300.png 282w, https://kenyu.red/wp-content/uploads/2015/06/081805.png 926w" sizes="(max-width: 129px) 100vw, 129px" />ベイズの定理は、覚え難そうに見えますが、確率の基本の乗法定理を組み合わせただけです。</p>
<p>まずは、乗法定理をしっかりと押さえておきましょう。</p>
<br />
<h3 style="border-left: 10px solid darkgreen; padding: 4px;"><span id="toc3">乗法定理（積の法則）</span></h3>
<p>乗法定理を使う確率の問題は次の様なものがあります。</p>
<br />
<div style="padding: 20px; border: solid 2px darkblue; border-radius: 10px; margin-top: 30px; margin-bottom: 30px;"> <img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/ff51f36782c4bb6eff2c1619f73fbeb3.png" alt="確率乗法定理問題と解答" width="459" height="485" class="alignnone size-full wp-image-3552" srcset="https://kenyu.red/wp-content/uploads/2015/06/ff51f36782c4bb6eff2c1619f73fbeb3.png 459w, https://kenyu.red/wp-content/uploads/2015/06/ff51f36782c4bb6eff2c1619f73fbeb3-284x300.png 284w" sizes="(max-width: 459px) 100vw, 459px" /></div>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/165674-227x300.png" alt="165674" width="82" height="108" class="  wp-image-3090 alignleft" srcset="https://kenyu.red/wp-content/uploads/2015/06/165674-227x300.png 227w, https://kenyu.red/wp-content/uploads/2015/06/165674.png 297w" sizes="(max-width: 82px) 100vw, 82px" />さて、この問題を見て分かるとおり、<strong>確率1/6 と 1/2のかけ算（乗法・積算）</strong>することで、確率が求められています。</p>
<p>でも、なぜ掛け算なんでしょうか？</p>
<p>これは、次の図を見れば分かります。</p>
<br />
<div style="padding: 20px; border-radius: 10px; border: 2px solid darkblue; margin-top: 30px; margin-bottom: 30px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/cb7ac80336680e33bc867ab5664f8ed5.png" alt="サイコロ乗法定理図" width="328" height="353" class="  wp-image-3550 aligncenter" srcset="https://kenyu.red/wp-content/uploads/2015/06/cb7ac80336680e33bc867ab5664f8ed5.png 322w, https://kenyu.red/wp-content/uploads/2015/06/cb7ac80336680e33bc867ab5664f8ed5-278x300.png 278w" sizes="(max-width: 328px) 100vw, 328px" /></div>
<p>1回目で、確率1/6のものが、更に2回目で、その確率が半分（1/2）になるので、確率は1/12になります。</p>
<p>ここで、大事な事は、１回目に１、２回目に偶数という、<span style="border-bottom-color: orange; border-bottom-width: 3px; border-bottom-style: solid;"><strong>二つの事象が同時に成り立つ確率</strong>は、それぞれの確率を掛け合わせればよいということです</span>。</p>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/164041-275x300.png" alt="164041" width="110" height="120" class="  wp-image-3094 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/164041-275x300.png 275w, https://kenyu.red/wp-content/uploads/2015/06/164041.png 364w" sizes="(max-width: 110px) 100vw, 110px" />これを、「<span style="color: #ff0000;"><strong>同時確率</strong></span>」といいいますが、確率の乗法定理は、この同時確率を、求めるための公式です。</p>
<p>さて、それでは次の問題を見てみましょう。</p>
<br />
<h2 style="padding: 7px; border-bottom-color: #426579; border-left-color: #426579; border-bottom-width: 1px; border-left-width: 10px; border-bottom-style: solid; border-left-style: solid;"><span id="toc4">条件付確率：同時確率との関係</span></h2>
<p></p>
<br />
<div style="padding: 20px; border: solid 2px darkblue; border-radius: 10px; margin-top: 30px; margin-bottom: 30px;">ある喫茶店が、店のニガイコーヒーに合うお菓子アマイーを作った。<br />
<p></p>
<p>１ヶ月間の売上げを見たところ、次の様な結果が出た。</p>
<br />
<table style="border-color: #000000; height: 141px;" width="300">
<tbody>
<tr>
<td style="border-color: #000000;"> １ヶ月間の、<strong>お客様全員</strong>の数</td>
<td style="border-color: #000000;"><strong> ３００名 </strong></td>
</tr>
<tr>
<td style="border-color: #000000;"><strong> アマイー</strong>を注文したお客様の数</td>
<td style="border-color: #000000;"><strong> ４０名 　　</strong></td>
</tr>
<tr>
<td style="border-color: #000000;"> <strong>ニガイコーヒー</strong>を注文したお客様の数</td>
<td style="border-color: #000000;"><strong> １００名 </strong></td>
</tr>
<tr>
<td style="border-color: #000000;"><strong> ニガイコーヒー</strong>を注文して、<strong>アマイー</strong>を注文したお客様の数</td>
<td style="border-color: #000000;"><strong> ２０名</strong></td>
</tr>
</tbody>
</table>
<p>これを、ベン図で書くと、この様になります。 <img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/be3a3743135390460f43055c6ad7cdf6.png" alt="ベイズの定理ベン図" width="547" height="360" class="alignnone  wp-image-3544" srcset="https://kenyu.red/wp-content/uploads/2015/06/be3a3743135390460f43055c6ad7cdf6.png 614w, https://kenyu.red/wp-content/uploads/2015/06/be3a3743135390460f43055c6ad7cdf6-300x197.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></p>
<br />
</div>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/05/133946-252x300.png" alt="133946" width="86" height="103" class="  wp-image-2501 alignleft" srcset="https://kenyu.red/wp-content/uploads/2015/05/133946-252x300.png 252w, https://kenyu.red/wp-content/uploads/2015/05/133946-859x1024.png 859w, https://kenyu.red/wp-content/uploads/2015/05/133946.png 877w" sizes="(max-width: 86px) 100vw, 86px" />
さて、このデータをもとに、次に来たお客様について考えてみましょう。</p>
<p>ニガイコーヒーとアマイーの両方を注文する確率は、一体、どれくらいでしょうか？</p>
<p>これは、さっきのサイコロと同じで、同時確率を求めれば、いいですよね。</p>
<br />
<ol>
 	<li>ニガイコーヒーを注文する</li>
 	<li>アマイーを注文する</li>
</ol>
<p>この２つの事象が同時に成り立つ時の確率です。</p>
<p>答えは、簡単ですね。</p>
<p>全体の300のうち、両方を注文したお客様は20名なので、BとAの同時確率は、20/300　= 1/15 です。</p>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/120185-271x300.png" alt="120185" width="111" height="123" class="  wp-image-3125 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/120185-271x300.png 271w, https://kenyu.red/wp-content/uploads/2015/06/120185.png 831w" sizes="(max-width: 111px) 100vw, 111px" />
さて、ここからが、おもしろくなります（笑）</p>
<br />
<h3 style="padding: 4px; border-left-color: darkgreen; border-left-width: 10px; border-left-style: solid;"><span id="toc5">B と A の同時確率</span></h3>
<p> <span style="font-size: 16px;">この同時確率は、次の2つを使って表現することができます。</span></p>
<br />
<ol>
 	<li><span style="font-size: 16px;"><strong>全体の中で、ニガイコーヒーを注文したお客様の確率</strong>　</span></li>
 	<li><span style="font-size: 16px;"><strong>ニガイコーヒーを注文したお客様で、アマイーを注文したお客様の確率</strong></span></li>
</ol>
<ul style="list-style: none;">
 	<li>まず、<span style="font-size: 24px;"><strong>１</strong></span>番からです。<br />
お客様全員は300名で、その内、ニガイーコーヒーを注文したお客様は100名です。<br />
<p>従って、確率は <img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/c8479b537c9fa4ed09cc420ff827d457.png" alt="300分の100" width="59" height="63" class="alignnone  wp-image-3567" /></p>
</li>
 	<li>続いて、<strong><span style="font-size: 24px;">２</span></strong>番です。<br />
ニガイコーヒーを注文したお客様が100名、その中でアマイーも注文したお客様は20名です。<br />
<p>従って、確率は<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/e67a7d14f624faad8c2eae4cfd6496f2.png" alt="100分の20" width="63" height="66" class="alignnone  wp-image-3566" /></p>
</li>
</ul>
<p>この<strong><span style="font-size: 24px;">1</span></strong>番と<span style="font-size: 24px;"><strong>2</strong></span>番を使って、同時確率（ニガイコーヒーとアマイーの両方を注文する確率）を求めると・・・</p>
<br />
<div style="padding: 20px; border-radius: 10px; border: 2px solid darkblue; margin-top: 30px; margin-bottom: 30px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/331126efbb4c3361333ca45f33fedde4.png" alt="約分" width="376" height="164" class="alignnone size-full wp-image-3547" srcset="https://kenyu.red/wp-content/uploads/2015/06/331126efbb4c3361333ca45f33fedde4.png 376w, https://kenyu.red/wp-content/uploads/2015/06/331126efbb4c3361333ca45f33fedde4-300x131.png 300w" sizes="(max-width: 376px) 100vw, 376px" /><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/112224-300x300.png" alt="112224" width="117" height="117" class="alignnone  wp-image-3073" srcset="https://kenyu.red/wp-content/uploads/2015/06/112224-300x300.png 300w, https://kenyu.red/wp-content/uploads/2015/06/112224-150x150.png 150w, https://kenyu.red/wp-content/uploads/2015/06/112224.png 351w" sizes="(max-width: 117px) 100vw, 117px" /></div>
<p>この100は、ニガイコーヒーを注文したお客様の数です。<br />
一般化する為に、次の様に置き換えます 。</p>
<br />
<div style="padding: 20px; border-radius: 10px; border: 2px solid darkblue; margin-top: 30px; margin-bottom: 30px; background-color: lemonchiffon; box-shadow: 5px 5px 5px #AAA;">
<ul>
 	<li>アマイー を注文　⇒　 事象<span style="font-size: 20px;">A</span></li>
 	<li>ニガイーコーヒーを注文 　⇒　事象 <span style="font-size: 20px;">B</span></li>
</ul>
<p> ニガイコーヒーを注文する確率<br />
<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/05/066996-150x150.png" alt="066996" width="37" height="37" class="alignnone  wp-image-2799" /><strong><span style="font-size: 20px;">B </span></strong>が起こる確立<br />
<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/05/066996-150x150.png" alt="066996" width="36" height="36" class="alignnone  wp-image-2799" /> <span style="font-size: 20px;"><strong>P（B）</strong></span></p>
<p>ニガイコーヒーを注文したという条件で、アマイーを注文する確率<br />
<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/05/066996-150x150.png" alt="066996" width="36" height="36" class="alignnone  wp-image-2799" /><strong><span style="font-size: 20px;">B</span></strong> が起きた後で <strong><span style="font-size: 20px;">A</span> </strong>が起きる確率（条件付き確率）<br />
<span style="font-size: 20px;"><strong><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/05/066996-150x150.png" alt="066996" width="36" height="36" class="alignnone  wp-image-2799" />P(A|B)</strong></span></p>
<p><strong> <span style="font-size: 16px;">同時確率</span></strong><span style="font-size: 16px;">は</span><span style="font-size: 16px;">、これらを、<strong><span style="font-size: 20px;">掛け算</span></strong>すればよいので、次の様になります。<br />
</span></p>
<br />
<div style="padding: 20px; border: solid 2px darkblue; border-radius: 10px; background-color: white; margin-top: 30px; margin-bottom: 30px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/88c851f8849ce89cf247c01565fa7402.png" alt="BとAの同時確率" width="517" height="229" class="alignnone  wp-image-3589" srcset="https://kenyu.red/wp-content/uploads/2015/06/88c851f8849ce89cf247c01565fa7402.png 686w, https://kenyu.red/wp-content/uploads/2015/06/88c851f8849ce89cf247c01565fa7402-300x133.png 300w" sizes="(max-width: 517px) 100vw, 517px" /></div>
</div>
<p> <img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/132442-300x300.png" alt="132442" width="110" height="110" class="  wp-image-3081 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/132442-300x300.png 300w, https://kenyu.red/wp-content/uploads/2015/06/132442-150x150.png 150w, https://kenyu.red/wp-content/uploads/2015/06/132442.png 397w" sizes="(max-width: 110px) 100vw, 110px" />ここで、先ほどの、ベイズの定理を、もう一度見てみてください。</p>
<p>この同時確率の式が、そのままベイズの定理の「分子」の部分であることが分かると思います。</p>
<p>さて、それでは、いよいよベイズの定理の証明にいきましょう。</p>
<br />
<h2 style="border-bottom: 1px solid #426579; border-left: 10px solid #426579; padding: 7px;"><span id="toc6">ベイズの定理の証明</span></h2>
<p>証明には、B と A の同時確率は、A と B の同時確率 から導きますが、これらは共に答えは同じです。</p>
<p>念の為、さっきの、ニガイコーヒー（B）と、アマイー（A）の例で見てみましょう。</p>
<br />
<h3 style="border-left: 10px solid darkgreen; padding: 4px;"><span id="toc7">A と B の同時確率</span></h3>
<ol>
 	<li>  全体の中で、アマイーを注文したお客様の確率</li>
 	<li>  アマイーを注文したお客様で、ニガイコーヒーを注文したお客様の確率</li>
</ol>
<ul style="list-style: none;">
 	<li>まず、<strong><span style="font-size: 24px;">１</span></strong>番からです。<br />
お客様全員は、300名で、その内、アマイーを注文したお客様は40名です。<br />
<p>従って、確率は<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/345f821e09a8ab4f15cf22e71978b408.png" alt="300分の40" width="70" height="61" class="alignnone  wp-image-3574" /></p>
</li>
 	<li>続いて、<strong><span style="font-size: 24px;">２</span></strong>番です。<br />
アマイーを注文したお客様は40名で、その中でニガイコーヒーを注文したお客様は20名です。<br />
<p>従って、確率は<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/a1ad1adc784639213df36cbd9c7a2157.png" alt="40分の20" width="60" height="59" class="alignnone  wp-image-3570" /></p>
</li>
</ul>
<p>この<strong><span style="font-size: 24px;">1</span></strong>番と、<strong><span style="font-size: 24px;">2</span></strong>番を使って、同時確率（ニガイコーヒーとアマイーの両方を注文する確率）を求めると・・・ もう、お分かりですよね。</p>
<br />
<div style="padding: 20px; border-radius: 10px; border: 2px solid darkblue; margin-top: 30px; margin-bottom: 30px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/5ed894a411eb700f33966394549c703a.png" alt="約分2" width="352" height="170" class="alignnone size-full wp-image-3572" srcset="https://kenyu.red/wp-content/uploads/2015/06/5ed894a411eb700f33966394549c703a.png 352w, https://kenyu.red/wp-content/uploads/2015/06/5ed894a411eb700f33966394549c703a-300x145.png 300w" sizes="(max-width: 352px) 100vw, 352px" /><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/138148-300x300.png" alt="138148" width="133" height="133" class="alignnone  wp-image-3072" srcset="https://kenyu.red/wp-content/uploads/2015/06/138148-300x300.png 300w, https://kenyu.red/wp-content/uploads/2015/06/138148-150x150.png 150w, https://kenyu.red/wp-content/uploads/2015/06/138148.png 425w" sizes="(max-width: 133px) 100vw, 133px" /></div>
<p> この値は、さっきのB と A の同時確率の答えと同じですよね。</p>
<br />
<h3 style="border-left: 10px solid darkgreen; padding: 4px;"><span id="toc8">証明最終段階</span></h3>
<p>さて、BとAの同時確率 ＝ AとBの同時確率 という事がはっきりとしました。</p>
<p>改めて、この２つの、同時確率の条件付き確率から求める式を見てみましょう。</p>
<br />
<ul>
 	<li>BとAの同時確率 ＝ B の後でAが起きる確率  ×  Bが起きる確率</li>
 	<li>AとBの同時確率 ＝ A の後でB が起きる確率  ×  Aが起きる確率<br />
<img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/150988-289x300.png" alt="150988" width="127" height="131" class="  wp-image-3069 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/150988-289x300.png 289w, https://kenyu.red/wp-content/uploads/2015/06/150988.png 369w" sizes="(max-width: 127px) 100vw, 127px" /></li>
</ul>
<p>左辺同士がイコールなので、右辺同士もイコールですよね。<br />
これを、次の様に一般式で書きます。</p>
<br />
<div style="padding: 20px; border-radius: 10px; border: 2px solid darkblue; margin-top: 30px; margin-bottom: 30px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/3d7e4c5fe0ef30c0d6f1311b77a9c81c.png" alt="ベイズの定理最終" width="541" height="377" class="alignnone size-full wp-image-3588" srcset="https://kenyu.red/wp-content/uploads/2015/06/3d7e4c5fe0ef30c0d6f1311b77a9c81c.png 541w, https://kenyu.red/wp-content/uploads/2015/06/3d7e4c5fe0ef30c0d6f1311b77a9c81c-300x209.png 300w" sizes="(max-width: 541px) 100vw, 541px" />
<p></p>
<br />
<ul>
 	<li>P(A) : A が起きる確率</li>
 	<li>P(B) : B が起きる確率（<strong>事前確率</strong>と呼ぶ）</li>
 	<li>P(A|B) : B の後でAが起きる確率（条件付き確率・<strong>尤度</strong>と呼ぶ）</li>
 	<li>P(B|A) : A の後でB が起きる確率（条件付き確率・<strong>事後確率</strong>と呼ぶ）</li>
</ul>
</div>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/133951-300x284.png" alt="133951" width="113" height="107" class="  wp-image-3283 alignleft" srcset="https://kenyu.red/wp-content/uploads/2015/06/133951-300x284.png 300w, https://kenyu.red/wp-content/uploads/2015/06/133951-1024x968.png 1024w, https://kenyu.red/wp-content/uploads/2015/06/133951.png 1131w" sizes="(max-width: 113px) 100vw, 113px" />
お疲れ様でした、ベイズの定理の完成です！</p>
<p>ベイズの定理といっても、確率の乗法定理を組み合わせて、変形させただけなんです。</p>
<p>乗法定理の、同時確率が条件付き確率をかけて求めるというところが、分かっていれば、何ということはないですよね。</p>
<br />
<h2 style="border-bottom: 1px solid #426579; border-left: 10px solid #426579; padding: 7px;"><span id="toc9">まとめ</span></h2>
<div style="padding: 20px 20px 0px; border-radius: 10px; border: 2px solid darkblue; margin-top: 30px; margin-bottom: 30px; background-color: palegreen;">
<div style="padding: 20px; border-radius: 10px; border: 2px solid darkblue; text-align: center; margin-top: 30px; margin-bottom: 30px; background-color: darkgreen;"><strong><span style="color: #ffffff; font-size: 24px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/Check-300x141.png" alt="Check" width="98" height="46" class="alignnone  wp-image-3155" srcset="https://kenyu.red/wp-content/uploads/2015/06/Check-300x141.png 300w, https://kenyu.red/wp-content/uploads/2015/06/Check.png 577w" sizes="(max-width: 98px) 100vw, 98px" />ベイズの定理の証明</span></strong></div>
<p><strong><span style="color: #ffffff; font-size: 20px; background-color: #339966;">    同時確率と条件付き確率   </span></strong></p>
<p>BとAの同時確率 ＝<br />
B の後で A が起きる確率（条件付き確率） ×  Bが起きる確率</p>
<p>BとAの同時確率 ＝ AとBの同時確率</p>
<p>つまり・・・<br />
B の後で A が起きる確率（条件付き確率） × Bが起きる確率は、<br />
A の後で B が起きる確率（条件付き確率）× Aが起きる確率と同じ。</p>
<p>これを一般式にして、両辺をP(A)で割る</p>
<br />
<div style="padding: 0px; border: solid 5px gold; border-radius: 10px; background-color: white; margin-top: 30px; margin-bottom: 30px;"><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/3d7e4c5fe0ef30c0d6f1311b77a9c81c.png" alt="ベイズの定理最終" width="541" height="377" class="alignnone size-full wp-image-3588" srcset="https://kenyu.red/wp-content/uploads/2015/06/3d7e4c5fe0ef30c0d6f1311b77a9c81c.png 541w, https://kenyu.red/wp-content/uploads/2015/06/3d7e4c5fe0ef30c0d6f1311b77a9c81c-300x209.png 300w" sizes="(max-width: 541px) 100vw, 541px" /></div>
</div>
<h2 style="border-bottom: 1px solid #426579; border-left: 10px solid #426579; padding: 7px;"><span id="toc10">あとがき</span></h2>
<p><img loading="lazy" decoding="async" src="https://kenyu.red/wp-content/uploads/2015/06/084160-225x300.png" alt="084160" width="114" height="152" class="  wp-image-3055 alignright" srcset="https://kenyu.red/wp-content/uploads/2015/06/084160-225x300.png 225w, https://kenyu.red/wp-content/uploads/2015/06/084160-767x1024.png 767w, https://kenyu.red/wp-content/uploads/2015/06/084160.png 822w" sizes="(max-width: 114px) 100vw, 114px" />ベイズ確率って、最近のトレンドの様に使われているので、少なくとも20世紀後半に誕生したのかと思っていました。</p>
<p>このベイズさんって、1702年生まれなんで驚きました。</p>
<p>実際に、ベイズ確率が広まったのは、その後、ラプラスによって18世紀後半から19世紀にかけてのようですね。</p>
<p>時代が、こう目まぐるしく変化し、次から次へと新製品が出てきたり、新しいシステムが出来たりすると、故障率や、何か経営戦略的な数値を出すのも、従来の頻度に頼る確率・統計では対応できないですよね。</p>
<p>このベイズの定理を元とした、ベイズ推定やベイズ統計などが、本当に今はメジャーですよね。</p>
<p>ベイズの定理については、他にも投稿があるので、よろしければそちらもご覧下さい。<br />
⇒<a href="https://kenyu.red/archives/2754.html">ベイズ推定！例題でモンティ・ホール問題を解いてみた<span class="fa fa-sign-out internal-icon anchor-icon"></span></a></p></p>The post <a href="https://kenyu.red/archives/3434.html">ベイズの定理の証明！？意外と簡単な確率の計算でした！</a> first appeared on <a href="https://kenyu.red">KENブログ　風のように、しなやかに</a>.]]></content:encoded>
					
					<wfw:commentRss>https://kenyu.red/archives/3434.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="https://kenyu.red/archives/3434.html" />
	</item>
	</channel>
</rss>
