<?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/"
	>

<channel>
	<title>Dutor &#187; 概率论</title>
	<atom:link href="http://www.dutor.net/index.php/tag/probability/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dutor.net</link>
	<description>熟读而精思，循序而渐进，厚积而薄发。</description>
	<lastBuildDate>Tue, 17 Jan 2012 14:44:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dump the Holy Girl(s)</title>
		<link>http://www.dutor.net/index.php/2010/05/dump-the-holy-girls/</link>
		<comments>http://www.dutor.net/index.php/2010/05/dump-the-holy-girls/#comments</comments>
		<pubDate>Mon, 03 May 2010 22:51:20 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[尚未分类]]></category>
		<category><![CDATA[AVL]]></category>
		<category><![CDATA[动态链接]]></category>
		<category><![CDATA[概率论]]></category>
		<category><![CDATA[虚拟内存]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=2228</guid>
		<description><![CDATA[<p></p>
<pre lang="bash" line="1">
$ ssh FenglinHou@Dalian
~% cd Wdir/
~/Wdir% cat dump.cpp
#inlcude <everything>
int
main()
{
    std::set<std::Girl> ().clear();
    std::ifstream lifein("~/*");
    std::ofstream lifeout("~/*");
    std::copy(std::istream_iterator<std::stuff>(lifein), 
              std::istream_iterator<std::stuff>(), 
              std::ostream_iterator<std::stuff>(lifeout, "\newday"));
    return (0);
}
~/Wdir% cat Makefile
dump:dump.cpp
    g++ -odump dump.cpp
~/Wdir% make
~/Wdir% ./dump

</pre>]]></description>
			<content:encoded><![CDATA[</p>

<div class="wp_codebox"><table><tr id="p22281"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code" id="p2228code1"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> FenglinHou<span style="color: #000000; font-weight: bold;">@</span>Dalian
~<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">cd</span> Wdir<span style="color: #000000; font-weight: bold;">/</span>
~<span style="color: #000000; font-weight: bold;">/</span>Wdir<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> dump.cpp
<span style="color: #666666; font-style: italic;">#inlcude &lt;everything&gt;</span>
int
main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    std::<span style="color: #000000; font-weight: bold;">set</span><span style="color: #000000; font-weight: bold;">&lt;</span>std::Girl<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.clear<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    std::ifstream lifein<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;~/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    std::ofstream lifeout<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;~/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    std::copy<span style="color: #7a0874; font-weight: bold;">&#40;</span>std::istream_iterator<span style="color: #000000; font-weight: bold;">&lt;</span>std::stuff<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>lifein<span style="color: #7a0874; font-weight: bold;">&#41;</span>, 
              std::istream_iterator<span style="color: #000000; font-weight: bold;">&lt;</span>std::stuff<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, 
              std::ostream_iterator<span style="color: #000000; font-weight: bold;">&lt;</span>std::stuff<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>lifeout, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>ewday&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
~<span style="color: #000000; font-weight: bold;">/</span>Wdir<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> Makefile
dump:dump.cpp
    <span style="color: #c20cb9; font-weight: bold;">g++</span> <span style="color: #660033;">-odump</span> dump.cpp
~<span style="color: #000000; font-weight: bold;">/</span>Wdir<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
~<span style="color: #000000; font-weight: bold;">/</span>Wdir<span style="color: #000000; font-weight: bold;">%</span> .<span style="color: #000000; font-weight: bold;">/</span>dump</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2010/05/dump-the-holy-girls/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>若干概率问题</title>
		<link>http://www.dutor.net/index.php/2009/11/probality-ques/</link>
		<comments>http://www.dutor.net/index.php/2009/11/probality-ques/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 06:22:05 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[数理空间]]></category>
		<category><![CDATA[概率论]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=1683</guid>
		<description><![CDATA[<ul>
	<li>　　分别抛两次硬币，无非三种情况：两正、两反、一正一反。所以，一正一反的概率是三分之一。
　　问题出在哪里？</li>
	<li>　　有10个小球，其中6黑4红。现任意取出3个，问全部是红球的概率。是$$\Large \frac{C_4^1 C_3^1 C_2^1}{C_{10}^3}$$还是$$\Large \frac{C_4^3}{C_{10}^3}$$？
　　答案是后者，因为三个球是一次性取出的，而$$\Large C_4^1 C_3^1 C_2^1$$是一个一个逐次取出的，在取球的过程中就将球给排序了。
　　那么，再看另外一个问法，同样是一次性取出三个球，问一黑两红的概率。是$$\Large \frac{C_6^1 C_4^2 }{C_{10}^3}$$吗？是的，之所以能够先取一个黑球再取两个红球(或者相反)，是因为取黑球和取红球之间是独立的。
　　再看，如果我要问，至少有一个红球的概率呢？显然应该反求没有红球的概率，为$$\Large 1-\frac{C_6^3 }{C_{10}^3}=\frac{100}{120}$$。我是不是还可以这样考虑：先取一个红球，然后再随便取两个球，无论什么颜色，这样概率就是$$\Large \frac{C_4^1 C_9^2 }{C_{10}^3}$$有问题吗？当然！$$\Large \frac{C_4^1 C_9^2 }{C_{10}^3}=\frac {144}{120}$$！可是为什么呢？因为后面<strong>随便</strong>取的2个球可能包含红球，这样的话，就犯了第二个问题的错误了。</li>
	<li>　　再来一个复杂一点的。6双不同的手套，任取4只。问，只有一双配套的概率。
　　思路是6双中取一双，然后再设法取两只来自不同的手套。一种方法是从剩下的5双重任取2双，再从中分别各取一只，结果就是$$\Large \frac{C_6^1 C_5^2 C_2^1 C_2^1}{C_{12}{4}}$$。另一种方法是从剩下的5双10只中任取1只，然后将与该只配套的手套扔掉，接着再从剩下的8只中再取1只，结果是$$\Large \frac{C_6^1 C_{10}^1 C_8^1}{C_{12}{4}}$$。呃，又不相等了……原因只在于这里的$$C_{10}^1 C_8^1$$又给两双手套排序了，而取手套本身($$C_{12}^4$$)是无序的。
	<li>　　不可能事件发生的概率为0，但概率为0的不一定是不可能时间；同样必然事件发生的概率是1，但概率为1的却不一定是必然事件。这里的<strong>不一定</strong>是针对连续型随机变量而言的。</li>

</ul>
]]></description>
			<content:encoded><![CDATA[<ul>
<li>　　分别抛两次硬币，无非三种情况：两正、两反、一正一反。所以，一正一反的概率是三分之一。<br />
　　问题出在哪里？</li>
<li>　　有10个小球，其中6黑4红。现任意取出3个，问全部是红球的概率。是<img src="http://www.dutor.net/wp-content/cache/7be92234a9adcf75ffb706ca75bd7be0.png" align="absmiddle" class="tex" alt="\Large \frac{C_4^1 C_3^1 C_2^1}{C_{10}^3}" />还是<img src="http://www.dutor.net/wp-content/cache/6a9896ecf431b6c883b8c3d6a7f5392e.png" align="absmiddle" class="tex" alt="\Large \frac{C_4^3}{C_{10}^3}" />？<br />
　　答案是后者，因为三个球是一次性取出的，而<img src="http://www.dutor.net/wp-content/cache/520e4430f7b874d152308fb895985b74.png" align="absmiddle" class="tex" alt="\Large C_4^1 C_3^1 C_2^1" />是一个一个逐次取出的，在取球的过程中就将球给排序了。<br />
　　那么，再看另外一个问法，同样是一次性取出三个球，问一黑两红的概率。是<img src="http://www.dutor.net/wp-content/cache/d8c6cf39e97d83b9f830937e0e486a14.png" align="absmiddle" class="tex" alt="\Large \frac{C_6^1 C_4^2 }{C_{10}^3}" />吗？是的，之所以能够先取一个黑球再取两个红球(或者相反)，是因为取黑球和取红球之间是独立的。<br />
　　再看，如果我要问，至少有一个红球的概率呢？显然应该反求没有红球的概率，为<img src="http://www.dutor.net/wp-content/cache/7bde889e3f3c783dcc68620bc9d2802b.png" align="absmiddle" class="tex" alt="\Large 1-\frac{C_6^3 }{C_{10}^3}=\frac{100}{120}" />。我是不是还可以这样考虑：先取一个红球，然后再随便取两个球，无论什么颜色，这样概率就是<img src="http://www.dutor.net/wp-content/cache/e33201deb1595a40e9903187c0cec061.png" align="absmiddle" class="tex" alt="\Large \frac{C_4^1 C_9^2 }{C_{10}^3}" />有问题吗？当然！<img src="http://www.dutor.net/wp-content/cache/62ae24ef734665b41fe35988592c2c72.png" align="absmiddle" class="tex" alt="\Large \frac{C_4^1 C_9^2 }{C_{10}^3}=\frac {144}{120}" />！可是为什么呢？因为后面<strong>随便</strong>取的2个球可能包含红球，这样的话，就犯了第二个问题的错误了。</li>
<li>　　再来一个复杂一点的。6双不同的手套，任取4只。问，只有一双配套的概率。<br />
　　思路是6双中取一双，然后再设法取两只来自不同的手套。一种方法是从剩下的5双重任取2双，再从中分别各取一只，结果就是<img src="http://www.dutor.net/wp-content/cache/a9e11ad44163cb8464914b014e50df54.png" align="absmiddle" class="tex" alt="\Large \frac{C_6^1 C_5^2 C_2^1 C_2^1}{C_{12}{4}}" />。另一种方法是从剩下的5双10只中任取1只，然后将与该只配套的手套扔掉，接着再从剩下的8只中再取1只，结果是<img src="http://www.dutor.net/wp-content/cache/0f9ec2e7ae886adc9bed9fbae6248cef.png" align="absmiddle" class="tex" alt="\Large \frac{C_6^1 C_{10}^1 C_8^1}{C_{12}{4}}" />。呃，又不相等了……原因只在于这里的<img src="http://www.dutor.net/wp-content/cache/416ce3d163cb6b8246d6f946c248641b.png" align="absmiddle" class="tex" alt="C_{10}^1 C_8^1" />又给两双手套排序了，而取手套本身(<img src="http://www.dutor.net/wp-content/cache/4c49e3b96417fffcf6682c2121ab7241.png" align="absmiddle" class="tex" alt="C_{12}^4" />)是无序的。</p>
<li>　　从52张扑克牌中任取5张，求抓到一对的概率。<img src="http://www.dutor.net/wp-content/cache/95c65109bc4d09d01c515556ca99e7fd.png" align="absmiddle" class="tex" alt="\Large \frac{C_{13}^1 C_4^2 C_{12}^3{(C_4^1)}^3}{C_{52}^5}=0.423" />，想想这是怎么得到的。
<li>　　不可能事件发生的概率为0，但概率为0的不一定是不可能时间；同样必然事件发生的概率是1，但概率为1的却不一定是必然事件。这里的<strong>不一定</strong>是针对连续型随机变量而言的。</li>
<li>　　独立和互斥的关系。两个随机事件A和B，在P(A)>0且P(B)>0的情况下，A、B独立则A、B不互斥， A、B互斥则A、B不独立。P(A) = 0或者P(B) = 0时，两者等价。</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/11/probality-ques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个条件概率问题</title>
		<link>http://www.dutor.net/index.php/2009/09/condition-probability/</link>
		<comments>http://www.dutor.net/index.php/2009/09/condition-probability/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 03:40:26 +0000</pubDate>
		<dc:creator>dutor</dc:creator>
				<category><![CDATA[数理空间]]></category>
		<category><![CDATA[数学]]></category>
		<category><![CDATA[概率论]]></category>

		<guid isPermaLink="false">http://www.dutor.net/?p=1296</guid>
		<description><![CDATA[<strong>问题1</strong> <pre>小两口有俩娃儿，其中有一个生于星期二的男孩儿。问另一个是男孩儿的概率是多少？</pre>
　　如果上面的问题略显复杂的话，那么先看下面的这个问题，
<strong>问题2</strong> <pre>小两口有俩娃儿，其中第一个是的男孩。问第二个是男孩儿的概率是多少？</pre>
　　对于问题2，由于两个孩子的性别和生日(以周记)是独立的，所以第二个是男孩的概率就是1/2。从古典概型的角度来理解，总的样本空间可以表述为Ω ={男，男}，{男，女}，{女，男}，{女，女}，第一个是男孩为事件A={男，男}，{男，女}，第二个是男孩为事件B={男，男}。于是，在第一个为男孩的前提下第二个是男孩的概率为1/2，即P(AB)/P(B)＝(1/4)/(1/2)＝1/2。我们把问题再换一个问法，]]></description>
			<content:encoded><![CDATA[<p><strong>问题1</strong>
<pre>小两口有俩娃儿，其中有一个生于星期二的男孩儿。问另一个是男孩儿的概率是多少？</pre>
<p>　　如果上面的问题略显复杂的话，那么先看下面的这个问题，<br />
<strong>问题2</strong>
<pre>小两口有俩娃儿，其中第一个是的男孩。问第二个是男孩儿的概率是多少？</pre>
<p>　　对于问题2，由于两个孩子的性别和生日(以周记)是独立的，所以第二个是男孩的概率就是1/2。从古典概型的角度来理解，总的样本空间可以表述为Ω ={男，男}，{男，女}，{女，男}，{女，女}，第一个是男孩为事件A={男，男}，{男，女}，第二个是男孩为事件B={男，男}。于是，在第一个为男孩的前提下第二个是男孩的概率为1/2，即P(AB)/P(B)＝(1/4)/(1/2)＝1/2。我们把问题再换一个问法，<br />
<strong>问题3</strong>
<pre>小两口有俩娃儿，其中有一个是男孩儿。问另一个是男孩儿的概率是多少？</pre>
<p>　　仍然从古典概型的角度来考虑，总的样本空间可以表述为Ω ={男，男}，{男，女}，{女，男}，{女，女}，<em>其中一个</em>是男孩为事件A={男，男}，{男，女}，{女，男}，第二个是男孩为事件B={男，男}。于是，在已知<em>有一个</em>男孩的前提下，另外一个是男孩的概率就是1/3。这从感性上也不难理解，自然情况下性别比是1:1(也有人说是49：51的)，你已经有一个男的了，还想再讨一个男孩儿，当然概率要小于1/2了。</p>
<p>　　有问题3的铺垫，这时候问题1我想已经没什么问题了吧，两外一个是男孩的概率就是13/27 = (7 + 6)/(7 + 7 + 7 + 6)。</p>
<p><strong>补充</strong><br />
　　条件概率就是事件 A 在另外一个事件 B 已经发生条件下的发生概率，表示为 P(A|B)＝P(AB)/P(B)。详细的解释参照<a href="http://zh.wikipedia.org/wiki/%E6%9D%A1%E4%BB%B6%E6%A6%82%E7%8E%87" target="_blank">这里</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dutor.net/index.php/2009/09/condition-probability/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

