<?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>Alexander Kruel &#187; Alexander Kruel &#187; Mathematics</title>
	<atom:link href="http://kruel.co/category/mathematics-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://kruel.co</link>
	<description>Thoughts and news on transhumanism, vegetarianism, science fiction, science, philosophy, math, programming, language, consciousness and the nature of reality.</description>
	<lastBuildDate>Mon, 25 Aug 2014 10:43:11 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Miscellaneous Items 20140605</title>
		<link>http://kruel.co/2014/06/05/miscellaneous-items-20140605/</link>
		<comments>http://kruel.co/2014/06/05/miscellaneous-items-20140605/#comments</comments>
		<pubDate>Thu, 05 Jun 2014 15:03:35 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=5368</guid>
		<description><![CDATA[Why is the material implication of classical logic (also known as material conditional or material consequence), p -&#62; q, defined to be false only when its antecedent (p) is true and the consequent (q) is false? Here is an informal way to think about it. You could view logic as metamathematics, a language designed to talk [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Why is the <strong>material implication of classical logic</strong> (also known as material conditional or material consequence), p -&gt; q, defined to be false only when its antecedent (p) is true and the consequent (q) is false? Here is an informal way to think about it.</p>
<p>You could view logic as metamathematics, a language designed to talk about mathematics. Logic as the &#8220;hygiene&#8221;, the grammar and syntax of mathematics.</p>
<p>In the language of classical logic every proposition is either true or not true, and no proposition can be both true and not true. Now what if we want to express the natural language construction &#8220;If&#8230;then&#8230;&#8221; in this language? Well, there are exactly sixteen possible truth functions of two inputs p and q (since there are 2^2 inputs and (2^2)^2 ways to map them to outputs). And the candidate that best captures the connotations of what we mean by &#8220;If&#8230;then&#8230;&#8221; is the definition of material implication. Here is why.</p>
<p>By stating that p -&gt; q is true we want to indicate that the truth of q can be inferred from the truth p, but that nothing in particular can be inferred from the falsity of p. And this is exactly the meaning captured by the material conditional:</p>
<table style="height: 102px;" border="1" width="133" align="center">
<tbody>
<tr>
<th style="text-align: center;">p</th>
<th>q</th>
<th>p-&gt;q</th>
</tr>
<tr>
<th>T</th>
<th>T</th>
<td>T</td>
</tr>
<tr>
<th>T</th>
<th>F</th>
<td>F</td>
</tr>
<tr>
<th>F</th>
<th>T</th>
<td>T</td>
</tr>
<tr>
<th>F</th>
<th>F</th>
<td>T</td>
</tr>
</tbody>
</table>
<p>First, when &#8220;If p, q&#8221; is true, and we also know that p is true, then we want to be able to infer q. In other words, if we claim that if p is true then q is true, then if p is indeed true, q should be true as well. This basic rule of inference has a name, it is called <a href="http://en.wikipedia.org/wiki/Modus_ponens">modus ponens</a>.</p>
<p>Second, if we claim &#8220;If p, q&#8221;, then if p is false, we did not say anything in particular about q. If p is false, q can either be true or false, our claim &#8220;If p, q&#8221; is still true.</p>
<p>But notice that it is not possible to capture all notions of what we colloquially mean by &#8220;If&#8230;then&#8230;&#8221; statements as a two-valued truth function.</p>
<p>It is for example possible to make meaningless statements such as &#8220;If grass is red then the moon if made of cheese.&#8221; This is however unproblematic under the assumption that logic is an idealized language, which is adequate for mathematical reasoning. Since we are mainly interested in simplicity and clarity. Under this assumption, such nonsense implications are analogous to grammatically correct but meaningless sentences that can be formed in natural languages, such as &#8220;<a href="http://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_furiously">Colorless green ideas sleep furiously</a>&#8220;.</p>
<p>To demonstrate its adequacy for mathematics, here is a mathematical example:</p>
<p>If n &gt; 2 then n^2 &gt; 4.</p>
<p>We claim that if n is greater than 2 then its square must be greater than 4. For n = 3, this is obviously true, as we claimed. But what about n smaller than 2? We didn&#8217;t say anything in particular about n smaller than 2. Its square could be larger than 4 or not. And indeed, n = 1 and n = -3 yield a false, respectively true, consequent. Yet the implication is true in both cases.</p>
<p>Intuitively more problematic are statements such as (p and not(p)) -&gt; q, p and its negation imply q. Think about it this way. The previous implication is a tautology, it is always true. And you believe true statements. This however does not mean that you must believe that arbitrary q is true too (as long as you <a href="http://kruel.co/2013/08/25/intuitive-reasons-to-avoid-inconsistencies-in-mathematics/">stay consistent</a>), since in case of the falsity of the antecedent you are not making any particular claim about the truth of the consequent (q). And since the statement that p is true and false, p AND not(p), is always false &#8212; remember the principle of exclusive disjunction for contradictories, (P ∨ ¬P) ∧ ¬(P ∧ ¬P), requires that every proposition is either true or not true, and that no proposition can be both true and not true &#8212; q can be false without invalidating the implication.</p>
<p>Another way to look at p -&gt; q is by interpreting it as &#8220;p is a subset of q&#8221;. Then if it is true that x <em>is an element of</em> p, then it must be true that it is also an element of q (since q contains p). However, if x is not an element p, then it might still turn out to be an element of q, since q can be larger than p.</p>
<p style="text-align: center;">————–</p>
<p style="text-align: left;">Here is a term I just learnt: <strong><a href="http://en.wikipedia.org/wiki/Extraneous_and_missing_solutions">Extraneous solutions</a></strong>.</p>
<p style="text-align: left;">Take for example the equation</p>
<p style="text-align: left;">A = B.</p>
<p style="text-align: left;">If you were to square both sides you would get</p>
<p style="text-align: left;">A^2 = B^2</p>
<p style="text-align: left;">or</p>
<p style="text-align: left;">A^2 &#8211; B^2 = 0.</p>
<p style="text-align: left;">Which is equal to</p>
<p style="text-align: left;">(A &#8211; B)(A + B) = 0 (by the <a href="http://en.wikipedia.org/wiki/Difference_of_two_squares">difference of two squares</a>).</p>
<p style="text-align: left;">Now the roots of this equation are the roots of the equations A = B and A = -B. This means that we generated an additional solution by squaring the original equation.</p>
<p style="text-align: left;">The reason for this is that squaring is <em>not</em> an injective fuction (injective means one-to-one, every element is mapped to one and only one unique element), it is not invertible. The function y = x^2 does not pass the horizontal line test. In other words, squaring preserves equality, if A = B then A^2 = B^2, but does not preserve inequality. It is not true that if A != B then A^2 != B^2, since both -1 and 1 are mapped to 1 when squared. Which means that both 1^2 = 1^2 and (-1)^2 = (1)^2 are solutions to the squared equations, while only one of them makes each pre-squared equation true.</p>
<p style="text-align: center;">————–</p>
<div id="attachment_5369" style="width: 510px" class="wp-caption aligncenter"><img class="size-large wp-image-5369" src="http://kruel.co/wp-content/uploads/2014/06/1280px-Operation_Crossroads_Baker_in_color-640x336.jpg" alt="Operation Crossroads" width="500" height="262" /><p class="wp-caption-text">Operation Crossroads</p></div>
<p><a href="http://en.wikipedia.org/wiki/Operation_Crossroads"><b>Operation Crossroads</b></a></p>
<p><b>Video:</b> <a class="ot-anchor aaTEdf" href="http://youtu.be/Y53vDnNPiA4" target="_blank" rel="nofollow">http://youtu.be/Y53vDnNPiA4</a></p>
<p style="text-align: center;">————–</p>
<p><a href="http://news.cornell.edu/stories/2014/06/milky-way-may-bear-100-million-life-giving-planets">Milky Way may bear 100 million life-giving planets</a></p>
<p><a href="http://www.policymic.com/articles/90321/obama-just-did-what-no-other-president-before-him-has-done">New Obama doctrine on climate change will achieve CO2 emission reductions from the power sector of approximately 30% from CO2 emission levels in 2005.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2014/06/05/miscellaneous-items-20140605/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perpendicular distance between two parallel lines</title>
		<link>http://kruel.co/2013/08/27/perpendicular-distance-between-two-parallel-lines/</link>
		<comments>http://kruel.co/2013/08/27/perpendicular-distance-between-two-parallel-lines/#comments</comments>
		<pubDate>Tue, 27 Aug 2013 13:47:49 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[geometry]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=5043</guid>
		<description><![CDATA[(1) The distance between two parallel lines is the distance between the points of intersection of a third line that is perpendicular to both these lines. (2) The slopes of two perpendicular lines are negative reciprocals of one another. The two blueish triangles are copies of each other, one of which has been rotated 90 degrees about [&#8230;]]]></description>
				<content:encoded><![CDATA[<div style="width: 510px" class="wp-caption aligncenter"><a href="/img/parallel-perpendicular-lines-large.png"><img alt="" src="/img/parallel-perpendicular-lines-small.png" width="500" height="329" /></a><p class="wp-caption-text">Parallel and Perpendicular Lines</p></div>
<p><strong>(1)</strong> The distance between two <a href="http://en.wikipedia.org/wiki/Parallel_(geometry)">parallel</a> lines is the distance between the points of intersection of a third <a href="http://en.wikipedia.org/wiki/Line_(geometry)">line</a> that is <a href="http://en.wikipedia.org/wiki/Perpendicular">perpendicular</a> to both these lines.</p>
<p><strong>(2)</strong> The <a href="http://en.wikipedia.org/wiki/Slope">slopes</a> of two perpendicular lines are negative reciprocals of one another.</p>
<p>The two blueish triangles are copies of each other, one of which has been <a href="http://en.wikipedia.org/wiki/Angular_displacement">rotated</a> 90 degrees about point A (the origin). This means that the line segment c<sub>1</sub> is perpendicular to line segment c<sub>2</sub>.</p>
<p>Since line segment c<sub>2</sub> is parallel to line segment e, the perpendicular distance between both line segments is the distance between the two points where the line segment c<sub>1</sub> intersects c<sub>2</sub> and e.</p>
<p>For non-visual proofs of 1 and 2, see below.</p>
<p><strong>The givens:</strong></p>
<p><span style="line-height: 1.4;">Line segment c</span><sub>1</sub><span style="line-height: 1.4;"> is </span><span style="line-height: 1.4;">perpendicular</span><span style="line-height: 1.4;"> to line segment c</span><sub>2</sub><span style="line-height: 1.4;">.</span></p>
<p>Line segment c<sub>2</sub> is parallel to line segment e.</p>
<p>Coordinates of point A = (0, 0).</p>
<p><span style="line-height: 1.4;">Length of line segment b = b.</span></p>
<p>Length of line segment a = a.</p>
<p>Length of line segment c = c<sub>1</sub> = c<sub>2 </sub> = sqrt(b^2 + a^2) (by the <a href="http://en.wikipedia.org/wiki/Pythagorean_theorem">Pythagorean theorem</a>).</p>
<p>Length of line segment e = c.</p>
<p>The slope of line c<sub>1</sub> = m<sub>1</sub> = a/b.</p>
<p>The slope of line c<sub>2</sub> = m<sub>2</sub> = -b/a.</p>
<p>Coordinates of point B<sub>1</sub> = (b, a) = (b, m<sub>1</sub>b).</p>
<p>Coordinates of point B<sub>2</sub> = (-a, b) = (-a, m<sub>2*</sub>-a).</p>
<p>Length of line segment d = sqrt(c<sub>1</sub>^2 + c<sub>2</sub>^2) = sqrt(2c^2) = sqrt(sqrt(2)*sqrt(2)*sqrt(c^2)*sqrt(c^2)) = sqrt(sqrt(2)*sqrt(c^2)*sqrt(2)*sqrt(c^2)) = sqrt(2)sqrt(c^2) = sqrt(2)*c = sqrt(2)*sqrt(b^2 + a^2) (by the Pythagorean theorem). Respectively, d = sqrt((b-(-a))^2 +  (a-b)^2) = sqrt((b &#8211; (-a))^2 + (m<sub>1</sub>b &#8211; m<sub>2</sub>*-a)^2).</p>
<p><strong>Proof that the slopes of two perpendicular lines are negative reciprocals of one another:</strong></p>
<p>d^2 = (sqrt(2)*sqrt(b^2 + a^2))^2 = sqrt(2)*sqrt(2)*sqrt(b^2 + a^2)*sqrt(b^2 + a^2) = 2(b^2+a^2) = (b^2 + (m<sub>1</sub>b)^2)+(-a^2 + (m<sub>2</sub>*-a)^2) = (b^2 + (m<sub>1</sub>b)^2) + (a^2 + (m<sub>2</sub>a)^2)</p>
<p>d^2 = (b &#8211; (-a))^2 + (m<sub>1</sub>b &#8211; m<sub>2</sub>*-a)^2</p>
<p><span style="line-height: 1.4;">(b + a)^2 + (m</span><sub>1</sub><span style="line-height: 1.4;">b &#8211; m</span><sub>2</sub><span style="line-height: 1.4;">*-a)^2 = b^2 + (m</span><sub>1</sub><span style="line-height: 1.4;">b)^2 + a^2 + (m</span><sub>2</sub><span style="line-height: 1.4;">a)^2</span></p>
<p>b^2 + 2ab + a^2 + (m<sub>1</sub>b)^2 + 2m<sub>1</sub>m<sub>2</sub>ab + (m<sub>2</sub>a)^2 = b^2 + (m<sub>1</sub>b)^2 + a^2 + (m<sub>2</sub>a)^2</p>
<p>2ab + 2m<sub>1</sub>m<sub>2</sub>ab = 0</p>
<p>2m<sub>1</sub>m<sub>2</sub>ab = -2ab</p>
<p>m<sub>1</sub>m<sub>2</sub> = -1</p>
<p>m<sub>1</sub>m<sub>2</sub> = (a/b)(-b/a) = -1</p>
<p><strong>Proof that the distance between two parallel lines is the distance between the points of intersection of a third line that is perpendicular to both these lines:</strong></p>
<p>Consider any two parallel lines,</p>
<p>f(x) = y<sub>1</sub> = mx + b<sub>1</sub></p>
<p>g(x) = y<sub>2</sub> = mx + b<sub>2</sub>,</p>
<p>and a third line that is perpendicular to both these lines,</p>
<p>h(x) = y<sub>3</sub> = (-1/m)x = -x/m.</p>
<p>Then the intersection point of y<sub>1</sub> and y<sub>3</sub> is the solution to the <a href="http://en.wikipedia.org/wiki/System_of_linear_equations">system of linear equations</a>,</p>
<p>f(x) = h(x)</p>
<p>mx + b<sub>1 </sub>= -x/m</p>
<p>(m^2)x + mb<sub>1</sub> = -x</p>
<p>(m^2)x + x = -mb<sub>1</sub></p>
<p>((m^2) + 1)x = -mb<sub>1</sub></p>
<p>x = -mb<sub>1</sub> / ((m^2) + 1)</p>
<p>h(-mb<sub>1</sub> / ((m^2) + 1)) =  y<sub>1</sub> = y<sub>3</sub> = (-1/m)(-mb<sub>1</sub> / ((m^2) + 1)) = b<sub>1</sub> / ((m^2) + 1)</p>
<p>Intersection point 1: (x<sub>1</sub>, y<sub>1</sub>) = (-mb<sub>1</sub> / ((m^2) + 1), b<sub>1</sub> / ((m^2) + 1))</p>
<p>By the same logic, the intersection point of y<sub>2</sub> and y<sub>3</sub> is,</p>
<p>g(x) = h(x)</p>
<p>&#8230;</p>
<p>Intersection point 2: (x<sub>2</sub>, y<sub>2</sub>) = (-mb<sub>2</sub> / ((m^2) + 1), b<sub>2</sub> / ((m^2) + 1))</p>
<p>By the Pythagorean theorem, the distance between intersection point 1 and 2 is,</p>
<p>d = sqrt((x<sub>1 </sub>- x<sub>2</sub>)^2 + (y<sub>1</sub> &#8211; y<sub>2</sub>)^2) = sqrt(((-mb<sub>1</sub> &#8211; (-mb<sub>2</sub>)) / ((m^2) + 1))^2 + ((b<sub>1</sub> &#8211; b<sub>2</sub>) / ((m^2) + 1))^2) = sqrt((-mb<sub>1</sub> + mb<sub>2</sub>)^2 / (m^2 + 1)^2 + (b<sub>1</sub> &#8211; b<sub>2</sub>)^2 / (m^2 + 1)^2)  = sqrt((m^2)(-b<sub>1</sub> + b<sub>2</sub>)^2 / (m^2 + 1)^2 + (b<sub>1</sub> &#8211; b<sub>2</sub>)^2 / (m^2 + 1)^2) = sqrt(((m^2)(-b<sub>1</sub> + b<sub>2</sub>)^2 + (b<sub>1</sub> &#8211; b<sub>2</sub>)^2) / (m^2 + 1)^2) = sqrt(((m^2)(b<sub>1</sub>^2 &#8211; 2b<sub>1</sub>b<sub>2 </sub>+ b<sub>2</sub>^2) + (b<sub>1</sub>^2 &#8211; 2b<sub>1</sub>b<sub>2 </sub>+ b<sub>2</sub>^2)) / (m^2 + 1)^2) = sqrt((m^2 + 1)(b<sub>1</sub>^2 &#8211; 2b<sub>1</sub>b<sub>2 </sub>+ b<sub>2</sub>^2) / (m^2 + 1)^2) = sqrt((b<sub>1</sub>^2 &#8211; 2b<sub>1</sub>b<sub>2 </sub>+ b<sub>2</sub>^2) / (m^2 + 1)) = sqrt((b<sub>1</sub> &#8211; b<sub>2</sub>)^2 / (m^2 + 1)) = sqrt((b<sub>1</sub> &#8211; b<sub>2</sub>)^2) / sqrt(m^2 + 1) = |(b<sub>1</sub> &#8211; b<sub>2</sub>)| / sqrt(m^2 + 1)</p>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2013/08/27/perpendicular-distance-between-two-parallel-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intuitive reasons to avoid inconsistencies in mathematics</title>
		<link>http://kruel.co/2013/08/25/intuitive-reasons-to-avoid-inconsistencies-in-mathematics/</link>
		<comments>http://kruel.co/2013/08/25/intuitive-reasons-to-avoid-inconsistencies-in-mathematics/#comments</comments>
		<pubDate>Sun, 25 Aug 2013 10:26:41 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[proof by contradiction]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=5013</guid>
		<description><![CDATA[Question: What do the following three assumptions have in common? 1. (-1)(-1) = -1. 2. The number infinity is defined by its property 0x = 1. 3. r is the smallest rational number greater than 0. Answer: All three assumptions would make mathematics less useful, or meaningless. The first assumption would make the distributive property of multiplication for negative [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Question:</strong> What do the following three assumptions have in common?</p>
<p style="padding-left: 30px;"><strong>1.</strong> (-1)(-1) = -1.</p>
<p style="padding-left: 30px;"><strong>2.</strong> The number infinity is defined by its property 0x = 1.</p>
<p style="padding-left: 30px;"><strong>3.</strong> r is the smallest rational number greater than 0.</p>
<p><strong>Answer:</strong> All three assumptions would make mathematics less useful, or meaningless.</p>
<p>The first assumption would make the distributive property of multiplication for negative numbers useless:</p>
<p style="padding-left: 30px;">(-1)(1 + -1) = (-1)(1) + (-1)(-1)</p>
<p style="padding-left: 30px;">(-1)(0) = -1 + -1</p>
<p style="padding-left: 30px;">0 = -2</p>
<p>The second assumption is incompatible with the associative law for multiplication, and evident facts such as that 0*2=0:</p>
<p style="padding-left: 30px;">1 = infinity*0 = infinity *(0*2) = (infinity*0)*2 = 1*2 = 2</p>
<p style="padding-left: 30px;">1 = 2</p>
<p>The third assumption leads to a contradiction:</p>
<p style="padding-left: 30px;">x = r/2</p>
<p style="padding-left: 30px;">r &gt; x</p>
<p><span style="line-height: 1.4;">Mathematics can be viewed as either a tool, with practical value, or as a game. This tool can, for example, be used to divide things into 2 equal pieces. Respectively, one of the rules of the game is that you can get smaller things by dividing them. What matters here is (a) that we <em>want</em> to be able to divide things into equal parts, and (b) that it is <em>intuitively evident</em> that things can be divided.</span></p>
<p>To get a better idea of how mathematics would become less useful, or even meaningless, if we were to accept those assumptions, let us now take a closer look at the third assumption.</p>
<p>Assumption three is the assertion (let us label it P) that there is a smallest rational number greater than 0, and that this number is r. But some of the intuitively evident properties of our tool (let us label these properties S) contradict this assumption. In other words, S implies that P is false (which we will label ¬P).</p>
<p>The problem with assumption three is that S and P together imply that P is true and false at the same time, P and ¬P (a contradiction). But this is <em>absurd</em>. Either you can divide the number r, in which case it is not the smallest rational number greater than 0, or that is not possible. How do we decide?</p>
<p>To resolve this contradiction we ask ourselves, what speaks in favor of P, and what against P? It seems that nothing speaks in favor of P, and everything in favor of ¬P. We not only want to be able to divide things, including r, but it also seems obvious that this should be possible. After all, what would stop us from dividing r by 2? Dividing r by 2 is a straightforward and intuitive operation, since r does not seem to have any special properties, other than the claim that it is the smallest rational number greater than 0. But that claim has not been justified.</p>
<p>Therefore we are going to reject P, and instead assume that it is true that P is false. In other words, we are going to accept that ¬P is true. Which means that S implies ¬P: It is true that there is <em>no</em> smallest rational number greater than 0.</p>
<h2>Q&amp;A</h2>
<p><strong>Question:</strong> But are we justified to do so? There seems to be a lot of intuition involved here!</p>
<p style="padding-left: 30px;"><strong>Answer:</strong> Well, sure! One way or the other, we are honing a tool, or playing a game. And we do whatever it takes to keep our tool as effective as possible, and avoid our game from becoming meaningless.</p>
<p><strong>Question:</strong> Is there no alternative? Maybe there is a smallest number greater than 0 after all. We could just stay agnostic about this fact.</p>
<p style="padding-left: 30px;"><strong>Answer:</strong> The particular game that we are playing requires that every proposition is either true or not true, and that no proposition can be both true and not true. Technically this is called the principle of exclusive disjunction for contradictories, (P ∨ ¬P) ∧ ¬(P ∧ ¬P).</p>
<p><strong>Question:</strong> Why then are we playing that particular game, rather than another game?</p>
<p style="padding-left: 30px;"><strong>Answer:</strong> Other people are playing <a href="http://en.wikipedia.org/wiki/Paraconsistent_logic">different games</a>. But this particular game proved to be a useful tool. And given our game, there is some justification for avoiding contradictions, called the <a href="http://en.wikipedia.org/wiki/Principle_of_explosion">principle of explosion</a>. Explosion shows that everything can be proven from a contradiction, making it impossible to distinguish truth from falsehood. We obviously do not want that to happen, because it would render our tool useless, and the game meaningless. So if some assumption leads to a contradiction, we accept that it is false, to keep our tool from becoming useless, and to keep our game meaningful.</p>
<p><strong>Question:</strong> This all seems really shaky. Are there no proofs to settle these issues?</p>
<p style="padding-left: 30px;"><strong>Answer:</strong> No. To prove something true or false would presuppose that it must be either true or false, but not both or neither.</p>
<p><strong>Question:</strong> But since the basic assumptions of our game are based on intuition, is it not possible that these rules themselves are already inconsistent?</p>
<p style="padding-left: 30px;"><strong>Answer:</strong> That is possible. But those assumptions (axioms) have proved really useful so far, so that seems unlikely. And if our foundations eventually turn out to be inconsistent, then we will simply fix that inconsistency by rejecting certain axioms, or by adopting new ones, while trying to keep our tool useful.</p>
<p><strong>Question:</strong> What about probability theory, can we use it to estimate how likely our assumptions are to be consistent?</p>
<p style="padding-left: 30px;"><strong>Answer:</strong> Probabilistic reasoning (inductive reasoning), in contrast to the deductive reasoning above, allows for the possibility that the conclusion is false, even if all of the premises are true. Yet probabilistic reasoning is largely based on deductive foundations. For example, when you add or multiply probabilities (numbers), you rely on the validity of the the <a href="http://en.wikipedia.org/wiki/Peano_axioms">Peano axioms</a>, which are statements in first-order logic (a deductive system). So what you are asking for is if it is possible to use a system&#8217;s capabilities to verify if its capabilities are valid.</p>
<p style="padding-left: 30px;">It is indeed possible to use inductive reasoning to examine our deductive reasoning. And I did so above, when I said that the current axioms are probably consistent, because they have worked well so far. But the title of this post mentions intuition for a reason. When we use inductive reasoning, <a href="http://stephenlaw.blogspot.de/2012/10/problem-of-induction-explained-simply.html">because it worked in the past</a>, we rely on inductive reasoning. It is like trusting somebody because they claim to be trustworthy.</p>
<p style="padding-left: 30px;">So the answer is that you always rely on some amount of intuition, and on acting in good faith that your intuitions are correct. Since we are unable to prove our intuitions to be correct by using arguments that fundamentally rely on our intuitions.</p>
<p>We are now almost ready to formalize the above. Before we can do so we need to take a look at what is called &#8216;material implication&#8217;.</p>
<h2>Intuitive explanation of material implication</h2>
<p>Why is the <strong>material implication of classical logic</strong> (also known as material conditional or material consequence), p -&gt; q, defined to be false only when its antecedent (p) is true and the consequent (q) is false? Here is an informal way to think about it.</p>
<p>You could view logic as metamathematics, a language designed to talk about mathematics. Logic as the &#8220;hygiene&#8221;, the grammar and syntax of mathematics.</p>
<p>In the language of classical logic every proposition is either true or not true, and no proposition can be both true and not true. Now what if we want to express the natural language construction &#8220;If&#8230;then&#8230;&#8221; in this language? Well, there are exactly sixteen possible truth functions of two inputs p and q (since there are 2^2 inputs and (2^2)^2 ways to map them to outputs). And the candidate that best captures the connotations of what we mean by &#8220;If&#8230;then&#8230;&#8221; is the definition of material implication. Here is why.</p>
<p>By stating that p -&gt; q is true we want to indicate that the truth of q can be inferred from the truth p, but that nothing in particular can be inferred from the falsity of p. And this is exactly the meaning captured by the material conditional:</p>
<table style="height: 102px;" border="1" width="133" align="center">
<tbody>
<tr>
<th style="text-align: center;">p</th>
<th>q</th>
<th>p-&gt;q</th>
</tr>
<tr>
<th>T</th>
<th>T</th>
<td>T</td>
</tr>
<tr>
<th>T</th>
<th>F</th>
<td>F</td>
</tr>
<tr>
<th>F</th>
<th>T</th>
<td>T</td>
</tr>
<tr>
<th>F</th>
<th>F</th>
<td>T</td>
</tr>
</tbody>
</table>
<p>First, when &#8220;If p, q&#8221; is true, and we also know that p is true, then we want to be able to infer q. In other words, if we claim that if p is true then q is true, then if p is indeed true, q should be true as well. This basic rule of inference has a name, it is called <a href="http://en.wikipedia.org/wiki/Modus_ponens">modus ponens</a>.</p>
<p>Second, if we claim &#8220;If p, q&#8221;, then if p is false, we did not say anything in particular about q. If p is false, q can either be true or false, our claim &#8220;If p, q&#8221; is still true.</p>
<p>But notice that it is not possible to capture all notions of what we colloquially mean by &#8220;If&#8230;then&#8230;&#8221; statements as a two-valued truth function.</p>
<p>It is for example possible to make meaningless statements such as &#8220;If grass is red then the moon if made of cheese.&#8221; This is however unproblematic under the assumption that logic is an idealized language, which is adequate for mathematical reasoning. Since we are mainly interested in simplicity and clarity. Under this assumption, such nonsense implications are analogous to grammatically correct but meaningless sentences that can be formed in natural languages, such as &#8220;<a href="http://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_furiously">Colorless green ideas sleep furiously</a>&#8220;.</p>
<p>To demonstrate its adequacy for mathematics, here is a mathematical example:</p>
<p style="padding-left: 30px;">If n &gt; 2 then n^2 &gt; 4.</p>
<p>We claim that if n is greater than 2 then its square must be greater than 4. For n = 3, this is obviously true, as we claimed. But what about n smaller than 2? We didn&#8217;t say anything in particular about n smaller than 2. Its square could be larger than 4 or not. And indeed, n = 1 and n = -3 yield a false, respectively true, consequent. Yet the implication is true in both cases.</p>
<p>Intuitively more problematic are statements such as (p and not(p)) -&gt; q, p and its negation imply q. Think about it this way. The previous implication is a tautology, it is always true. And you believe true statements. This however does not mean that you must believe that arbitrary q is true too (as long as you stay consistent), since in case of the falsity of the antecedent you are not making any particular claim about the truth of the consequent (q). And since the statement that p is true and false, p AND not(p), is always false &#8212; remember the principle of exclusive disjunction for contradictories, (P ∨ ¬P) ∧ ¬(P ∧ ¬P), requires that every proposition is either true or not true, and that no proposition can be both true and not true &#8212; q can be false without invalidating the implication.</p>
<p>Another way to look at p -&gt; q is by interpreting it as &#8220;p is a subset of q&#8221;. Then if it is true that x <em>is an element of</em> p, then it must be true that it is also an element of q (since q contains p). However, if x is not an element p, then it might still turn out to be an element of q, since q can be larger than p.</p>
<h2>Proof by contradiction</h2>
<p>Here is a formula which is known as &#8216;reductio ad absurdum':</p>
<p style="padding-left: 30px;"><strong>((¬p-&gt;q)&amp;(¬p-&gt;¬q))-&gt;p</strong></p>
<p>This formula is a tautology. Which means that we believe this formula.</p>
<p>Remember that in the language of classical logic every proposition is either true or not true, and no proposition can be both true and not true. Also remember that an implication, such as p-&gt;q, is only false when its antecedent (p) is true and the consequent (q) is false.</p>
<p>Now suppose we assume ¬p to be true (that p is false). If this assumption allows us to prove &#8220;If ¬p, q&#8221; (¬p implies q), <em>and</em> (p&amp;q is true only if both of its operands are true) &#8220;If ¬p, ¬q&#8221;  (¬p implies ¬q), then we proved that the antecedent of the above formula, (¬p-&gt;q)&amp;(¬p-&gt;¬q), is also true. And since we already know that the formula is always true, its consequent, p, must therefore be true as well.</p>
<p><strong>Here is what happened:</strong></p>
<p><strong>(1)</strong> We started with a theory consisting of a set of axioms that we assumed to be true (e.g. the Peano axioms), tautologies that are true, and formulas that we proved to be true.</p>
<p><strong>(2)</strong> We made an additional assumption, that p is false.</p>
<p><strong>(3)</strong> We considered the case where this assumption, together with our theory, allowed us to prove two implications:</p>
<p style="padding-left: 30px;">(¬p-&gt;q)</p>
<p style="padding-left: 30px;">(¬p-&gt;¬q)</p>
<p><strong>(4) </strong>The truth of both of these implications means that we proved the antecedent of the tautology to be true by proving the conjunction of both implications to be true:</p>
<p style="padding-left: 30px;">(¬p-&gt;q)&amp;(¬p-&gt;¬q)</p>
<p><strong>(5)</strong> We needed to find an interpretation of the initial formula under which it remains true when its antecedent is true.</p>
<p><strong>(6)</strong> Since q and ¬q cannot be both true in our theory, as this would be absurd, the only interpretation that is left for both implications to be true is when their antecedent, ¬p, is false. Which also satisfies our tautology.</p>
<p><strong>(7)</strong> Therefore p is true.</p>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2013/08/25/intuitive-reasons-to-avoid-inconsistencies-in-mathematics/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A devil&#8217;s offer: Tossing a magic coin to get out of hell</title>
		<link>http://kruel.co/2013/01/14/a-devils-offer-tossing-a-magic-coin-to-get-out-of-hell/</link>
		<comments>http://kruel.co/2013/01/14/a-devils-offer-tossing-a-magic-coin-to-get-out-of-hell/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 11:52:11 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[decision theory]]></category>
		<category><![CDATA[rationality]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=3842</guid>
		<description><![CDATA[(The following is adapted from a scenario by Graham Priest, depicted in his book &#8216;Logic: A Very Short Introduction&#8216;.) Suppose that at some point you find yourself in a posthuman hell. But you have one chance to get out of it. You can toss a coin; if it comes down heads, you are out and go [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><em>(The following is adapted from a scenario by Graham Priest, depicted in his book &#8216;<a href="http://www.amazon.com/Logic-Short-Introduction-Graham-Priest/dp/0192893203">Logic: A Very Short Introduction</a>&#8216;.)</em></p>
<p>Suppose that at some point you find yourself in a posthuman hell. But you have one chance to get out of it. You can toss a coin; if it comes down heads, you are out and go to heaven. If it comes down tails, you stay in hell forever. The coin is not a fair one, however, and the posthuman entity that simulates the hell has control of the odds. If you toss it today, the chance of heads is 1/2 (i.e. 1-1/2). If you wait till tomorrow, the chances go up to 3/4 (i.e. 1-1/2^2). If you wait <em>n</em> days, the chance of going to heaven goes up to 1-1/2^n. How long are you going to wait before tossing the coin?</p>
<p>The associated values of remaining in hell or escaping are constant over time.</p>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2013/01/14/a-devils-offer-tossing-a-magic-coin-to-get-out-of-hell/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Odds and Log-Odds</title>
		<link>http://kruel.co/2012/06/17/odds-and-log-odds/</link>
		<comments>http://kruel.co/2012/06/17/odds-and-log-odds/#comments</comments>
		<pubDate>Sun, 17 Jun 2012 14:12:53 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[log-odds]]></category>
		<category><![CDATA[odds]]></category>
		<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=3052</guid>
		<description><![CDATA[This is a very basic introduction to odds, followed by a short introduction to log-odds and a few recommendations from where to go from here. Odds Imagine you were living in a universe with 3 gods. One benefactor and two nasty gods. Each time you want or need something, one of the gods is chosen at [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is a very basic introduction to <span style="text-decoration: underline;">odds</span>, followed by a short introduction to <span style="text-decoration: underline;">log-odds</span> and a few recommendations from where to go from here.</p>
<h3>Odds</h3>
<p>Imagine you were living in a universe with 3 gods. One benefactor and two nasty gods. Each time you want or need something, one of the gods is chosen at random to serve you.</p>
<p>So if you want to eat strawberries, and you get lucky, the benefactor is chosen to serve you some tasty strawberries. But that&#8217;s only going to happen, on average, 1/3 of times. If one of the two nasty gods is chosen instead, you might or might not get <em>something</em>, but what&#8217;s for sure is that it won&#8217;t be what you <em>want</em>.</p>
<p>In other words, after a very long lifespan you can expect to have 1/3 of your wants and needs being satisfied. In 2 out of 3 cases you did either get nothing, if you are lucky, or something <em>nasty</em>.</p>
<p>That means that if you ask for strawberries it is 2 times as likely that you won&#8217;t get strawberries, or something nasty instead, as it is that you are actually going to get what you want. Because (2/3) / (1/3) = 2/1 = 2. In other words, in the long-term you will be left with 2 unfulfilled wishes for each fulfillment, or 2:1.</p>
<p>In this undesirable universe that we imagine, the <strong>odds in favor</strong> of getting what you want are 1:2. Which means that the <strong>odds against</strong> receiving some tasty strawberries when you want them are 2:1.</p>
<p>Here is another more abstract example. Imagine that the probability of event <em>A</em> happening is</p>
<p>P(A) = 80% = 0.80 = 80/100 = 4/5.</p>
<p>Then the probability of it not happening, ~A, is</p>
<p>P(~A) = 1-P(A) = 20% = 0.20 = 20/100 = 1/5.</p>
<p>Now <strong>the odds</strong> are simply the ratio of the probabilities. &#8216;Odds&#8217; are an expression of relative probabilities.</p>
<p>The <em>odds in favor</em> are the ratio of the probability that an event will happen to the probability that it will not happen. Which in our example equals</p>
<p>P(A)/P(~A) = P(A) / (1-P(A)) = 80%/20% = 0.80/0.20 = (80/100) / (20/100) = 80/20 = (4/5) / (1/5) = 4:1.</p>
<p>The other way round, the<em> odds against</em> event <em>A</em> are 1:4.</p>
<h3>Why use odds?</h3>
<p>Using odds can help to illustrate the actual confidence accompanying various probabilities.</p>
<p>Take for example the difference between a probability of 99.98% and 99.99% of an event occurring. In odds we have,</p>
<p>99.98%/0.02% = 0.9998/0.0002 = (9998/10000) / (2/10000) = 9998/2 = 4999:1</p>
<p>and</p>
<p>99.99%/0.01% = 0.9999/0.0001 = (9999/10000) / (1/10000) = 9999/1 = 9999:1.</p>
<p>Which means that increasing your confidence from 99.98% to 99.99% is equivalent to saying that you believe that the event is 9999 times as likely to occur than not instead of it being &#8220;just&#8221; 4999 times as likely.</p>
<p>As you can see, not only does using odds reveal that an increase from 99.98% to 99.99% means that you are actually<em> twice</em> as confident as before, but also how <em>incredible</em> confident you must be to say that something is even <span style="text-decoration: underline;">4999</span> times more likely to occur than not.</p>
<p>In the same way, converting probabilities to odds shows that the difference between 50.01% and 50.02% is negligible (under many circumstances). As 50.01% in odds are</p>
<p>50.01%/49.99% = 0.5001/0.4999 = (5001/10000) / (4999/10000) = 5001/4999 = 1.0004:1</p>
<p>and</p>
<p>50.02%/49.98% = 0.5002/0.4998 = (5002/10000) / (4998/10000) = 5002/4998 = 1.0008:1.</p>
<p>Which is almost the same, since 1.0008/1.0004 ≈ 1.</p>
<h3>What odds reveal</h3>
<p>To see why you have to realize that using odds reveals what might intuitively not be obvious, namely that <span style="text-decoration: underline;">to increment the smallest factor has the largest effect</span>.</p>
<p>In the first example we had 9998/2 and 9999/1, which is the same as 9998 * 1/2 and 9999 * 1. The larger factor only inreased by 0.01% while the smaller factor increased by 100%, that is 9999/1 ≈ 9998*1.<span style="text-decoration: underline;">0001</span>*(1/2)*<strong><span style="text-decoration: underline;">2</span></strong>. Notice the bold <em>2</em>? That&#8217;s <em>twice</em> as much.</p>
<p>Whereas in the second example both factors are approximately equal and increased or decreased by a similar percentage. That is 5002/4998 is approximately equal to 5001*<span style="text-decoration: underline;">1.0002</span>*1/4999*<span style="text-decoration: underline;">1.0002</span>. Which is almost an increase of a factor of <em>1</em>, or in other words no increase at all.</p>
<p>What odds reveal is that the relative increase or decrease of a factor by one unit becomes more pronounced as the factors absolute difference increases.</p>
<h3>Log-odds</h3>
<p>Another way of representing probabilities is in terms of log-odds, or decibel (dB).</p>
<p>To convert probabilities into log-odds, first convert percentages into odds. We have already talked about how to do that above.</p>
<p>Once you got the odds, all you have to do is to take the base 10 logarithm of the odds ratio and multiply it by 10.</p>
<p>For example, 4:1 odds would translate to 6dB because 10*log(4) ≈ 6.</p>
<h3>Further Reading and Resources</h3>
<p>I could go on to explain the advantages of using log-odds. But there are others who have already done so, probably better than I could. And you should now be able to follow and understand what they have written.</p>
<p>I recommend that you start with <a href="http://dl.dropbox.com/u/34547557/log-probability.pdf">this short primer</a>, maybe followed by <a href="http://lesswrong.com/lw/buh/the_quick_bayes_table/">this blog post</a>.</p>
<p>For a precomputed lookup table of important probabilities and their approximate odds and log-odds (decibel) values see <a href="http://dl.dropbox.com/u/37262738/bayescraft.pdf">this PDF</a> made by <a href="http://muflax.com/">muflax</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2012/06/17/odds-and-log-odds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Monty Hall problem in plain English</title>
		<link>http://kruel.co/2012/05/07/the-monty-hall-problem-in-plain-english/</link>
		<comments>http://kruel.co/2012/05/07/the-monty-hall-problem-in-plain-english/#comments</comments>
		<pubDate>Mon, 07 May 2012 10:33:15 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=2909</guid>
		<description><![CDATA[The following is based on the book &#8216;Das Ziegenproblem&#8216; by Gero von Randow. Setup: There are 3 doors. 1 door has a car behind it. 2 doors have a goat behind it. The content behind the doors is randomly chosen. There are 2 candidates, A and B. There is 1 moderator who knows which door [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The following is based on the book &#8216;<em>Das Ziegenproblem</em>&#8216; by Gero von Randow.</p>
<p><strong>Setup</strong>:</p>
<ul>
<li>There are <span style="text-decoration: underline;">3 doors</span>.</li>
<li><span style="text-decoration: underline;">1 door has a car</span> behind it.</li>
<li><span style="text-decoration: underline;">2 doors have a goat</span> behind it.</li>
<li>The <span style="text-decoration: underline;">content behind the doors</span> is <span style="text-decoration: underline;">randomly chosen</span>.</li>
<li>There are <span style="text-decoration: underline;">2 candidates</span>, <strong>A</strong> and <strong>B</strong>.</li>
<li>There is <span style="text-decoration: underline;">1 moderator</span> who <span style="text-decoration: underline;">knows which door has a car behind it</span>.</li>
</ul>
<p><strong>Actions:</strong></p>
<ol>
<li><span style="text-decoration: underline;"><em>A</em> and <em>B</em></span> are asked to choose a door and both <span style="text-decoration: underline;">choose the same door</span>.</li>
<li>The <span style="text-decoration: underline;">moderator chooses one door</span> which <span style="text-decoration: underline;">has a goat behind it</span>.</li>
<li><span style="text-decoration: underline;"><em>A</em> and <em>B</em> are asked if they would like to switch their choice</span> and pick the remaining door.</li>
<li><span style="text-decoration: underline;"><em>A</em> always stays with his choice</span>, the door that has been initially chosen by both <em>A</em> and <em>B</em>.</li>
<li><span style="text-decoration: underline;"><em>B</em> always changes her choice</span> to the <span style="text-decoration: underline;">remaining third door</span>.</li>
</ol>
<p><strong>Repeat the actions 999 times:</strong></p>
<p>If you repeat the above list of actions 999 times, given the same setup, what will happen?</p>
<p>Candidate <em>A</em> always stays with his initial choice. Which means that he will on average win 1/3 of all games. He will win 1/3*999, 333 cars.</p>
<p>But who won the remaining 666 cars?</p>
<p>Given the setup of the game, the moderator has to choose a door with a goat behind it. Therefore the moderator does win 0 cars.</p>
<p>Candidate B, who always switched her choice, after the moderator picked a door with a goat behind it, must have won the remaining 666 cars (2/3*999)!</p>
<p><strong>1 candidate and 100 doors:</strong></p>
<p>Alter the above setup of the game in the following way</p>
<ul>
<li>There are <span style="text-decoration: underline;">100 doors</span>.</li>
<li><span style="text-decoration: underline;">1 door has a car</span> behind it.</li>
<li><span style="text-decoration: underline;">99 doors have a goat</span> behind it.</li>
<li>There is <span style="text-decoration: underline;">1 candidate</span>, <strong>A</strong><strong></strong>.</li>
</ul>
<p>Alter the above actions in the following way</p>
<ul>
<li>The <span style="text-decoration: underline;">moderator opens 98 doors with goats</span> behind them.</li>
</ul>
<p>Now let’s say the candidate picks door number 8. By rule of the game the moderator now has to open 98 of the remaining 99 doors behind which there is no car.</p>
<p>Afterwards there is only one door left besides door 8 that the candidate has chosen.</p>
<p>You would probably switch your choice to the remaining door now. If so, the same should be the case with only 3 doors!</p>
<p><strong>Further explanation:</strong></p>
<p>Your chance of picking the car with your initial choice is 1/3 but your chance of choosing a door with a goat behind it, at the beginning, is 2/3. Thus on average, 2/3 of times that you are playing this game you’ll pick a goat at first go. That also means that 2/3 of times that you are playing this game, and by definition pick a goat, the moderator will have to pick the only remaining goat. Because given the laws of the game the moderator knows where the car is and is only allowed to open a door with a goat in it.</p>
<p>What does that mean?</p>
<p>On average, at first go, you pick a goat 2/3 of the time and hence the moderator is forced to pick the remaining goat 2/3 of the time. That means 2/3 of the time there is no goat left, only the car is left behind the remaining door. Therefore 2/3 of the time the remaining door has the car. Which makes switching the winning strategy.</p>
<h3>Further reading</h3>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Monty_Hall_problem">Monty Hall problem</a></li>
<li><a href="http://marilynvossavant.com/game-show-problem/">Marilyn vos Savant | The Game Show Problem </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2012/05/07/the-monty-hall-problem-in-plain-english/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Number of combinations with repetition</title>
		<link>http://kruel.co/2012/05/06/number-of-combinations-with-repetition/</link>
		<comments>http://kruel.co/2012/05/06/number-of-combinations-with-repetition/#comments</comments>
		<pubDate>Sun, 06 May 2012 17:43:42 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Kruel]]></dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://kruel.co/?p=2900</guid>
		<description><![CDATA[There are n = 4 sorts of candy to choose from and you want to buy k = 10 candies. How many ways can you do it? This is a problem of counting combinations (order does not matter) with repetition (you can choose multiple items from each category). Below we will translate this problem into [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There are <em>n</em> = <span style="text-decoration: underline;">4 sorts of candy</span> to choose from and you want to buy <em>k</em> = <span style="text-decoration: underline;">10 candies</span>. How many ways can you do it?</p>
<p>This is a problem of <span style="text-decoration: underline;">counting combinations</span> (order does not matter) <span style="text-decoration: underline;">with repetition</span> (you can choose multiple items from each category). Below we will translate this problem into a problem of <span style="text-decoration: underline;">counting combinations <em>without</em> repetition</span>, which can be solved by using a better understood formula that is known as the &#8220;<span style="text-decoration: underline;">binomial coefficient</span>&#8220;.</p>
<p>First let us represent the 10 possible candies by 10 symbols <strong>&#8216;C&#8217;</strong> and divide them into 4 categories by placing a partition wall, represented by a <strong>&#8216;+&#8217;</strong> sign, between each sort of candy to separate them from each other</p>
<p><strong>CC+CCCC+C+CCC</strong></p>
<p>Note that there are 10 symbols <strong>&#8216;C&#8217;</strong> and 3 partition walls, represented by a <strong>&#8216;+&#8217;</strong> sign. That is, there are <em>n-1+k</em> = 13, equivalently <em>n+k-1</em>, symbols. Further note that each of the 3 partition walls could be in 1 of 13 positions. In other words, to <span style="text-decoration: underline;">represent various choices of 10 candies from 4 categories</span>, the positions of the partition walls could be rearranged <span style="text-decoration: underline;">by choosing <em></em><em>n-1</em> = 3 of <em></em><em>n+k-1</em> = 13 positions</span></p>
<p><strong>C++CCC+CCCCCC</strong></p>
<p><strong>CCCCCCCCCC+++</strong></p>
<p>We have now <span style="text-decoration: underline;">translated the original problem into choosing 3 of 13 available positions</span>.</p>
<p>Note that each position can only be chosen once. Further, the order of the positions does not matter. Since choosing positions {1, 4, 12} does separate the same choice of candies as the set of positions {4, 12, 1}. Which means that we are now dealing with combinations <em>without</em> repetition.</p>
<p>Calculating combinations without repetition can be done using the formula that is known as the <em>binomial coefficient</em></p>
<p><strong>n!/k!(n-k)!</strong></p>
<p>As justified above, to calculate combinations <em>with</em> repetition, simply replace <em>n</em> with <em>n+k-1</em> and <em>k</em> with <em>n-1</em>,</p>
<p><strong>(n+k-1)!/(n-1)!((n+k-1)-(n-1))!</strong></p>
<p>In our example above this would be (4+10-1)!/(4-1)!((4+10-1)-(4-1))! = 13!/3!10!. Which is equivalent to</p>
<p><strong></strong><strong>(n+k-1)!/</strong><strong>k!(n-1)!</strong></p>
<p>because (4+10-1)!/10!(4-1)! = 13!/10!3! = 13!/3!10!, which is the same result that we got above.</p>
<h3>Further reading</h3>
<ul>
<li><a href="http://www.mathsisfun.com/combinatorics/combinations-permutations.html">Combinations and Permutations</a></li>
<li><a href="http://betterexplained.com/articles/easy-permutations-and-combinations/">Easy Permutations and Combinations </a></li>
<li><a href="How To Understand Combinations Using Multiplication">How To Understand Combinations Using Multiplication</a></li>
<li><a href="http://betterexplained.com/articles/how-to-understand-combinations-using-multiplication/">Navigate a Grid Using Combinations And Permutations</a></li>
<li><a href="http://www.scribd.com/doc/36270691/Combinations-With-Repetitions">Combinations with Repetitions </a></li>
<li><a href="http://en.wikipedia.org/wiki/Multiset_coefficient#Counting_multisets">Counting multisets &#8220;n multichoose k&#8221;</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kruel.co/2012/05/06/number-of-combinations-with-repetition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
