<?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>steve&#039;s alternative recursion</title>
	<atom:link href="http://www.alternativerecursion.info/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.alternativerecursion.info</link>
	<description>stuff from my brain</description>
	<lastBuildDate>Tue, 29 Jun 2010 16:39:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Unlimited Voice + Data* + TXT 2-line family plans in the US</title>
		<link>http://www.alternativerecursion.info/?p=1010</link>
		<comments>http://www.alternativerecursion.info/?p=1010#comments</comments>
		<pubDate>Tue, 29 Jun 2010 15:35:37 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=1010</guid>
		<description><![CDATA[Simple table of current US pricing among wireless service providers.]]></description>
			<content:encoded><![CDATA[<p>Simple table of current US pricing among wireless service providers.</p>
<p><iframe width='700' height='330' frameborder='0' src='https://spreadsheets.google.com/pub?key=0AvzXy4FLASmsdEhRSk43RnNxX0lFU0o0OFEzemg1b1E&#038;hl=en&#038;single=true&#038;gid=0&#038;output=html&#038;widget=true'></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=1010</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Another Fun Puzzle</title>
		<link>http://www.alternativerecursion.info/?p=964</link>
		<comments>http://www.alternativerecursion.info/?p=964#comments</comments>
		<pubDate>Tue, 11 May 2010 05:11:32 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=964</guid>
		<description><![CDATA[The prime number 4535653, when translated to base 16, gives the hexadecimal number 0&#215;453565, which has the same digits as the original number, omitting the last digit. Find another example of a prime number that, translated to hexadecimal, yields the same digits, omitting the last 21 digits This was the Ponder This Challenge for April [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The prime number 4535653, when translated to base 16, gives the hexadecimal number 0&#215;453565, which has the same digits as the original number, omitting the last digit.</p>
<p>Find another example of a prime number that, translated to hexadecimal, yields the same digits, omitting the last 21 digits</p>
</blockquote>
<p><a href="http://domino.research.ibm.com/Comm/wwwr_ponder.nsf/Challenges/April2010.html" target="_blank">This</a> was the Ponder This Challenge for April 2010.</p>
<p>&#160;</p>
<p>It relies on <a href="http://en.wikipedia.org/wiki/Numeral_system#Positional_systems_in_detail" target="_blank">positional base numeral systems</a> which are widely used and rarely thought about in our culture.</p>
<p> <span id="more-964"></span>
<p>Let’s consider the 7-digit decimal (base 10) number: 4535653</p>
<table border="1" cellspacing="0" cellpadding="0" width="800">
<tbody>
<tr>
<td valign="top" width="106">digit’s place</td>
<td valign="top" width="94">7</td>
<td valign="top" width="100">6</td>
<td valign="top" width="100">5</td>
<td valign="top" width="100">4</td>
<td valign="top" width="100">3</td>
<td valign="top" width="100">2</td>
<td valign="top" width="100">1</td>
</tr>
<tr>
<td valign="top" width="106">unit value</td>
<td valign="top" width="94">10^6</td>
<td valign="top" width="100">10^5</td>
<td valign="top" width="100">10^4</td>
<td valign="top" width="100">10^3</td>
<td valign="top" width="100">10^2</td>
<td valign="top" width="100">10^1</td>
<td valign="top" width="100">10^0</td>
</tr>
<tr>
<td valign="top" width="106">digit integer</td>
<td valign="top" width="94">4</td>
<td valign="top" width="100">5</td>
<td valign="top" width="100">3</td>
<td valign="top" width="100">5</td>
<td valign="top" width="100">6</td>
<td valign="top" width="100">5</td>
<td valign="top" width="100">3</td>
</tr>
<tr>
<td valign="top" width="106">value per place</td>
<td valign="top" width="94">4*10^6</td>
<td valign="top" width="100">5*10^5</td>
<td valign="top" width="100">3*10^4</td>
<td valign="top" width="100">5*10^3</td>
<td valign="top" width="100">6*10^2</td>
<td valign="top" width="100">5*10^1</td>
<td valign="top" width="100">3*10^0</td>
</tr>
</tbody>
</table>
<p>So to get the value for the entire 7-digit number, we simply sum the values per each place of the decimal number, which is</p>
<p>4*10^6 + 5*10^5 + 3*10^4 + 5*10^3 + 6*10^2 + 5*10^1 + 3*10^0</p>
<p>which = (as written in decimal) 4535653</p>
<p>I’ll do the same table for the hexadecimal (base 16) number 453565:</p>
<table border="1" cellspacing="0" cellpadding="0" width="800">
<tbody>
<tr>
<td valign="top" width="114">digit’s place</td>
<td valign="top" width="114">6</td>
<td valign="top" width="114">5</td>
<td valign="top" width="114">4</td>
<td valign="top" width="114">3</td>
<td valign="top" width="114">2</td>
<td valign="top" width="114">1</td>
</tr>
<tr>
<td valign="top" width="114">unit value</td>
<td valign="top" width="114">16^5</td>
<td valign="top" width="114">16^4</td>
<td valign="top" width="114">16^3</td>
<td valign="top" width="114">16^2</td>
<td valign="top" width="114">16^1</td>
<td valign="top" width="114">16^0</td>
</tr>
<tr>
<td valign="top" width="114">digit</td>
<td valign="top" width="114">4</td>
<td valign="top" width="114">5</td>
<td valign="top" width="114">3</td>
<td valign="top" width="114">5</td>
<td valign="top" width="114">6</td>
<td valign="top" width="114">5</td>
</tr>
<tr>
<td valign="top" width="114">value per place</td>
<td valign="top" width="114">4*16^5</td>
<td valign="top" width="114">5*16^4</td>
<td valign="top" width="114">3*16^3</td>
<td valign="top" width="114">5*16^2</td>
<td valign="top" width="114">6*16^1</td>
<td valign="top" width="114">5*16^0</td>
</tr>
</tbody>
</table>
<p>4*16^5 + 5*16^4 + 3*16^3 + 5*16^2 + 6*16^1 + 5*16^0 = (decimal) 4535653 = (hexadecimal) 453565</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Let’s get back to the problem, they want us to find a number with two properties:</p>
<p><strong>1. the hexadecimal representation is identical to the decimal representation omitting the last 21 digits.</strong></p>
<p><strong>2. The Integer is Prime.</strong></p>
<p>for now lets examine #1 for a moment, How do we find numbers with that property…</p>
<p>well each digit in a number of any base normally has this value to contribute:</p>
<p>unit_value * digit_integer </p>
<p>where:</p>
<p>unit_value = base ^ (digit_place – 1)</p>
<p>0 &lt;= digit_integer &lt; base , so max(digit_integer) = base &#8211; 1</p>
<p>maximum_cumulative_value_of_previous_digits(digit_place) = sum(max(digit_integer)*unit_value(p), p=1..digit_place – 1) </p>
<p>which = unit_value(digit_place) – 1 </p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="numeral system" border="0" alt="numeral system" src="http://www.alternativerecursion.info/wp-content/uploads/2010/05/numeralsystem1.png" width="614" height="617" /> </p>
<p>let’s declare a couple variables</p>
<p>&#160;</p>
<p>n is an integer</p>
<p>hexn is the base 16 representation of n</p>
<p>decn is a base 10 number constructed by appending 21 0s to the right of the literal hexn.</p>
<p>&#160;</p>
<p>for this problem, the decimal number must be of equal value to the hex number, but must share all digits except for the last 21…</p>
<p>This means that we can&#160; use the last 21 digits of the decimal number to make up for any discrepancy of value, and 21 digits of decimal can get up to sum ( 9 * 10^place-1,place = 1..21) = 999999999999999999999 = 10^21 &#8211; 1</p>
<p>So any integer n, where hexn – decn is positive and no more than 10^21 – 1 is a candidate to be a solution.</p>
<p>&#160;</p>
<p>our integer n will satisfy the first condition of the puzzle IFF:</p>
<p>0 &lt;= hexn – decn &lt; 10^21</p>
<p>&#160;</p>
<p>So let’s design a different positional numeral system to examine the value of this difference hexn – decn.</p>
<p>let’s define a numeral system where the value is the contribution to hexn-decn, and the character set are 0-9</p>
<p>special_unit_value(digit_place) = the difference in unit value in the hex to the unit value in the decimal after 21 0s are appended…</p>
<p>special_unit_value(digit_place) = 16^(digit_place – 1) &#8211; 10^(21+ digit_place – 1)</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ttop" border="0" alt="ttop" src="http://www.alternativerecursion.info/wp-content/uploads/2010/05/ttop1.png" width="764" height="1233" /> </p>
<p>so we see from the graph above that we can get positive values if we get enough digits in the hex number, let’s look at a more detailed chart of unit_value per digit_place:</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Capture" border="0" alt="Capture" src="http://www.alternativerecursion.info/wp-content/uploads/2010/05/Capture1.png" width="846" height="1711" /> </p>
<p>we see the minimum cumulative value for all digits maxes out at </p>
<p>-3653862699613613450061613042885398017647315043542900294867371565365704404131411080078183579778733265462124364559775760279143</p>
<p>~=-3.65*10^123</p>
<p>our first positive unit value is at digit 104 where special_unit_value = +576895500643977583230644928524336637254474927428499508554380724390492659780981533203027367035444557561459392400373732868096</p>
<p>~=+5.77*10^122</p>
<p>This is good, very positive, but not nearly too big for the negative contribution of all the previous digits.</p>
<p>&#160;</p>
<p>The next positive special_unit_value at place 105 = +69230328010303641331690318856389386196071598838855992136870091590247882556495704531248437872567112920983350278405979725889536</p>
<p>~=+6.92*10^124</p>
<p>this tells us that our number cannot even have a single non-negative integer after place 104, because the 105th special_unit_value is so much larger than all the negative contribution the lesser digits can make, in fact if we max out the negative for all the lesser digits, it only subtracts about 0.5% of the value of 1 unit of the 105th digit.</p>
<p>(6.23*10^125 – 3.65*10^123 = 6.19*10^125)</p>
<p>Which is way larger than 10^21, the maximum acceptable special_value in this problem.</p>
<p>&#160;</p>
<p>so hexn must be 104 digits exactly.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>we could increment n&#160; or hexn , starting at 16^105, but to cover all 104 digit hex integers with digits [0-9], that will take 9*10^103 tests to see if 0&lt;hexn-decn&lt;10^21</p>
<p>9*10^103~=which is ~2^345.3285, which isn’t even close to feasible.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Instead we can go from the 104th digit to lesser digits, only considering values which (considering the maximum negative cumulative value of lesser digits) can yield a value within our range of (0,10^21).</p>
<p>here’s the code:</p>
<pre class="brush: python;">def specialUnitValue(place):
	return 16**(place-1) - 10**(21+place-1)

def maximumCumulativeValue(place):
	r=0
	for x in range(1,place):
		r+=9*max(specialUnitValue(x),0)
	return r

def minimumCumulativeValue(place):
	r=0
	for x in range(1,place):
		r+=9*min(specialUnitValue(x),0)
	return r		

def getValue(digit_list):
	v=0
	digit_list.reverse()
	p=0
	for digit_value in digit_list:
		p+=1
		v+=digit_value*(16**(p-1))
	digit_list.reverse()
	return v

def recursiveFilter(place,digit_list,current_value):
	if place == 0:
		number_list.append(getValue(digit_list))
		return
	for x in range(0,10):
		new_current_value = current_value + x*specialUnitValue(place)
		if -maximumCumulativeValue(place) &lt;= new_current_value &lt; 10**21 - minimumCumulativeValue(place):
			recursiveFilter(place-1,digit_list+[x],new_current_value)
	return

place = 104
digit_list = []
number_list =[]
current_value = 0
recursiveFilter(place,digit_list,current_value)
print(&quot;the following numbers are represented exactly the same in hex and decimal, omitting the last 21 digits of the decimal representation:&quot;)
for n in number_list:
	print()
	print(&quot;(dec)&quot;,str(n))
	print(&quot;(hex)&quot;,str(hex(n))[2:])</pre>
<p>outputs:</p>
<pre>the following numbers are represented exactly the same in hex and decimal, omitting the last 21 digits of the decimal representation:

(dec) 0
(hex) 0

(dec) 10964973879145266684597918386961206640359744239118799335560543882943204057285999161085137407678295834996206085978967677028758
(hex) 10964973879145266684597918386961206640359744239118799335560543882943204057285999161085137407678295834996

(dec) 10965042548987794527084057351766268905929738560121836183995663823085815102408704908398080417506152437998396385865902388902296
(hex) 10965042548987794527084057351766268905929738560121836183995663823085815102408704908398080417506152437998

(dec) 11382975651657610360011724373059527023679401235446000875434984276671144440904563609247580929003959820277226372565581487538807
(hex) 11382975651657610360011724373059527023679401235446000875434984276671144440904563609247580929003959820277

(dec) 11383044321503994265174950355726300568630049590682850168652076962700460784689758874865273083169197842932705865806646564104498
(hex) 11383044321503994265174950355726300568630049590682850168652076962700460784689758874865273083169197842932

(dec) 11403774832697699927191683625580629545730840588452432470080875397274364900728637535263415299444961605674432192938509636490868
(hex) 11403774832697699927191683625580629545730840588452432470080875397274364900728637535263415299444961605674

(dec) 22786823350482228205608199978099471169330070448099877920884203755897679528961138686897878221599372454029885357802030895546409
(hex) 22786823350482228205608199978099471169330070448099877920884203755897679528961138686897878221599372454029

(dec) 22807622531522543610094414106106772108649683164642972183286269214619099352157014522058098996385254903281545695887189603267201
(hex) 22807622531522543610094414106106772108649683164642972183286269214619099352157014522058098996385254903281

(dec) 23225624303976723017196220515917404099608854985718038196616317054667018854359591688735436052791332652478513355408150356108408
(hex) 23225624303976723017196220515917404099608854985718038196616317054667018854359591688735436052791332652478

(dec) 34629467806524663910488411411813679561429784816827345905892170553651646560885008408033429786692704516617255059441377587848727
(hex) 34629467806524663910488411411813679561429784816827345905892170553651646560885008408033429786692704516617

(dec) 34630614434901308852464200036192701310784464271605203972278835294765396501224597514208949899168821013783738303866386899875715
(hex) 34630614434901308852464200036192701310784464271605203972278835294765396501224597514208949899168821013783

(dec) 35047469578049837366880709740625417027160304672000058413742228775833471575947576436574766395836776928100142757473522419925248
(hex) 35047469578049837366880709740625417027160304672000058413742228775833471575947576436574766395836776928100

(dec) 46452459709903429153073283753038447777798210559040188704150600559955356774538872177279968790528754691766851932291804282034022
(hex) 46452459709903429153073283753038447777798210559040188704150600559955356774538872177279968790528754691766

(dec) 57856307408728032899122821481744958592677162176215705623596847999672634661589955685836313952596116104916212444885882411960598
(hex) 57856307408728032899122821481744958592677162176215705623596847999672634661589955685836313952596116104916

(dec) 58274309180311384671530417444881588845667623071694823539992371381096007813431725768328081725978996158096888392730430747803798
(hex) 58274309180311384671530417444881588845667623071694823539992371381096007813431725768328081725978996158096

(dec) 69678152925760181390564134659968588468637327084560080449901460622205042762612707757129557846642035594344508706235255466050372
(hex) 69678152925760181390564134659968588468637327084560080449901460622205042762612707757129557846642035594344

(dec) 69700094553935846709056452304209818063563632357808257330729205642171418398171600992212697023360366697360024549290701595702112
(hex) 69700094553935846709056452304209818063563632357808257330729205642171418398171600992212697023360366697360</pre>
<p>This is the comprehensive list of numbers satisfying condition #1 of the puzzle, #2 asks for one of these which are prime, so lets do a very simplistic prime test on these:</p>
<pre class="brush: python;">number_set=set(number_list)
not_prime_set=set()

import time
for n in number_set:
	t0=time.time()
	for x in range(2,n):
		if n%x ==0:
			not_prime_set.add(n)
			print(n,&quot;is not prime because it's divisble by&quot;,x)
			break
		if time.time()-t0&gt;100:
			print(n,&quot;may be prime, did not fine any factors within 100 seconds&quot;)
			break

print(&quot;the remaining numbers to check for primality are:&quot;, number_set - not_prime_set)</pre>
<p>outputs: </p>
<pre>0 is not prime because 0 isn't prime
57856307408728032899122821481744958592677162176215705623596847999672634661589955685836313952596116104916212444885882411960598 is not prime because it's divisble by 2
35047469578049837366880709740625417027160304672000058413742228775833471575947576436574766395836776928100142757473522419925248 is not prime because it's divisble by 2
46452459709903429153073283753038447777798210559040188704150600559955356774538872177279968790528754691766851932291804282034022 is not prime because it's divisble by 2
58274309180311384671530417444881588845667623071694823539992371381096007813431725768328081725978996158096888392730430747803798 is not prime because it's divisble by 2
23225624303976723017196220515917404099608854985718038196616317054667018854359591688735436052791332652478513355408150356108408 is not prime because it's divisble by 2
11382975651657610360011724373059527023679401235446000875434984276671144440904563609247580929003959820277226372565581487538807 is not prime because it's divisble by 3
69678152925760181390564134659968588468637327084560080449901460622205042762612707757129557846642035594344508706235255466050372 is not prime because it's divisble by 2
10965042548987794527084057351766268905929738560121836183995663823085815102408704908398080417506152437998396385865902388902296 is not prime because it's divisble by 2
11403774832697699927191683625580629545730840588452432470080875397274364900728637535263415299444961605674432192938509636490868 is not prime because it's divisble by 2
22807622531522543610094414106106772108649683164642972183286269214619099352157014522058098996385254903281545695887189603267201 may be prime, did not fine any factors within 100 seconds
34629467806524663910488411411813679561429784816827345905892170553651646560885008408033429786692704516617255059441377587848727 is not prime because it's divisble by 3
69700094553935846709056452304209818063563632357808257330729205642171418398171600992212697023360366697360024549290701595702112 is not prime because it's divisble by 2
22786823350482228205608199978099471169330070448099877920884203755897679528961138686897878221599372454029885357802030895546409 is not prime because it's divisble by 7
10964973879145266684597918386961206640359744239118799335560543882943204057285999161085137407678295834996206085978967677028758 is not prime because it's divisble by 2
34630614434901308852464200036192701310784464271605203972278835294765396501224597514208949899168821013783738303866386899875715 is not prime because it's divisble by 3
11383044321503994265174950355726300568630049590682850168652076962700460784689758874865273083169197842932705865806646564104498 is not prime because it's divisble by 2
the remaining numbers to check for primality are: {22807622531522543610094414106106772108649683164642972183286269214619099352157014522058098996385254903281545695887189603267201}</pre>
<pre>So the only number of these which could possibly be prime is:</pre>
<pre>22807622531522543610094414106106772108649683164642972183286269214619099352157014522058098996385254903281545695887189603267201 </pre>
<pre>I will save this non-trivial primality test for another time, but we can already say that if the puzzle has a solution, this is it.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=964</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Buying an LCD Display</title>
		<link>http://www.alternativerecursion.info/?p=971</link>
		<comments>http://www.alternativerecursion.info/?p=971#comments</comments>
		<pubDate>Sat, 24 Apr 2010 08:32:52 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=971</guid>
		<description><![CDATA[I decided I wanted a 24” display, so i did a little searching. I settled on the HP ZR24w, as it was an IPS panel with good colors and viewing angles (IPS panel), had very little input lag, could rotate for 16:10 or 10:16 use, and wasn’t ridiculously priced like most IPS panels. on HP’s [...]]]></description>
			<content:encoded><![CDATA[<p>I decided I wanted a 24” display, so i did a little searching.</p>
<p>I settled on the HP ZR24w, as it was an IPS panel with good colors and viewing angles (IPS panel), had very little input lag, could rotate for 16:10 or 10:16 use, and wasn’t ridiculously priced like most IPS panels.</p>
<p>on HP’s page they are boasting a lot of energy saving stuff like an 85% power supply.&#160; But forgive me for not really trusting their energy-efficient marketing, so I started comparing some LCD power consumption and found some striking differences.&#160; Take a look at the little table I constructed:</p>
<p> <iframe height="460" src="https://spreadsheets.google.com/pub?key=0AvzXy4FLASmsdFRTZ1FLOHhfVWx5d2RVSkktaVBUdnc&amp;hl=en&amp;single=true&amp;gid=0&amp;output=html&amp;widget=true" frameborder="0" width="100%"></iframe>
<p>&#160;</p>
<p>other sources:</p>
<p><a href="https://www.energystar.gov/index.cfm?fuseaction=find_a_product.showSearchResultsTable&amp;pgw_code=MO&amp;pd_code=MON&amp;sortParameter=watts_in_on&amp;letter=ALL&amp;diag_screen_size_min=24&amp;diag_screen_size_max=24&amp;startnum=1&amp;resultsperpage=84" target="_blank">energystar</a>, <a href="http://reviews.cnet.com/green-tech/monitor-comparison-chart/?tag=contentMain;contentAux" target="_blank">cnet</a>, <a href="http://images.apple.com/environment/reports/docs/LED-Cinema-Display-Environmental-Report.pdf" target="_blank">apple</a></p>
<p>&#160;</p>
<p>What a wide range of power consumption, even at the same brightness.&#160; There are no sanely-priced efficient IPS-panel 24-inch displays.&#160; On this data it seems LEDs use less energy (no surprise), but maybe IPS panels need more power than tn?&#160; I say that because the apple display is LED and IPS and still guzzles watts (oddly even more than the dell IPS ccfl display).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=971</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Factoring Algorithm puzzle</title>
		<link>http://www.alternativerecursion.info/?p=823</link>
		<comments>http://www.alternativerecursion.info/?p=823#comments</comments>
		<pubDate>Mon, 15 Mar 2010 23:55:08 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=823</guid>
		<description><![CDATA[What is the minimal number, X, of yes/no questions needed to find the smallest positive integer divisor (other than 1) of an integer between 2 and 166 (inclusive)? We are asking for the exact answer in two cases: In the worst case, i.e., what is the smallest number X for which we can guarantee finding [...]]]></description>
			<content:encoded><![CDATA[<p>What is the minimal number, X, of yes/no questions needed to find the smallest positive integer divisor (other than 1) of an integer between 2 and 166 (inclusive)?</p>
<p>We are asking for the exact answer in two cases:</p>
<ol>
<li>In the worst case, i.e., what is the smallest number X for which we can guarantee finding it in no more than X questions. </li>
<li>On average, i.e., assuming that the number was chosen in uniform distribution from 2 to 166 and we want to minimize the expected number of questions. </li>
</ol>
<p><a href="http://domino.watson.ibm.com/Comm/wwwr_ponder.nsf/challenges/November2009.html" target="_blank">This problem</a> was IBM’s Ponder This puzzle of November 2009.</p>
<p>I’m going to write my solution in English, along with code (both python and java) so anyone knowing any one of the 3 languages should be able to follow along.</p>
<p> <span id="more-823"></span>
<p>For both #1 and #2 there are some relevant thoughts:</p>
<p>the smallest integer dividers (above 1) of all integers (above 1) are prime, so the divisor we are looking for will be prime, specifically only a few prime numbers that will be relevant between 2 and 166 (inclusively):</p>
<p>to find out about these primes, I wrote a little code:</p>
<p>&#160;</p>
<p>Python (3.1)&#160; :</p>
<pre class="brush: python;">prime_list = []
maxx = 166
for n in range(2,maxx+1):
    isprime = True
    for p in prime_list:
        if n % p is 0;
            isprime = False;
            break;
    if isprime == True:
        prime_list.append(n)
print(&quot;the primes less than&quot;,maxx+1,&quot;are:&quot;)
print(prime_list)
print(&quot;there are &quot;, len(prime_list), &quot;of them&quot;)</pre>
<p>OR Java :</p>
<pre class="brush:java;">import java.util.ArrayList;
public class primes {
	public static ArrayList&lt;Integer&gt; prime_list = new ArrayList&lt;Integer&gt;();
	public static void main(String args[]){
		int maxx = 166;
		boolean isPrime;
		for(int n=2; n &lt;= maxx; n++){
			isPrime = true;
			for(int p : prime_list){
				if(n % p == 0){
					isPrime = false;
					break;
				}
			}
			if(isPrime){
				prime_list.add(n);
			}
		}
		System.out.println(&quot;the primes less than&quot;+ maxx+1+ &quot; are:&quot;);
		System.out.println(prime_list);
		System.out.println(&quot;there are &quot; + prime_list.size() + &quot; of them&quot;);
	}
}</pre>
<p>Both the Python and the Java version of the logic will output the following:</p>
<pre>the primes less than 167 are:
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163]
there are&#160; 38 of them</pre>
<p>these 38 primes are the only possible ‘smallest integer dividers’ which we are trying to determine with our questions. </p>
<p><strong>Worst Case (<font size="4">part #1 of the Puzzle</font>)&#160; seems like the easier problem to solve, so lets do it.</strong></p>
<blockquote>
<p><strong>In the worst case, i.e., what is the smallest number X for which we can guarantee finding it in no more than X questions.</strong> </p>
</blockquote>
<p>well there are 38 possible solutions, and we only care about worst case, so lets gather half of them and ask (<strong>Question 1</strong>) if the smallest integer divisor (&gt;1) is in that group.&#160; </p>
<p>if the answer is yes, then we have narrowed it down to 19, if the answer is 19 then we have narrowed it down to the other 19, either way we are left with 19.</p>
<p>&#160;</p>
<p>Now take that 19 and group roughly half of them together (10) and ask (<strong>Question 2</strong>) if the smallest integer divisor (&gt;1) is in that group.</p>
<p>if the answer is yes, then we have narrowed it down to 10, if the answer is no, then we have narrowed it down to 9.</p>
<p>&#160;</p>
<p>Now take that 10 (or 9) and group together about half (5) and ask (<strong>Question 3</strong>) if the smallest integer divisor (&gt;1) is in that group.</p>
<p>If the answer isyes, then we have narrowed it down to 5, otherwise we have also narrowed it down to 5 or 4 (depending if we had 10 or 9).</p>
<p>&#160;</p>
<p>Now take those 5 or 4 and take roughly half (2) and ask (<strong>Question 4</strong>) if the smallest integer divisor is one of the two.</p>
<p>If the answer is yes, then we have narrowed it down to 2, otherwise we have narrowed it down to 3 or 2 (depending if we had 5 or 4)</p>
<p>&#160;</p>
<p>Now take those 3 or 2 and take the first integer, and ask (<strong>Question 5</strong>) if that’s the greatest integer divisor (&gt;1).</p>
<p>If yes, then we are done, that’s the number, if not and we started with 2, we are also done (the other is the number), if we had 3 then we have to ask one more question.</p>
<p>&#160;</p>
<p>Take the 2 remaining and ask (<strong>Question 6</strong> (not always required)) if that’s the greatest integer divisor (&gt;1).</p>
<p>If yes, then we are done, that’s the number, if not then the other number is it.</p>
<p>&#160;</p>
<p>So this method has a worst case of 6, a best case of 5, what about the average case?</p>
<p>here’s the code so far in Python 3.1:</p>
<pre class="brush: python;">prime_list = []
maxx = 166
for n in range(2,maxx+1):
    isprime = True
    for p in prime_list:
        if n % p is 0;
            isprime = False;
            break;
    if isprime == True:
        prime_list.append(n)
print(&quot;the primes less than&quot;,maxx+1,&quot;are:&quot;)
print(prime_list)
print(&quot;there are &quot;, len(prime_list), &quot;of them&quot;)
def smallestPrimeFactor(n):
	for p in prime_list:
		if n/p == int(n/p):
			return p
question_history=[]
for n in range(2,maxx+1):
	prime_sublist = prime_list
	question_count=0
	while True:
		question_count+=1
		if smallestPrimeFactor(n) in prime_sublist[0:int(len(prime_sublist)/2)]:
			prime_sublist = prime_sublist[0:int(len(prime_sublist)/2)]
		else:
			prime_sublist = prime_sublist[int(len(prime_sublist)/2):]
		if len(prime_sublist)==1:
			print( &quot;number =&quot;, n, &quot; smallest factor (&gt;1) =&quot;, prime_sublist[0], &quot; questions asked =&quot;, question_count)
			question_history.append(question_count)
			break
print( &quot;worst case   =&quot;, max(question_history) )
print( &quot;best case    =&quot;, min(question_history) )
print( &quot;average case =&quot;, sum(question_history) / (maxx-1) )</pre>
<p>OR the program so far in Java:</p>
<pre class="brush: java;">import java.util.ArrayList;
import java.util.List;
public class primes {
	public static ArrayList&lt;Integer&gt; prime_list = new ArrayList&lt;Integer&gt;();
	public static void main(String args[]){
		int maxx = 166;
		boolean isPrime;
		for(int n=2; n &lt;= maxx; n++){
			isPrime = true;
			for(int p : prime_list){
				if(n % p == 0){
					isPrime = false;
					break;
				}
			}
			if(isPrime){
				prime_list.add(n);
			}
		}
		System.out.println(&quot;the primes less than 167 are:&quot;);
		System.out.println(prime_list);
		System.out.println(&quot;there are &quot; + prime_list.size() + &quot; of them&quot;);
		int max_questions = -1;
		int min_questions = -1;
		int questions_sum = 0;
		for(int n=2; n &lt;= maxx; n++){
			List&lt;Integer&gt; prime_sublist = prime_list;
			int question_count = 0;
			while(true){
				question_count++;
				if(prime_sublist.subList(0,prime_sublist.size()/2).contains(smallestPrimeFactor(n))){
					prime_sublist = prime_sublist.subList(0,prime_sublist.size()/2);
				}else{
					prime_sublist = prime_sublist.subList(prime_sublist.size()/2,prime_sublist.size());
				}
				if(prime_sublist.size() == 1){
					System.out.println(&quot;number = &quot; + n + &quot;  smallest factor (&gt;1) = &quot; + prime_sublist.get(0) + &quot;  questions asked = &quot; + question_count);
					if(question_count &gt; max_questions){
						max_questions = question_count;
					}
					if(question_count &lt; min_questions || min_questions == -1){
						min_questions = question_count;
					}
					questions_sum += question_count;
					break;
				}
			}
		}
		System.out.println(&quot;worst case   = &quot;+max_questions);
		System.out.println(&quot;best case    = &quot;+min_questions);
		System.out.println(&quot;average case = &quot;+(float) questions_sum/(maxx-1));
	}
	public static int smallestPrimeFactor(int n){
		for(int p: prime_list){
			if((n / p) == (float)n / p){
				return p;
			}
		}
		return 0;
	}
}</pre>
<p>The output for either of these programs is this:</p>
<pre>the primes less than 167 are:
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163]
there are 38 of them
number = 2  smallest factor (&gt;1) = 2  questions asked = 5
number = 3  smallest factor (&gt;1) = 3  questions asked = 5
number = 4  smallest factor (&gt;1) = 2  questions asked = 5
number = 5  smallest factor (&gt;1) = 5  questions asked = 5
number = 6  smallest factor (&gt;1) = 2  questions asked = 5
number = 7  smallest factor (&gt;1) = 7  questions asked = 5
number = 8  smallest factor (&gt;1) = 2  questions asked = 5
number = 9  smallest factor (&gt;1) = 3  questions asked = 5
number = 10  smallest factor (&gt;1) = 2  questions asked = 5
number = 11  smallest factor (&gt;1) = 11  questions asked = 5
number = 12  smallest factor (&gt;1) = 2  questions asked = 5
number = 13  smallest factor (&gt;1) = 13  questions asked = 5
number = 14  smallest factor (&gt;1) = 2  questions asked = 5
number = 15  smallest factor (&gt;1) = 3  questions asked = 5
number = 16  smallest factor (&gt;1) = 2  questions asked = 5
number = 17  smallest factor (&gt;1) = 17  questions asked = 5
number = 18  smallest factor (&gt;1) = 2  questions asked = 5
number = 19  smallest factor (&gt;1) = 19  questions asked = 6
number = 20  smallest factor (&gt;1) = 2  questions asked = 5
number = 21  smallest factor (&gt;1) = 3  questions asked = 5
number = 22  smallest factor (&gt;1) = 2  questions asked = 5
number = 23  smallest factor (&gt;1) = 23  questions asked = 6
number = 24  smallest factor (&gt;1) = 2  questions asked = 5
number = 25  smallest factor (&gt;1) = 5  questions asked = 5
number = 26  smallest factor (&gt;1) = 2  questions asked = 5
number = 27  smallest factor (&gt;1) = 3  questions asked = 5
number = 28  smallest factor (&gt;1) = 2  questions asked = 5
number = 29  smallest factor (&gt;1) = 29  questions asked = 5
number = 30  smallest factor (&gt;1) = 2  questions asked = 5
number = 31  smallest factor (&gt;1) = 31  questions asked = 5
number = 32  smallest factor (&gt;1) = 2  questions asked = 5
number = 33  smallest factor (&gt;1) = 3  questions asked = 5
number = 34  smallest factor (&gt;1) = 2  questions asked = 5
number = 35  smallest factor (&gt;1) = 5  questions asked = 5
number = 36  smallest factor (&gt;1) = 2  questions asked = 5
number = 37  smallest factor (&gt;1) = 37  questions asked = 5
number = 38  smallest factor (&gt;1) = 2  questions asked = 5
number = 39  smallest factor (&gt;1) = 3  questions asked = 5
number = 40  smallest factor (&gt;1) = 2  questions asked = 5
number = 41  smallest factor (&gt;1) = 41  questions asked = 6
number = 42  smallest factor (&gt;1) = 2  questions asked = 5
number = 43  smallest factor (&gt;1) = 43  questions asked = 6
number = 44  smallest factor (&gt;1) = 2  questions asked = 5
number = 45  smallest factor (&gt;1) = 3  questions asked = 5
number = 46  smallest factor (&gt;1) = 2  questions asked = 5
number = 47  smallest factor (&gt;1) = 47  questions asked = 5
number = 48  smallest factor (&gt;1) = 2  questions asked = 5
number = 49  smallest factor (&gt;1) = 7  questions asked = 5
number = 50  smallest factor (&gt;1) = 2  questions asked = 5
number = 51  smallest factor (&gt;1) = 3  questions asked = 5
number = 52  smallest factor (&gt;1) = 2  questions asked = 5
number = 53  smallest factor (&gt;1) = 53  questions asked = 5
number = 54  smallest factor (&gt;1) = 2  questions asked = 5
number = 55  smallest factor (&gt;1) = 5  questions asked = 5
number = 56  smallest factor (&gt;1) = 2  questions asked = 5
number = 57  smallest factor (&gt;1) = 3  questions asked = 5
number = 58  smallest factor (&gt;1) = 2  questions asked = 5
number = 59  smallest factor (&gt;1) = 59  questions asked = 5
number = 60  smallest factor (&gt;1) = 2  questions asked = 5
number = 61  smallest factor (&gt;1) = 61  questions asked = 6
number = 62  smallest factor (&gt;1) = 2  questions asked = 5
number = 63  smallest factor (&gt;1) = 3  questions asked = 5
number = 64  smallest factor (&gt;1) = 2  questions asked = 5
number = 65  smallest factor (&gt;1) = 5  questions asked = 5
number = 66  smallest factor (&gt;1) = 2  questions asked = 5
number = 67  smallest factor (&gt;1) = 67  questions asked = 6
number = 68  smallest factor (&gt;1) = 2  questions asked = 5
number = 69  smallest factor (&gt;1) = 3  questions asked = 5
number = 70  smallest factor (&gt;1) = 2  questions asked = 5
number = 71  smallest factor (&gt;1) = 71  questions asked = 5
number = 72  smallest factor (&gt;1) = 2  questions asked = 5
number = 73  smallest factor (&gt;1) = 73  questions asked = 5
number = 74  smallest factor (&gt;1) = 2  questions asked = 5
number = 75  smallest factor (&gt;1) = 3  questions asked = 5
number = 76  smallest factor (&gt;1) = 2  questions asked = 5
number = 77  smallest factor (&gt;1) = 7  questions asked = 5
number = 78  smallest factor (&gt;1) = 2  questions asked = 5
number = 79  smallest factor (&gt;1) = 79  questions asked = 5
number = 80  smallest factor (&gt;1) = 2  questions asked = 5
number = 81  smallest factor (&gt;1) = 3  questions asked = 5
number = 82  smallest factor (&gt;1) = 2  questions asked = 5
number = 83  smallest factor (&gt;1) = 83  questions asked = 5
number = 84  smallest factor (&gt;1) = 2  questions asked = 5
number = 85  smallest factor (&gt;1) = 5  questions asked = 5
number = 86  smallest factor (&gt;1) = 2  questions asked = 5
number = 87  smallest factor (&gt;1) = 3  questions asked = 5
number = 88  smallest factor (&gt;1) = 2  questions asked = 5
number = 89  smallest factor (&gt;1) = 89  questions asked = 5
number = 90  smallest factor (&gt;1) = 2  questions asked = 5
number = 91  smallest factor (&gt;1) = 7  questions asked = 5
number = 92  smallest factor (&gt;1) = 2  questions asked = 5
number = 93  smallest factor (&gt;1) = 3  questions asked = 5
number = 94  smallest factor (&gt;1) = 2  questions asked = 5
number = 95  smallest factor (&gt;1) = 5  questions asked = 5
number = 96  smallest factor (&gt;1) = 2  questions asked = 5
number = 97  smallest factor (&gt;1) = 97  questions asked = 5
number = 98  smallest factor (&gt;1) = 2  questions asked = 5
number = 99  smallest factor (&gt;1) = 3  questions asked = 5
number = 100  smallest factor (&gt;1) = 2  questions asked = 5
number = 101  smallest factor (&gt;1) = 101  questions asked = 5
number = 102  smallest factor (&gt;1) = 2  questions asked = 5
number = 103  smallest factor (&gt;1) = 103  questions asked = 6
number = 104  smallest factor (&gt;1) = 2  questions asked = 5
number = 105  smallest factor (&gt;1) = 3  questions asked = 5
number = 106  smallest factor (&gt;1) = 2  questions asked = 5
number = 107  smallest factor (&gt;1) = 107  questions asked = 6
number = 108  smallest factor (&gt;1) = 2  questions asked = 5
number = 109  smallest factor (&gt;1) = 109  questions asked = 5
number = 110  smallest factor (&gt;1) = 2  questions asked = 5
number = 111  smallest factor (&gt;1) = 3  questions asked = 5
number = 112  smallest factor (&gt;1) = 2  questions asked = 5
number = 113  smallest factor (&gt;1) = 113  questions asked = 5
number = 114  smallest factor (&gt;1) = 2  questions asked = 5
number = 115  smallest factor (&gt;1) = 5  questions asked = 5
number = 116  smallest factor (&gt;1) = 2  questions asked = 5
number = 117  smallest factor (&gt;1) = 3  questions asked = 5
number = 118  smallest factor (&gt;1) = 2  questions asked = 5
number = 119  smallest factor (&gt;1) = 7  questions asked = 5
number = 120  smallest factor (&gt;1) = 2  questions asked = 5
number = 121  smallest factor (&gt;1) = 11  questions asked = 5
number = 122  smallest factor (&gt;1) = 2  questions asked = 5
number = 123  smallest factor (&gt;1) = 3  questions asked = 5
number = 124  smallest factor (&gt;1) = 2  questions asked = 5
number = 125  smallest factor (&gt;1) = 5  questions asked = 5
number = 126  smallest factor (&gt;1) = 2  questions asked = 5
number = 127  smallest factor (&gt;1) = 127  questions asked = 5
number = 128  smallest factor (&gt;1) = 2  questions asked = 5
number = 129  smallest factor (&gt;1) = 3  questions asked = 5
number = 130  smallest factor (&gt;1) = 2  questions asked = 5
number = 131  smallest factor (&gt;1) = 131  questions asked = 6
number = 132  smallest factor (&gt;1) = 2  questions asked = 5
number = 133  smallest factor (&gt;1) = 7  questions asked = 5
number = 134  smallest factor (&gt;1) = 2  questions asked = 5
number = 135  smallest factor (&gt;1) = 3  questions asked = 5
number = 136  smallest factor (&gt;1) = 2  questions asked = 5
number = 137  smallest factor (&gt;1) = 137  questions asked = 6
number = 138  smallest factor (&gt;1) = 2  questions asked = 5
number = 139  smallest factor (&gt;1) = 139  questions asked = 5
number = 140  smallest factor (&gt;1) = 2  questions asked = 5
number = 141  smallest factor (&gt;1) = 3  questions asked = 5
number = 142  smallest factor (&gt;1) = 2  questions asked = 5
number = 143  smallest factor (&gt;1) = 11  questions asked = 5
number = 144  smallest factor (&gt;1) = 2  questions asked = 5
number = 145  smallest factor (&gt;1) = 5  questions asked = 5
number = 146  smallest factor (&gt;1) = 2  questions asked = 5
number = 147  smallest factor (&gt;1) = 3  questions asked = 5
number = 148  smallest factor (&gt;1) = 2  questions asked = 5
number = 149  smallest factor (&gt;1) = 149  questions asked = 5
number = 150  smallest factor (&gt;1) = 2  questions asked = 5
number = 151  smallest factor (&gt;1) = 151  questions asked = 5
number = 152  smallest factor (&gt;1) = 2  questions asked = 5
number = 153  smallest factor (&gt;1) = 3  questions asked = 5
number = 154  smallest factor (&gt;1) = 2  questions asked = 5
number = 155  smallest factor (&gt;1) = 5  questions asked = 5
number = 156  smallest factor (&gt;1) = 2  questions asked = 5
number = 157  smallest factor (&gt;1) = 157  questions asked = 6
number = 158  smallest factor (&gt;1) = 2  questions asked = 5
number = 159  smallest factor (&gt;1) = 3  questions asked = 5
number = 160  smallest factor (&gt;1) = 2  questions asked = 5
number = 161  smallest factor (&gt;1) = 7  questions asked = 5
number = 162  smallest factor (&gt;1) = 2  questions asked = 5
number = 163  smallest factor (&gt;1) = 163  questions asked = 6
number = 164  smallest factor (&gt;1) = 2  questions asked = 5
number = 165  smallest factor (&gt;1) = 3  questions asked = 5
number = 166  smallest factor (&gt;1) = 2  questions asked = 5
worst case   = 6
best case    = 5
average case = 5.072727</pre>
<p>&#160;</p>
<p>So for this algorithm (let’s call it the worst-case algorithm), we found the possible solution set of 38 primes, then we divided it in half and asked which half iteratively until we were had a set of 1, and that’s the solution.</p>
<p>This is an intuitive way to have the best worst-case in terms of number of questions.</p>
<p>Dividing the set in half for each question is the most amount of progress we can make, getting rid of half the dataset each question.</p>
<p>And that’s the goal, getting to the solution in the least amount of questions in the worst case…</p>
<p><strong><font size="4">Puzzle part 2:</font> </strong></p>
<blockquote>
<p><strong>On average, i.e., assuming that the number was chosen in uniform distribution from 2 to 166 and we want to minimize the expected number of questions.</strong> </p>
</blockquote>
<p>In the average case, our worst-case method is not very productive, look at the first question:</p>
<blockquote>
<p>well there are 38 possible solutions, and we only care about worst case, so lets gather half of them and ask (<strong>Question 1</strong>) if the smallest integer divisor (&gt;1) is in that group.&#160; </p>
</blockquote>
<p>so dividing the set in two we have [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67] and [71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163] </p>
<p>but since 2 is the solution more than half the time, and 3 being the 2nd most likely, you can see that we really aren’t asking a 50/50 question.&#160; In this case we are asking a 146/19 question, in the average case we aren’t really making a lot of progress with that.</p>
<p>Le&#8217;t’s figure out the probabilty of the relevant primes in this dataset:</p>
<p>Python 3.1:</p>
<pre class="brush:python;">prime_count={p:0 for p in prime_list}
for n in range(2,maxx+1):
	prime_count[smallestPrimeFactor(n)]+=1
n=0
for p in prime_list:
	n+=1
	print(&quot;prime#&quot;,n,&quot;prime =&quot;,p,&quot; # of times it is the solution =&quot;, prime_count[p])</pre>
<p>OR in java: </p>
<pre class="brush:java;">Hashtable&lt;Integer,Integer&gt; prime_count = new Hashtable&lt;Integer,Integer&gt;();
for(int p:prime_list){
	prime_count.put(p,0);
}
for(int n=2;n&lt;= maxx;n++){
	prime_count.put(smallestPrimeFactor(n),prime_count.get(smallestPrimeFactor(n))+1);
}
int n = 0;
for(int p: prime_list){
	n++;
	System.out.println(&quot;prime#&quot; + n + &quot; prime = &quot; + p + &quot; # of times it is the solution = &quot; + prime_count.get(p));
}</pre>
<p>Both programs output this: </p>
<pre>prime#01 prime = 2    # of times it is the solution = 83
prime#02 prime = 3    # of times it is the solution = 28
prime#03 prime = 5    # of times it is the solution = 11
prime#04 prime = 7    # of times it is the solution = 7
prime#05 prime = 11   # of times it is the solution = 3
prime#06 prime = 13   # of times it is the solution = 1
prime#07 prime = 17   # of times it is the solution = 1
prime#08 prime = 19   # of times it is the solution = 1
prime#09 prime = 23   # of times it is the solution = 1
prime#10 prime = 29   # of times it is the solution = 1
prime#11 prime = 31   # of times it is the solution = 1
prime#12 prime = 37   # of times it is the solution = 1
prime#13 prime = 41   # of times it is the solution = 1
prime#14 prime = 43   # of times it is the solution = 1
prime#15 prime = 47   # of times it is the solution = 1
prime#16 prime = 53   # of times it is the solution = 1
prime#17 prime = 59   # of times it is the solution = 1
prime#18 prime = 61   # of times it is the solution = 1
prime#19 prime = 67   # of times it is the solution = 1
prime#20 prime = 71   # of times it is the solution = 1
prime#21 prime = 73   # of times it is the solution = 1
prime#22 prime = 79   # of times it is the solution = 1
prime#23 prime = 83   # of times it is the solution = 1
prime#24 prime = 89   # of times it is the solution = 1
prime#25 prime = 97   # of times it is the solution = 1
prime#26 prime = 101  # of times it is the solution = 1
prime#27 prime = 103  # of times it is the solution = 1
prime#28 prime = 107  # of times it is the solution = 1
prime#29 prime = 109  # of times it is the solution = 1
prime#30 prime = 113  # of times it is the solution = 1
prime#31 prime = 127  # of times it is the solution = 1
prime#32 prime = 131  # of times it is the solution = 1
prime#33 prime = 137  # of times it is the solution = 1
prime#34 prime = 139  # of times it is the solution = 1
prime#35 prime = 149  # of times it is the solution = 1
prime#36 prime = 151  # of times it is the solution = 1
prime#37 prime = 157  # of times it is the solution = 1
prime#38 prime = 163  # of times it is the solution = 1</pre>
<p><strong>To develop the best average-case algorithm we need to evenly divide the solution set in 2 for each question, but not even in the number of primes in each set, but even in probability.</strong>&#160; We will try to get the sum of the number of times the prime is a solution to be the same in each half.&#160; Effectively choosing the division so that the question will be a 50/50 question.</p>
<p>&#160;</p>
<p><strong>Question 1</strong> is easy (since 2 is the solution to just over half the numbers):</p>
<p>the set will be split into [2] and [ 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163] </p>
<p>this is a 83/82 question, nearly 50/50…</p>
<p>there is probability = 83/165 that the answer to this question will pinpoint the solution at 2.</p>
<p>&#160;</p>
<p><strong>Question 2</strong> (if necessary): We now must divide the remaining into two nearly* equally probable sets: </p>
<p>so we can split the remaining up into sets like this:</p>
<p>[3,5,7] vs [11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163]</p>
<p>with weightings 28+11+7 vs 3+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1</p>
<p>so that&#8217;s 46 vs. 36</p>
<p>It’s very important to note that you can get more balanced groupings, for example grouping 3 (with occurrence score of 28) with 13 of the larger primes (each with 1 occurrence), yielding 42 vs. 42…</p>
<p>The problem with that is you will have a group with a 28 and 13 1’s, so the next matchup if that group is selected will be very imbalanced.</p>
<p>Since we cannot divide up the probability beyond per prime, we should need to consider these cases and not go for perfectly half every time, but instead find the best division for all the possible subsets that will be dealt with in later questions, that will give us the best average case.&#160; This is a very significant and interesting puzzle in itself, It’s almost a shame that a little luck and a naive approach to this can still yield the optimal solution for this dataset, but in a different dataset, this problem could not be glossed over.</p>
<p>Here is the algorithm to optimally construct the tree, with the English description following…</p>
<p>&#160;</p>
<p>Python: </p>
<pre class="brush:python;">keys = []
values = []
for p in sorted(prime_count):
	keys.append([p])
	values.append(prime_count[p])
print(keys)
print(values
while len(keys) &gt; 2:
	min1_value = min(values)
	min1_index = values.index(min1_value)
	min1_key = keys[min1_index]
	del values[min1_index]
	del keys[min1_index]
	min2_value=min(values)
	min2_index = values.index(min2_value)
	min2_key = keys[min2_index]
	del keys[min2_index]
	del values[min2_index]
	keys.append(min1_key + min2_key)
	values.append(min1_value + min2_value)
	print()
	print(keys)
	print(values)</pre>
<p>OR Java:</p>
<pre class="brush:java;">for(int p:prime_list){
	HashSet&lt;Integer&gt; temp = new HashSet&lt;Integer&gt;();
	temp.add(p);
	keys.add(temp);
	values.add(prime_count.get(p));
}
ArrayList&lt;HashSet&lt;Integer&gt;&gt; in_sets = new ArrayList&lt;HashSet&lt;Integer&gt;&gt;();
ArrayList&lt;HashSet&lt;Integer&gt;&gt; out_sets = new ArrayList&lt;HashSet&lt;Integer&gt;&gt;();
while(keys.size()&gt;1){
	int tmp_index = 0;
	int min1_v = 0;
	int min2_v = 0;
	int min1_i = 0;
	int min2_i = 0;
	HashSet&lt;Integer&gt; min1_k = new HashSet&lt;Integer&gt;();
	HashSet&lt;Integer&gt; min2_k = new HashSet&lt;Integer&gt;();
	HashSet&lt;Integer&gt; min_union_k = new HashSet&lt;Integer&gt;();
	for(int v:values){
		if(tmp_index == 0 | v &lt; min1_v){
			min2_v = min1_v;
			min2_k = min1_k;
			min2_i = min1_i;
			min1_v = v;
			min1_k = keys.get(tmp_index);
			min1_i = tmp_index;
		}else if(v &lt; min2_v | tmp_index == 1){
			min2_v = v;
			min2_k = keys.get(tmp_index);
			min2_i = tmp_index;
		}
		tmp_index++;
	}
	min_union_k.addAll(min1_k);
	min_union_k.addAll(min2_k);
	values.remove(Math.max(min1_i, min2_i));
	values.remove(Math.min(min1_i, min2_i));
	keys.remove(Math.max(min1_i, min2_i));
	keys.remove(Math.min(min1_i, min2_i));
	values.add(min1_v+min2_v);
	keys.add(min_union_k);
	System.out.println();
	System.out.println(keys);
	System.out.println(values);
}</pre>
<p>&#160;</p>
<p>This code will incrementally merge the two smallest (in frequency score) sets of primes together, until there is just 2 sets,&#160; keeping a record of this will provide us with an answer-key to how to optimally partition the possible primes when we want to ask a question to narrow down our options.</p>
<p>Here is the output, it starts with all the primes, each in their own set, and below each list is the corresponding frequency scores for each set, when two of the least-valued primes are merged, their scores are summed:</p>
<pre>[[2], [3], [5], [7], [11], [13], [17], [19], [23], [29], [31], [37], [41], [43], [47], [53], [59], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

[[2], [3], [5], [7], [11], [19], [23], [29], [31], [37], [41], [43], [47], [53], [59], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2]

[[2], [3], [5], [7], [11], [29], [31], [37], [41], [43], [47], [53], [59], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2]

[[2], [3], [5], [7], [11], [37], [41], [43], [47], [53], [59], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2]

[[2], [3], [5], [7], [11], [43], [47], [53], [59], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [53], [59], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [61], [67], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [71], [73], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [79], [83], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [89], [97], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [101], [103], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [107], [109], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [113], [127], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [131], [137], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [139], [149], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137]]
[83, 28, 11, 7, 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [151], [157], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149]]
[83, 28, 11, 7, 3, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [163], [13, 17], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157]]
[83, 28, 11, 7, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

[[2], [3], [5], [7], [11], [19, 23], [29, 31], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157], [163, 13, 17]]
[83, 28, 11, 7, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3]

[[2], [3], [5], [7], [11], [37, 41], [43, 47], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157], [163, 13, 17], [19, 23, 29, 31]]
[83, 28, 11, 7, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4]

[[2], [3], [5], [7], [11], [53, 59], [61, 67], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47]]
[83, 28, 11, 7, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4]

[[2], [3], [5], [7], [11], [71, 73], [79, 83], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47], [53, 59, 61, 67]]
[83, 28, 11, 7, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4]

[[2], [3], [5], [7], [11], [89, 97], [101, 103], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47], [53, 59, 61, 67], [71, 73, 79, 83]]
[83, 28, 11, 7, 3, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4]

[[2], [3], [5], [7], [11], [107, 109], [113, 127], [131, 137], [139, 149], [151, 157], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47], [53, 59, 61, 67], [71, 73, 79, 83], [89, 97, 101, 103]]
[83, 28, 11, 7, 3, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4]

[[2], [3], [5], [7], [11], [131, 137], [139, 149], [151, 157], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47], [53, 59, 61, 67], [71, 73, 79, 83], [89, 97, 101, 103], [107, 109, 113, 127]]
[83, 28, 11, 7, 3, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4]

[[2], [3], [5], [7], [11], [151, 157], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47], [53, 59, 61, 67], [71, 73, 79, 83], [89, 97, 101, 103], [107, 109, 113, 127], [131, 137, 139, 149]]
[83, 28, 11, 7, 3, 2, 3, 4, 4, 4, 4, 4, 4, 4]

[[2], [3], [5], [7], [163, 13, 17], [19, 23, 29, 31], [37, 41, 43, 47], [53, 59, 61, 67], [71, 73, 79, 83], [89, 97, 101, 103], [107, 109, 113, 127], [131, 137, 139, 149], [151, 157, 11]]
[83, 28, 11, 7, 3, 4, 4, 4, 4, 4, 4, 4, 5]

[[2], [3], [5], [7], [37, 41, 43, 47], [53, 59, 61, 67], [71, 73, 79, 83], [89, 97, 101, 103], [107, 109, 113, 127], [131, 137, 139, 149], [151, 157, 11], [163, 13, 17, 19, 23, 29, 31]]
[83, 28, 11, 7, 4, 4, 4, 4, 4, 4, 5, 7]

[[2], [3], [5], [7], [71, 73, 79, 83], [89, 97, 101, 103], [107, 109, 113, 127], [131, 137, 139, 149], [151, 157, 11], [163, 13, 17, 19, 23, 29, 31], [37, 41, 43, 47, 53, 59, 61, 67]]
[83, 28, 11, 7, 4, 4, 4, 4, 5, 7, 8]

[[2], [3], [5], [7], [107, 109, 113, 127], [131, 137, 139, 149], [151, 157, 11], [163, 13, 17, 19, 23, 29, 31], [37, 41, 43, 47, 53, 59, 61, 67], [71, 73, 79, 83, 89, 97, 101, 103]]
[83, 28, 11, 7, 4, 4, 5, 7, 8, 8]

[[2], [3], [5], [7], [151, 157, 11], [163, 13, 17, 19, 23, 29, 31], [37, 41, 43, 47, 53, 59, 61, 67], [71, 73, 79, 83, 89, 97, 101, 103], [107, 109, 113, 127, 131, 137, 139, 149]]
[83, 28, 11, 7, 5, 7, 8, 8, 8]

[[2], [3], [5], [163, 13, 17, 19, 23, 29, 31], [37, 41, 43, 47, 53, 59, 61, 67], [71, 73, 79, 83, 89, 97, 101, 103], [107, 109, 113, 127, 131, 137, 139, 149], [151, 157, 11, 7]]
[83, 28, 11, 7, 8, 8, 8, 12]

[[2], [3], [5], [71, 73, 79, 83, 89, 97, 101, 103], [107, 109, 113, 127, 131, 137, 139, 149], [151, 157, 11, 7], [163, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67]]
[83, 28, 11, 8, 8, 12, 15]

[[2], [3], [5], [151, 157, 11, 7], [163, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67], [71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149]]
[83, 28, 11, 12, 15, 16]

[[2], [3], [163, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67], [71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149], [5, 151, 157, 11, 7]]
[83, 28, 15, 16, 23]

[[2], [3], [5, 151, 157, 11, 7], [163, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149]]
[83, 28, 23, 31]

[[2], [163, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149], [5, 151, 157, 11, 7, 3]]
[83, 31, 51]

[[2], [163, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 5, 151, 157, 11, 7, 3]]
[83, 82]</pre>
<p>The ouptut shows the algorithm in action, essentially building the partition tree from the ground, in each pair of lists, the first is a list of groups of primes, the 2nd is the corresponding frequency value of each group.&#160; The final code will record each merging, each step, as a guide to how to partition any remaining group.&#160; It will map out the partition tree of the possible solutions in a fashion that is the optimal in average-case. </p>
<p><strong>Question 3+</strong></p>
<p>so we simply move the partition from left to right (in the ordered list of remaining possible least prime factors) until the left group has equal to or greater than half the total occurrences as solutions to the 165 numbers.</p>
<p>Here is the complete code implementing this average-case algorithm and applying it to each number over the range of this problem, computing average-case performance in the process. </p>
<p>The complete program in Python 3.1:</p>
<pre class="brush:python;">import time
t0=time.time()
prime_list = []
maxx = 166
for n in range(2, maxx+1):
    isprime = True
    for p in prime_list:
        if n % p is 0:
            isprime = False
            break
    if isprime == True:
        prime_list.append(n)
def smallestPrimeFactor(n):
	for p in prime_list:
		if n % p == 0:
			return p
prime_count={p : 0 for p in prime_list}
for n in range(2, maxx + 1):
	prime_count[smallestPrimeFactor(n)] += 1
keys = []
values = []
in_sets = []
out_sets = []
for p in sorted(prime_count):
	keys.append([p])
	values.append(prime_count[p])
while len(keys) &gt; 1:
	min1_value = min(values)
	min1_index = values.index(min1_value)
	min1_key = keys[min1_index]
	del values[min1_index]
	del keys[min1_index]
	min2_value = min(values)
	min2_index = values.index(min2_value)
	min2_key = keys[min2_index]
	del keys[min2_index]
	del values[min2_index]
	in_sets.append(set(min1_key + min2_key))
	out_sets.append(set(min1_key))
	keys.append(min1_key + min2_key)
	values.append(min1_value + min2_value)
#now that we have a partition answer-key (mapping of in_sets to out_sets)
#let's increment through the entire range of integers and compute the algorithm's performance
print(&quot;done with partition answer-key, time elapsed =&quot;, int(1000*(time.time()-t0)), &quot;ms&quot;)
question_history = []
for n in range(2, maxx + 1):
	prime_subset = set(prime_list)
	question_count = 0
	while True:
		question_count += 1
		checkset = out_sets[in_sets.index(prime_subset)]
		if smallestPrimeFactor(n) in checkset:
			prime_subset = checkset
		else:
			prime_subset = prime_subset-checkset
		if len(prime_subset) == 1:
			print( &quot;number =&quot;, n, &quot; smallest factor (&gt;1) =&quot;, list(prime_subset)[0], &quot; questions asked =&quot;, question_count)
			question_history.append(question_count)
			break
print( &quot;worst case   =&quot;, max(question_history), &quot;questions&quot; )
print( &quot;best case    =&quot;, min(question_history), &quot;questoins&quot; )
print( &quot;average case =&quot;, sum(question_history), &quot;/&quot;, (maxx-1), &quot;~=&quot;,sum(question_history)/(maxx-1), &quot;questions&quot; )
print( &quot;time elapsed =&quot;, int((time.time() - t0)*1000),&quot;ms&quot;)</pre>
<p>Alternatively, the complete Java program:</p>
<pre class="brush:java;">import java.util.*;
import java.lang.Math;
public class primes {
	public static ArrayList&lt;Integer&gt; prime_list = new ArrayList&lt;Integer&gt;();
	public static void main(String args[]){
		Long t0 = System.currentTimeMillis();
		int maxx = 166;
		boolean isPrime;
		for(int n=2; n &lt;= maxx; n++){
			isPrime = true;
			for(int p : prime_list){
				if(n % p == 0){
					isPrime = false;
					break;
				}
			}
			if(isPrime){
				prime_list.add(n);
			}
		}
		Hashtable&lt;Integer,Integer&gt; prime_count = new Hashtable&lt;Integer,Integer&gt;();
		ArrayList&lt;Integer&gt; values = new ArrayList&lt;Integer&gt;();
		ArrayList&lt;HashSet&lt;Integer&gt;&gt; keys = new ArrayList&lt;HashSet&lt;Integer&gt;&gt;();
		HashSet&lt;Integer&gt; prime_set = new HashSet&lt;Integer&gt;();
		for(int p:prime_list){
			prime_count.put(p,0);
			prime_set.add(p);
		}
		for(int n=2; n &lt;= maxx; n++){
			prime_count.put(smallestPrimeFactor(n),prime_count.get(smallestPrimeFactor(n))+1);
		}
		for(int p:prime_list){
			HashSet&lt;Integer&gt; temp = new HashSet&lt;Integer&gt;();
			temp.add(p);
			keys.add(temp);
			values.add(prime_count.get(p));
		}
		ArrayList&lt;HashSet&lt;Integer&gt;&gt; in_sets = new ArrayList&lt;HashSet&lt;Integer&gt;&gt;();
		ArrayList&lt;HashSet&lt;Integer&gt;&gt; out_sets = new ArrayList&lt;HashSet&lt;Integer&gt;&gt;();
		while(keys.size()&gt;1){
			int tmp_index = 0;
			int min1_v = 0;
			int min2_v = 0;
			int min1_i = 0;
			int min2_i = 0;
			HashSet&lt;Integer&gt; min1_k = new HashSet&lt;Integer&gt;();
			HashSet&lt;Integer&gt; min2_k = new HashSet&lt;Integer&gt;();
			HashSet&lt;Integer&gt; min_union_k = new HashSet&lt;Integer&gt;();
			for(int v:values){
				if(tmp_index == 0 | v &lt; min1_v){
					min2_v = min1_v;
					min2_k = min1_k;
					min2_i = min1_i;
					min1_v = v;
					min1_k = keys.get(tmp_index);
					min1_i = tmp_index;
				}else if(v &lt; min2_v | tmp_index == 1){
					min2_v = v;
					min2_k = keys.get(tmp_index);
					min2_i = tmp_index;
				}
				tmp_index++;
			}
			min_union_k.addAll(min1_k);
			min_union_k.addAll(min2_k);
			in_sets.add(min_union_k);
			out_sets.add(min2_k);
			values.remove(Math.max(min1_i, min2_i));
			values.remove(Math.min(min1_i, min2_i));
			keys.remove(Math.max(min1_i, min2_i));
			keys.remove(Math.min(min1_i, min2_i));
			values.add(min1_v+min2_v);
			keys.add(min_union_k);
		}
		//now that we have a partition answer-key (mapping of in_sets to out_sets)
		//let's increment through the entire range of integers and compute the algorithm's performance
		System.out.println(&quot;done with partition answer-key, time elapsed = &quot; + (System.currentTimeMillis()-t0) + &quot; ms&quot;);
		int max_questions = -1;
		int min_questions = -1;
		int questions_sum = 0;
		for(int n=2; n &lt;= maxx; n++){
			HashSet&lt;Integer&gt; prime_subset = new HashSet&lt;Integer&gt;();
			prime_subset.addAll(prime_set);
			int question_count = 0;
			int index = -1;
			while(true){
				question_count++;
				index = in_sets.indexOf(prime_subset);
				if( out_sets.get(index).contains(smallestPrimeFactor(n))){
					prime_subset.clear();
					prime_subset.addAll(out_sets.get(index));
				}else{
					prime_subset.removeAll(out_sets.get(index));
				}
				if(prime_subset.size() == 1){
					System.out.println(&quot;number = &quot; + n + &quot;  smallest factor (&gt;1) = &quot; + prime_subset.toArray()[0] + &quot;  questions asked = &quot; + question_count);
					if(question_count &gt; max_questions){
						max_questions = question_count;
					}
					if(question_count &lt; min_questions || min_questions == -1){
						min_questions = question_count;
					}
					questions_sum += question_count;
					break;
				}
			}
		}
		System.out.println(&quot;worst case   = &quot; + max_questions + &quot; questions&quot;);
		System.out.println(&quot;best case    = &quot; + min_questions + &quot; questions&quot;);
		System.out.println(&quot;average case = &quot; + questions_sum + &quot; / &quot; + (maxx-1) + &quot; ~= &quot; + (float) questions_sum/(maxx-1) + &quot; questions&quot;);
		System.out.println(&quot;time elapsed = &quot; + (System.currentTimeMillis()-t0) + &quot; ms&quot;);
	}
	public static int smallestPrimeFactor(int n){
		for(int p: prime_list){
			if(n % p == 0 ){
				return p;
			}
		}
		return 0;
	}
}</pre>
<p>The code could be optimized for speed (particularly when obtaining the index in the partition list (in_sets) to use on out_sets, currently it’s dumb, but could be improved with some sort of hash-map).&#160; With 166 integers, speed of execution was not an issue.</p>
<p>Both output:</p>
<pre>done with partition answer-key, time elapsed = 0 ms
number = 2  smallest factor (&gt;1) = 2  questions asked = 1
number = 3  smallest factor (&gt;1) = 3  questions asked = 3
number = 4  smallest factor (&gt;1) = 2  questions asked = 1
number = 5  smallest factor (&gt;1) = 5  questions asked = 4
number = 6  smallest factor (&gt;1) = 2  questions asked = 1
number = 7  smallest factor (&gt;1) = 7  questions asked = 5
number = 8  smallest factor (&gt;1) = 2  questions asked = 1
number = 9  smallest factor (&gt;1) = 3  questions asked = 3
number = 10  smallest factor (&gt;1) = 2  questions asked = 1
number = 11  smallest factor (&gt;1) = 11  questions asked = 6
number = 12  smallest factor (&gt;1) = 2  questions asked = 1
number = 13  smallest factor (&gt;1) = 13  questions asked = 7
number = 14  smallest factor (&gt;1) = 2  questions asked = 1
number = 15  smallest factor (&gt;1) = 3  questions asked = 3
number = 16  smallest factor (&gt;1) = 2  questions asked = 1
number = 17  smallest factor (&gt;1) = 17  questions asked = 7
number = 18  smallest factor (&gt;1) = 2  questions asked = 1
number = 19  smallest factor (&gt;1) = 19  questions asked = 7
number = 20  smallest factor (&gt;1) = 2  questions asked = 1
number = 21  smallest factor (&gt;1) = 3  questions asked = 3
number = 22  smallest factor (&gt;1) = 2  questions asked = 1
number = 23  smallest factor (&gt;1) = 23  questions asked = 7
number = 24  smallest factor (&gt;1) = 2  questions asked = 1
number = 25  smallest factor (&gt;1) = 5  questions asked = 4
number = 26  smallest factor (&gt;1) = 2  questions asked = 1
number = 27  smallest factor (&gt;1) = 3  questions asked = 3
number = 28  smallest factor (&gt;1) = 2  questions asked = 1
number = 29  smallest factor (&gt;1) = 29  questions asked = 7
number = 30  smallest factor (&gt;1) = 2  questions asked = 1
number = 31  smallest factor (&gt;1) = 31  questions asked = 7
number = 32  smallest factor (&gt;1) = 2  questions asked = 1
number = 33  smallest factor (&gt;1) = 3  questions asked = 3
number = 34  smallest factor (&gt;1) = 2  questions asked = 1
number = 35  smallest factor (&gt;1) = 5  questions asked = 4
number = 36  smallest factor (&gt;1) = 2  questions asked = 1
number = 37  smallest factor (&gt;1) = 37  questions asked = 7
number = 38  smallest factor (&gt;1) = 2  questions asked = 1
number = 39  smallest factor (&gt;1) = 3  questions asked = 3
number = 40  smallest factor (&gt;1) = 2  questions asked = 1
number = 41  smallest factor (&gt;1) = 41  questions asked = 7
number = 42  smallest factor (&gt;1) = 2  questions asked = 1
number = 43  smallest factor (&gt;1) = 43  questions asked = 7
number = 44  smallest factor (&gt;1) = 2  questions asked = 1
number = 45  smallest factor (&gt;1) = 3  questions asked = 3
number = 46  smallest factor (&gt;1) = 2  questions asked = 1
number = 47  smallest factor (&gt;1) = 47  questions asked = 7
number = 48  smallest factor (&gt;1) = 2  questions asked = 1
number = 49  smallest factor (&gt;1) = 7  questions asked = 5
number = 50  smallest factor (&gt;1) = 2  questions asked = 1
number = 51  smallest factor (&gt;1) = 3  questions asked = 3
number = 52  smallest factor (&gt;1) = 2  questions asked = 1
number = 53  smallest factor (&gt;1) = 53  questions asked = 7
number = 54  smallest factor (&gt;1) = 2  questions asked = 1
number = 55  smallest factor (&gt;1) = 5  questions asked = 4
number = 56  smallest factor (&gt;1) = 2  questions asked = 1
number = 57  smallest factor (&gt;1) = 3  questions asked = 3
number = 58  smallest factor (&gt;1) = 2  questions asked = 1
number = 59  smallest factor (&gt;1) = 59  questions asked = 7
number = 60  smallest factor (&gt;1) = 2  questions asked = 1
number = 61  smallest factor (&gt;1) = 61  questions asked = 7
number = 62  smallest factor (&gt;1) = 2  questions asked = 1
number = 63  smallest factor (&gt;1) = 3  questions asked = 3
number = 64  smallest factor (&gt;1) = 2  questions asked = 1
number = 65  smallest factor (&gt;1) = 5  questions asked = 4
number = 66  smallest factor (&gt;1) = 2  questions asked = 1
number = 67  smallest factor (&gt;1) = 67  questions asked = 7
number = 68  smallest factor (&gt;1) = 2  questions asked = 1
number = 69  smallest factor (&gt;1) = 3  questions asked = 3
number = 70  smallest factor (&gt;1) = 2  questions asked = 1
number = 71  smallest factor (&gt;1) = 71  questions asked = 7
number = 72  smallest factor (&gt;1) = 2  questions asked = 1
number = 73  smallest factor (&gt;1) = 73  questions asked = 7
number = 74  smallest factor (&gt;1) = 2  questions asked = 1
number = 75  smallest factor (&gt;1) = 3  questions asked = 3
number = 76  smallest factor (&gt;1) = 2  questions asked = 1
number = 77  smallest factor (&gt;1) = 7  questions asked = 5
number = 78  smallest factor (&gt;1) = 2  questions asked = 1
number = 79  smallest factor (&gt;1) = 79  questions asked = 7
number = 80  smallest factor (&gt;1) = 2  questions asked = 1
number = 81  smallest factor (&gt;1) = 3  questions asked = 3
number = 82  smallest factor (&gt;1) = 2  questions asked = 1
number = 83  smallest factor (&gt;1) = 83  questions asked = 7
number = 84  smallest factor (&gt;1) = 2  questions asked = 1
number = 85  smallest factor (&gt;1) = 5  questions asked = 4
number = 86  smallest factor (&gt;1) = 2  questions asked = 1
number = 87  smallest factor (&gt;1) = 3  questions asked = 3
number = 88  smallest factor (&gt;1) = 2  questions asked = 1
number = 89  smallest factor (&gt;1) = 89  questions asked = 7
number = 90  smallest factor (&gt;1) = 2  questions asked = 1
number = 91  smallest factor (&gt;1) = 7  questions asked = 5
number = 92  smallest factor (&gt;1) = 2  questions asked = 1
number = 93  smallest factor (&gt;1) = 3  questions asked = 3
number = 94  smallest factor (&gt;1) = 2  questions asked = 1
number = 95  smallest factor (&gt;1) = 5  questions asked = 4
number = 96  smallest factor (&gt;1) = 2  questions asked = 1
number = 97  smallest factor (&gt;1) = 97  questions asked = 7
number = 98  smallest factor (&gt;1) = 2  questions asked = 1
number = 99  smallest factor (&gt;1) = 3  questions asked = 3
number = 100  smallest factor (&gt;1) = 2  questions asked = 1
number = 101  smallest factor (&gt;1) = 101  questions asked = 7
number = 102  smallest factor (&gt;1) = 2  questions asked = 1
number = 103  smallest factor (&gt;1) = 103  questions asked = 7
number = 104  smallest factor (&gt;1) = 2  questions asked = 1
number = 105  smallest factor (&gt;1) = 3  questions asked = 3
number = 106  smallest factor (&gt;1) = 2  questions asked = 1
number = 107  smallest factor (&gt;1) = 107  questions asked = 7
number = 108  smallest factor (&gt;1) = 2  questions asked = 1
number = 109  smallest factor (&gt;1) = 109  questions asked = 7
number = 110  smallest factor (&gt;1) = 2  questions asked = 1
number = 111  smallest factor (&gt;1) = 3  questions asked = 3
number = 112  smallest factor (&gt;1) = 2  questions asked = 1
number = 113  smallest factor (&gt;1) = 113  questions asked = 7
number = 114  smallest factor (&gt;1) = 2  questions asked = 1
number = 115  smallest factor (&gt;1) = 5  questions asked = 4
number = 116  smallest factor (&gt;1) = 2  questions asked = 1
number = 117  smallest factor (&gt;1) = 3  questions asked = 3
number = 118  smallest factor (&gt;1) = 2  questions asked = 1
number = 119  smallest factor (&gt;1) = 7  questions asked = 5
number = 120  smallest factor (&gt;1) = 2  questions asked = 1
number = 121  smallest factor (&gt;1) = 11  questions asked = 6
number = 122  smallest factor (&gt;1) = 2  questions asked = 1
number = 123  smallest factor (&gt;1) = 3  questions asked = 3
number = 124  smallest factor (&gt;1) = 2  questions asked = 1
number = 125  smallest factor (&gt;1) = 5  questions asked = 4
number = 126  smallest factor (&gt;1) = 2  questions asked = 1
number = 127  smallest factor (&gt;1) = 127  questions asked = 7
number = 128  smallest factor (&gt;1) = 2  questions asked = 1
number = 129  smallest factor (&gt;1) = 3  questions asked = 3
number = 130  smallest factor (&gt;1) = 2  questions asked = 1
number = 131  smallest factor (&gt;1) = 131  questions asked = 7
number = 132  smallest factor (&gt;1) = 2  questions asked = 1
number = 133  smallest factor (&gt;1) = 7  questions asked = 5
number = 134  smallest factor (&gt;1) = 2  questions asked = 1
number = 135  smallest factor (&gt;1) = 3  questions asked = 3
number = 136  smallest factor (&gt;1) = 2  questions asked = 1
number = 137  smallest factor (&gt;1) = 137  questions asked = 7
number = 138  smallest factor (&gt;1) = 2  questions asked = 1
number = 139  smallest factor (&gt;1) = 139  questions asked = 7
number = 140  smallest factor (&gt;1) = 2  questions asked = 1
number = 141  smallest factor (&gt;1) = 3  questions asked = 3
number = 142  smallest factor (&gt;1) = 2  questions asked = 1
number = 143  smallest factor (&gt;1) = 11  questions asked = 6
number = 144  smallest factor (&gt;1) = 2  questions asked = 1
number = 145  smallest factor (&gt;1) = 5  questions asked = 4
number = 146  smallest factor (&gt;1) = 2  questions asked = 1
number = 147  smallest factor (&gt;1) = 3  questions asked = 3
number = 148  smallest factor (&gt;1) = 2  questions asked = 1
number = 149  smallest factor (&gt;1) = 149  questions asked = 7
number = 150  smallest factor (&gt;1) = 2  questions asked = 1
number = 151  smallest factor (&gt;1) = 151  questions asked = 7
number = 152  smallest factor (&gt;1) = 2  questions asked = 1
number = 153  smallest factor (&gt;1) = 3  questions asked = 3
number = 154  smallest factor (&gt;1) = 2  questions asked = 1
number = 155  smallest factor (&gt;1) = 5  questions asked = 4
number = 156  smallest factor (&gt;1) = 2  questions asked = 1
number = 157  smallest factor (&gt;1) = 157  questions asked = 7
number = 158  smallest factor (&gt;1) = 2  questions asked = 1
number = 159  smallest factor (&gt;1) = 3  questions asked = 3
number = 160  smallest factor (&gt;1) = 2  questions asked = 1
number = 161  smallest factor (&gt;1) = 7  questions asked = 5
number = 162  smallest factor (&gt;1) = 2  questions asked = 1
number = 163  smallest factor (&gt;1) = 163  questions asked = 6
number = 164  smallest factor (&gt;1) = 2  questions asked = 1
number = 165  smallest factor (&gt;1) = 3  questions asked = 3
number = 166  smallest factor (&gt;1) = 2  questions asked = 1
worst case   = 7 questions
best case    = 1 questions
average case = 494 / 165 ~= 2.99393939394 questions
time elapsed = 18 ms</pre>
<p>Here we see that we can figure out the smallest positive integer divisor greater than 1 in under 3 questions on average with this methodology, even though the worst case is a little worse than our algorithm for part 1 of this puzzle. </p>
<p>&#160;</p>
<p>I tried to keep the Java and Python code comparable (although not always asymptotically optimal) so we could have a rough comparison of performance.&#160; </p>
<p>With 166 numbers, python does the job a little faster (18ms vs. 58ms), but for 16,600 numbers, Java is about 50% faster.&#160; Java becomes an order of magnitude faster as we get to 166,000 numbers.&#160; </p>
<p>&#160;</p>
<p>This methodology impressively determines the smallest prime factor of any positive integer from 2 to 166,000 in ~4.04 questions on average (that’s over 15,000 primes)!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=823</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A glimpse at Modern Racism in dating?</title>
		<link>http://www.alternativerecursion.info/?p=809</link>
		<comments>http://www.alternativerecursion.info/?p=809#comments</comments>
		<pubDate>Thu, 22 Oct 2009 07:11:22 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[classism]]></category>
		<category><![CDATA[human behavior]]></category>
		<category><![CDATA[racism]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=809</guid>
		<description><![CDATA[Some data from the United States: ^source^ This data only counts people who have some income ^source^ &#160; ^source^ &#160; &#160; ^source^ &#160; Money and Education/Intelligence are essentially the ingredients to socio-economic class/success. So given this data, it makes sense that a classist person would have significant preferences if the only known attribute is race. [...]]]></description>
			<content:encoded><![CDATA[<p>Some data from the United States:</p>
<p> <span id="more-809"></span>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="meanincome" border="0" alt="meanincome" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/meanincome.png" width="568" height="277" /> </p>
<p>^<a href="http://www.census.gov/hhes/www/income/histinc/p03.xls" target="_blank">source</a>^</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MedianIncome" border="0" alt="MedianIncome" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/MedianIncome.png" width="574" height="316" /> </p>
<p>This data only counts people who have some income ^<a href="http://www.census.gov/hhes/www/income/histinc/p02.html" target="_blank">source</a>^</p>
<p>&#160; <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="edu" border="0" alt="edu" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/edu.png" width="590" height="326" /> </p>
<p>^<a href="http://www.census.gov/prod/2004pubs/p20-550.pdf" target="_blank">source</a>^</p>
<p>&#160;</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="sat" border="0" alt="sat" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/sat.png" width="551" height="361" />&#160; </p>
<p>^<a href="http://professionals.collegeboard.com/profdownload/cbs-08-Page-11-Graph-10.pdf" target="_blank">source</a>^</p>
<p>&#160;</p>
<p>Money and Education/Intelligence are essentially the ingredients to socio-economic class/success.</p>
<p>So given this data, it makes sense that a classist person would have significant preferences if the only known attribute is race.</p>
<p>Many may argue racism is inherent biologically as we evolved with the humanity that feels better around people looking similar to us, (which makes sense in a tribe in nature where you wouldn&#8217;t want to let your guard down with very different looking creatures that may not be friendly), data further below will make that a mute point for the purposes of this text.&#160; </p>
<p>If we model a female as purely seeking social and economic status in a mate, her race preference would probably look something like this:</p>
<p>&#160;<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="incomef" border="0" alt="incomef" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/incomef.png" width="687" height="309" /> </p>
<p>based on median income of males with income ^<a href="http://www.census.gov/hhes/www/income/histinc/p02.html" target="_blank">source</a>^</p>
<p>or </p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="meanincomef" border="0" alt="meanincomef" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/meanincomef.png" width="690" height="315" /> </p>
<p>based on mean income of males ^<a href="http://www.census.gov/hhes/www/income/histinc/p03.xls" target="_blank">source</a>^</p>
<p>&#160;</p>
<p>Many may say yeah but woman aren’t seeking out economic security in a male these days… well lets have a look:</p>
<p>&#160;</p>
<p>The following is actual response rate from females from a popular dating site with a sizable dataset:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="asianF" border="0" alt="asianF" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/asianF.png" width="690" height="314" /> </p>
<p>Just to clarify this shows Asian woman respond at a higher rate to white men’s messages than Asian men’s messages.</p>
<p>The pie chart is a visualization for their racial preference when considering mates.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="blackF" border="0" alt="blackF" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/blackF.png" width="691" height="313" />&#160;</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HispanicF" border="0" alt="HispanicF" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/HispanicF.png" width="692" height="321" /></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="whiteF" border="0" alt="whiteF" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/whiteF.png" width="690" height="314" /> </p>
<p>^<a href="http://blog.okcupid.com/index.php/2009/10/05/your-race-affects-whether-people-write-you-back/" target="_blank">source</a>^</p>
<p>&#160;</p>
</p>
</p>
<p>This data mostly matches our expected graphs based purely on income which supports the idea that females in this culture seek out mates by socio-economic status.&#160; The exception is that Asian men seem to enjoy far less favor from all females than their academic and economic status would suggest.&#160; </p>
<p>Here’s one bit of data that may explain it:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="height" border="0" alt="height" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/height.png" width="646" height="303" /> </p>
<p>^<a href="http://www.halls.md/" target="_blank">source</a>^</p>
<p>&#160;</p>
<p>My angle hear suggests that while no reasonable person really has much of any reason to believe one race is “better” than another, racism persists in daily and social life primarily because of classism.&#160; The way things are going in our culture, the fight against classism seems unwinnable, and maybe it shouldn&#8217;t be fought?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=809</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>intel P55 LGA1156 chipset and DDR3 Memory</title>
		<link>http://www.alternativerecursion.info/?p=797</link>
		<comments>http://www.alternativerecursion.info/?p=797#comments</comments>
		<pubDate>Fri, 09 Oct 2009 22:48:52 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[it]]></category>
		<category><![CDATA[crucial]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[p55]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=797</guid>
		<description><![CDATA[When I first bought an Intel P55 chipset based motherboard and a LGA1156 Core i7 Processor, I thought the safest thing to do would be purchasing Standard memory from a reputable company with JEDEC approved voltage and timings. So I purchased some standard Crucial DDR3-1333&#160; PC3-10600. If you go to crucial’s website and you enter [...]]]></description>
			<content:encoded><![CDATA[<p>When I first bought an Intel P55 chipset based motherboard and a LGA1156 Core i7 Processor, I thought the safest thing to do would be purchasing Standard memory from a reputable company with JEDEC approved voltage and timings. </p>
<p> <span id="more-797"></span>
<p>So I purchased some standard Crucial DDR3-1333&#160; PC3-10600.</p>
<p>If you go to crucial’s website and you enter in a P55 motherboard, you will get this suggested memory:</p>
<p><a href="http://www.crucial.com/store/partspecs.aspx?IMODULE=CT2KIT25664BA1339">CT2KIT25664BA1339</a></p>
<p>I ordered 2 4GB kits, each with with 2 2GB dimms.</p>
<p>The dimms all looked like this:</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2009-10-09 17.46.09" border="0" alt="2009-10-09 17.46.09" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/2009100917.46.09.jpg" width="657" height="138" />&#160;</p>
<p>&#160;</p>
<p>here is what CPUZ saw from the SPD of the dimm:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="crucial" border="0" alt="crucial" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/crucial.png" width="409" height="395" /></p>
<p>&#160;</p>
</p>
<p>So, everything seemed fine until I started to get random reboots every couple days.</p>
<p>&#160;</p>
<p>I tried every possible combination of the dimms, and I always got the same result; hard-reboots.</p>
<p>I felt the odds of all 4 dimms being faulty is roughly zero, so I decided it must be the motherboard, until I started reading <a href="http://www.newegg.com/Product/ProductReview.aspx?Item=20-148-262&amp;SortField=0&amp;SummaryType=0&amp;Pagesize=100&amp;SelectedRating=-1&amp;PurchaseMark=&amp;VideoOnlyMark=False&amp;VendorMark=&amp;Page=1&amp;Keywords=(keywords)">these</a> comments on newegg about my memory.&#160; There are/was a very high percentage of people claiming the memory did not work on their P55 motherboard.</p>
<p>Then I started to see newegg stamp certain memory P55 Core i5/i7 compatible, which didn’t seem to make sense, because any memory that adheres to JEDEC spec for PC3-10600 should be compatible.¿?</p>
<p>&#160;</p>
<p>I found Intel’s own Validation Results for DDR3-1333 on P55 <a href="http://developer.intel.com/technology/memory/ddr/valid/ddr3_nonecc_udimm_results.htm">here</a>.</p>
<p>&#160;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ddr3" border="0" alt="ddr3" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/ddr3.png" width="568" height="501" /> </p>
<p>It lists Crucial’s CT25664BA1339, but specifically the CT25664BA1339<strong>.16FF.</strong></p>
<p><strong></strong></p>
<p>Looking closer at my memory I found it to be CT25664BA1339<strong>.M16SFD.</strong></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2009-10-09 17.40.42" border="0" alt="2009-10-09 17.40.42" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/2009100917.40.42.jpg" width="447" height="114" /></p>
<p>for reference this dimm uses micron chips with markings: 9ND22 D9JNM</p>
<p><a href="http://www.alternativerecursion.info/wp-content/uploads/2009/10/crucial1.png"></a></p>
<p>&#160;</p>
<p> <strong></strong>
<p>Crucial said the last string of this part number is for internal use only, and refers to which chip/set is being used on the dimm.&#160; The crucial representative said it should make no difference with respect to P55 compatibility, and was perplexed why Intel would specifically approve the 16FF.&#160; In fact as a consumer you cannot even see what the internal chipset number is before you buy online, but you can call and ask to order a specific one over the phone.</p>
<p>I did just that, and ordered a set of CT25664BA1339<strong>.16FF</strong> over the phone from crucial, they looked like this:</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2009-10-09 17.41.13" border="0" alt="2009-10-09 17.41.13" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/2009100917.41.13.jpg" width="855" height="256" /> </p>
<p>Notice the Micron label on the left?&#160; I assume this means the dimm itself was manufactured by Micron, and resold by crucial.</p>
<p>(my other CT25664BA1339<strong>.M16SFD</strong> dimms don’t have a micron sticker.)</p>
<p>&#160;</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2009-10-09 17.40.50" border="0" alt="2009-10-09 17.40.50" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/2009100917.40.50.jpg" width="474" height="111" /> </p>
<p>The CT25664BA1339<strong>.16FF</strong> dimm uses different micron chips marked: 9NF22 D9KPT</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2009-10-09 17.41.03" border="0" alt="2009-10-09 17.41.03" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/2009100917.41.03.jpg" width="491" height="103" />&#160;</p>
<p>So the Crucial CT25664BA1339<strong>.16FF</strong> is in fact a Micron MT16JTF25664AZ-1G4F1 dimm.</p>
<p>CPU-Z’s information from the SPD agrees:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="micron" border="0" alt="micron" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/micron.png" width="408" height="396" /> </p>
<p>It is no surprise that both the Crucial CT25664BA1339.16FF and the Micron MT16JTF25664AZ-1G4F1 <a href="http://developer.intel.com/technology/memory/ddr/valid/ddr3_nonecc_udimm_results.htm">passed Intel’s validation tests</a>, as they are the exact same dimm:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ddr3h" border="0" alt="ddr3h" src="http://www.alternativerecursion.info/wp-content/uploads/2009/10/ddr3h.png" width="573" height="504" /> </p>
<p>&#160;</p>
<p>These new Micron dimms seem to run fine in my system without any problems.</p>
<p>I still don’t know why the P55 chipset/CPUs have problems with the non-16FF crucial dimms.&#160; So I by no means really understand the root of the issue, but I thought others might find this interesting.&#160; </p>
<p>&#160;</p>
<p>The memory Crucial will send you for a P55 system may not be the memory you want.&#160; </p>
<p>It also seems that many DDR3 kits that seem fine otherwise, do not work right with the P55. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=797</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>IT window</title>
		<link>http://www.alternativerecursion.info/?p=782</link>
		<comments>http://www.alternativerecursion.info/?p=782#comments</comments>
		<pubDate>Fri, 21 Aug 2009 21:21:32 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[it]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=782</guid>
		<description><![CDATA[Current and near-future IT to keep an eye out for. Software&#62; Proof of concept www.wolframalpha.com shows a taste of the future of querying data. Windows 7 which is a refined build of Windows Vista is the best Desktop OS. Google Chrome 3 is by far the best consumer web browser. Google Voice provides 1 number [...]]]></description>
			<content:encoded><![CDATA[<p>Current and near-future IT to keep an eye out for.</p>
<p> <span id="more-782"></span><br />
<h1>Software&gt;</h1>
<p>Proof of concept <a href="http://www.wolframalpha.com">www.wolframalpha.com</a> shows a taste of the future of querying data.</p>
<p><a href="http://www.microsoft.com/windows/windows-7/">Windows 7</a> which is a refined build of Windows Vista is the best Desktop OS.</p>
<p><a href="http://www.google.com/chrome">Google Chrome</a> 3 is by far the best consumer web browser.</p>
<p><a href="www.google.com/voice">Google Voice</a> provides 1 number with voice, voicemail, and SMS capability.&#160; Those can be forwarded to a mobile phone if desired.&#160; There is a Google Voice application for android which lists text messages and voicemails for you to read/listen/delete/reply-to individually (it transcribes voicemails so you can read them before you choose to listen).&#160; Using this application, SMS’s and voicemails are transmitted over DATA, so they do not count as a text messages in your plan.&#160; The whole system has a web interface for you to send and view text messages, voicemails and call history.&#160; It will also allow you to keep in touch with SMS/voicemail while you travel outside of your cell phone service coverage.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<h1>Storage&gt;</h1>
<p>Seagate has 500GB platters which it uses in products like:</p>
<ul>
<li>3.5” 7200rpm 1TB <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822148433">@$90</a> </li>
<li>3.5” 5900rpm 2TB <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822148413">@$200</a> </li>
</ul>
<p>&#160;</p>
<p>Intel has <a href="http://www.intel.com/design/flash/nand/mainstream/index.htm">launched</a> their 2nd Generation MLC Solid State Disk using 34nm flash (as opposed to 50nm)</p>
<ul>
<li>2.5” 80GB <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820167016">@$230</a> </li>
<li>2.5” 160GB <a href="http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=10010793&amp;prodlist=froogle">@$450</a> </li>
</ul>
<p>These new Intel drives support something called TRIM, which is also <a href="http://blogs.msdn.com/e7/archive/2009/05/05/support-and-q-a-for-solid-state-drives-and.aspx">supported in Windows 7</a>.&#160; Without Trim, when a file is deleted, the TOC is updated to consider that area on the drive empty, the data isn’t actually wiped.&#160; This is fine for rotating discs because the drive will simply over-write those bits when a new request is received.&#160; On current SSDs there is a problem, because blocks must actually be erased before a write, so when a request to write data on the previously used space, it must first erase the area, then write, and this costs time.&#160; TRIM tags the areas of the drive where the data was deleted, and the drive will (on its own time) erase those blocks of bits.&#160; This means in some cases a block won’t need to be erased prior to write, since the drive actually erased it on its own time.</p>
<p>This is good, but you should know that if there is live data in the vicinity of a write, the SSD must still read the entire block into memory, erase the block, add the new data to the data in memory, then write the entire block.&#160; The push should be for reducing the block sizes, to reduce the time-tax in random writes.&#160; Intel AFAIK has the smallest block size around.&#160; I’ll review this new Intel SSD soon.</p>
<p>&#160;</p>
<h1>Memory&gt;</h1>
<p>DDR3 has arrived at reasonable price points.</p>
<ul>
<li>Crucial 4GB (2x2GB) DDR3-1333 kit <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820148262">@$65</a> </li>
<li>Crucial 4GB (2x2GB) DDR2-800&#160;&#160; kit <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820148160">@$53</a> </li>
</ul>
<p>what DDR3 desperately needs is higher density, supposedly reasonably priced 4GB dimms will arrive in the coming months with Samsung chips.</p>
<p>&#160;</p>
<h1>CPU/Platforms&gt;</h1>
<p>We are in a weird space now.</p>
<p>Last year Intel launched its revolutionary 45nm Nehalem CPU which features an integrated memory controller.&#160; These chips launched with a very high-end and expensive x58 platform.&#160; Due to the price of the platform and (at the time) expensive DDR3 memory, this platform never really hit the average or value conscious consumer.</p>
<p>Because of this, most computers sold are using a relatively old Penryn CPUs built on 45nm technology without an integrated memory controller.&#160; These CPUs have been for sale since January 2008!&#160; And the Penryn was just a die-shrink of the Conroe which was famously launched in the summer of 2006.&#160; Great for 2006, but it’s been a long time.</p>
<p>In the coming weeks Intel will launch consumer-oriented Nehalem-based CPUs (Lynnfield).&#160; They will be slightly improved, slightly cheapened versions of the current Core i7.&#160; The new platform is the Intel P55 with a new socket (LGA1156) supporting the double channel memory controller (as opposed to 3x in the current i7).</p>
<p>These new chips are still 45nm.</p>
<p>&#160;</p>
<p>&#160;&#160; <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="new" border="0" alt="new" src="http://www.alternativerecursion.info/wp-content/uploads/2009/08/new2.png" width="519" height="370" /> </p>
<p>&#160; </p>
<p>That’s all well and good for high end consumer PCs and big and clunky laptops, but for thin-light mobile notebooks it doesn’t do that much, these are still 45nm, and they aren’t even attempting a Low or Ultra-Low Voltage variant.&#160; And the normal voltage new chip will still require 3 separate chips to complete the platform (including video = GPU).</p>
<p>What’s interesting is around January intel is releasing the 32nm Family of processors with GPU (graphics processor) integrated in the CPU package!&#160; </p>
<p>This reduces the number of major chips needed to 2 for the entire platform, and these chips will be lower power due to the die shrinks.</p>
<p>It’s called Westmere, and while desktop and clunky laptops will also get their own models, they don’t need it nearly as much.</p>
<p>here are some <a href="http://global.hkepc.com/3878">Westmere Desktop</a> options available in January:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="i5" border="0" alt="i5" src="http://www.alternativerecursion.info/wp-content/uploads/2009/08/i5.png" width="674" height="401" /> </p>
<p>GPU performance on Westmere will be roughly double that of the modern x4500HD, it also ads some video decoding features.</p>
<p>&#160;</p>
<p>Here’s the picture for the Ultra-Low-Voltage space (think Macbook /Air and smaller) dual cores. (~10W for CPU duties, ~8W for GPU)</p>
<table border="0" cellspacing="0" cellpadding="2" width="590">
<tbody>
<tr>
<td valign="top" width="74">.          <br />.</td>
<td valign="top" width="150">-12 months</td>
<td valign="top" width="50">now</td>
<td valign="top" width="65">+1 month</td>
<td valign="top" width="124">+6 months</td>
<td valign="top" width="125">+18 months</td>
</tr>
<tr>
<td valign="top" width="74">CPU          <br />.</td>
<td valign="top" width="150">1.4Ghz Penryn</td>
<td valign="top" width="50">=&gt;same</td>
<td valign="top" width="65">=&gt;same</td>
<td valign="top" width="124"><a href="http://www.xbitlabs.com/news/cpu/display/20090813091122_Intel_May_Unveil_Microprocessors_with_Integrated_Graphics_Cores_at_Consumer_Electronics_Show.html">1.2Ghz Westmere</a></td>
<td valign="top" width="125">Sandy Bridge</td>
</tr>
<tr>
<td valign="top" width="74">process tech CPU</td>
<td valign="top" width="150">45nm</td>
<td valign="top" width="50">=&gt;same</td>
<td valign="top" width="65">=&gt;same</td>
<td valign="top" width="124">32nm</td>
<td valign="top" width="125">32nm</td>
</tr>
<tr>
<td valign="top" width="74">process tech GPU</td>
<td valign="top" width="150">65nm on Northbridge</td>
<td valign="top" width="50">=&gt;same</td>
<td valign="top" width="65">=&gt;same</td>
<td valign="top" width="124">45nm in-package</td>
<td valign="top" width="125">32nm on-die</td>
</tr>
<tr>
<td valign="top" width="74">Memory Controller</td>
<td valign="top" width="150">on Northbridge</td>
<td valign="top" width="50">=&gt;same</td>
<td valign="top" width="65">=&gt;same</td>
<td valign="top" width="124">on-die</td>
<td valign="top" width="125">on-die</td>
</tr>
<tr>
<td valign="top" width="74">chips in platform</td>
<td valign="top" width="150">3</td>
<td valign="top" width="50">=&gt;same</td>
<td valign="top" width="65">=&gt;same</td>
<td valign="top" width="124">2</td>
<td valign="top" width="125">probably 2</td>
</tr>
</tbody>
</table>
<p>Exciting times after Christmas for thin and light laptops like the Acer Timeline 13.3”, Dell adamo, MacBook Air, ThinkPad x301, etc.</p>
<p>&#160;</p>
<p>So in the thin notebook segment there will be a massive improvement on the platform in about 6 months, what about Netbooks with the ATOM?</p>
<p>&#160;</p>
<p>Currently the atoms are a bit too slow to be useful in a mini-notebook and use a bit too much power for small gadgets.</p>
<p>In the coming few months there will be new Atom processors, still using 45nm tech, but will have an Integrated Memory Controller, and an Integrated Graphics Processor, both on-die!</p>
<p>&#160;</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="intel_pine_trail_moblin_disclosure_4" border="0" alt="intel_pine_trail_moblin_disclosure_4" src="http://www.alternativerecursion.info/wp-content/uploads/2009/08/intel_pine_trail_moblin_disclosure_4.jpg" width="923" height="624" /> </p>
<p>&#160;</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="137">&#160;</td>
<td valign="top" width="129">now</td>
<td valign="top" width="133"><a href="http://global.hkepc.com/3210">in a few months</a></td>
</tr>
<tr>
<td valign="top" width="137">ATOM</td>
<td valign="top" width="129">N270</td>
<td valign="top" width="133">N450</td>
</tr>
<tr>
<td valign="top" width="137">CPU process tech</td>
<td valign="top" width="129">45nm</td>
<td valign="top" width="133">45nm</td>
</tr>
<tr>
<td valign="top" width="137">chipset</td>
<td valign="top" width="129">945GSE+ICH7m</td>
<td valign="top" width="133">NM10 Express</td>
</tr>
<tr>
<td valign="top" width="137">chipset process tech</td>
<td valign="top" width="129">130nm</td>
<td valign="top" width="133">probably 65nm</td>
</tr>
<tr>
<td valign="top" width="137"># of chips in Platform</td>
<td valign="top" width="129">3</td>
<td valign="top" width="133">2</td>
</tr>
<tr>
<td valign="top" width="137">Platform’s footprint</td>
<td valign="top" width="129">2174mm^2</td>
<td valign="top" width="133">773mm^2</td>
</tr>
<tr>
<td valign="top" width="137">Platform AVG PWR</td>
<td valign="top" width="129">4W</td>
<td valign="top" width="133">2W</td>
</tr>
<tr>
<td valign="top" width="137">Platform TDP</td>
<td valign="top" width="129">16W</td>
<td valign="top" width="133">7W</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>Drastic decrease in power usage for the platform, down to 2 chips instead of 3… should allow for fan-less designs.&#160; The atom finally becomes modernized!&#160; May be still slower than desired.&#160; In 2010 we should see 32nm Atoms.</p>
<p>&#160;</p>
<p>So huge improvements in the netbook space to come real soon!</p>
<p>&#160;</p>
<p>I havn’t talked about AMD, currently they are not competitive in the low-power mobile space (in fact they don’t have any 45nm parts, so they can’t compete on energy efficiency).&#160; But they have migrated to 45nm on the desktop and probably have the best integrated platform out there.&#160; Speaking of the 785g chipset paired with a 45nm AMD CPU, if you need an inexpensive and quick desktop today, buy this.</p>
<p>AMD has this corner dominated until Intel releases Westmere after Christmas.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Mobile Phones:</p>
<p>currently only 3 worth mentioning:</p>
<ul>
<li>iPhone 3GS </li>
<li>Palm Pre </li>
<li>HTC/T-mobile G1 and myTouch 3G </li>
</ul>
<p>The next 6 months will prove interesting as around 6 more Google Android mobile phones will be released on T-mobile, AT&amp;T and Sprint.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=782</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the Quantitative GRE has a Quantitative failure:</title>
		<link>http://www.alternativerecursion.info/?p=723</link>
		<comments>http://www.alternativerecursion.info/?p=723#comments</comments>
		<pubDate>Mon, 11 May 2009 21:14:53 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[gre]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=723</guid>
		<description><![CDATA[The quantitative exam lumps a large portion of test takers with a significant variation in ability into a single score. The verbal does not have a similar flaw. the results from everyone who is trying to get into a graduate program: clearly there is a problem here where the most common score of all test-takers [...]]]></description>
			<content:encoded><![CDATA[<p>The quantitative exam lumps a large portion of test takers with a significant variation in ability into a single score.</p>
<p>The verbal does not have a similar flaw.</p>
<p>the results from everyone who is trying to get into a graduate program:</p>
<table border="0" cellspacing="0" cellpadding="0" width="999">
<tbody>
<tr>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="all" border="0" alt="all" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/all.png" width="488" height="367" /> </td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="all_v" border="0" alt="all_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/all-v.png" width="489" height="364" /> </td>
</tr>
</tbody>
</table>
<p>clearly there is a problem here where the most common score of all test-takers is the maximum.</p>
<p>let’s take a closer look at how this makes the GRE Quantitative even less useful for specific graduate programs:</p>
</p>
<p> <span id="more-723"></span>
</p>
<table border="0" cellspacing="0" cellpadding="0" width="999">
<tbody>
<tr>
<td valign="top" width="499">quantitative:</td>
<td valign="top" width="499">verbal:</td>
</tr>
<tr>
<td valign="top" width="499">&#160;</td>
<td valign="top" width="499">&#160;</td>
</tr>
<tr>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="cs" border="0" alt="cs" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/cs-thumb.png" width="517" height="368" /></td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="cs_v" border="0" alt="cs_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/cs-v.png" width="489" height="365" /> </td>
</tr>
<tr>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="math" border="0" alt="math" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/math.png" width="523" height="365" /></td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="math_v" border="0" alt="math_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/math-v.png" width="487" height="366" /></td>
</tr>
<tr>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ee" border="0" alt="ee" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/ee1.png" width="521" height="364" /> </td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ee_v" border="0" alt="ee_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/ee-v.png" width="488" height="367" /> </td>
</tr>
<tr>
<td valign="top" width="499">notice in the students pursuing a PhD in math, computer science or electrical engineering, the quantitative exam is too easy, too many students are binned together at the highest score simply cause the test is too easy for them.</td>
<td valign="top" width="499">interestingly the above fields have 2 humps in verbal, i imagine the first hump is from non-native English speakers going into these fields of study, the 2nd hump is likely the native English speakers.</td>
</tr>
<tr>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="phil" border="0" alt="phil" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/phil.png" width="491" height="366" /></td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="phil_v" border="0" alt="phil_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/phil-v.png" width="488" height="359" /> </td>
</tr>
<tr>
<td valign="top" width="499">With philosophy PhD students here we see a more desirable distribution, but still, the perfect is almost as frequent as the mode.</td>
<td valign="top" width="499">A relatively normal distribution, only 1 hump and the perfect is far from being the mode.</td>
</tr>
<tr>
<td valign="top" width="499">&#160;<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="hist" border="0" alt="hist" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/hist1.png" width="489" height="358" /> </td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="hist" border="0" alt="hist" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/hist.png" width="497" height="358" /></td>
</tr>
<tr>
<td valign="top" width="499">&#160;<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="psych" border="0" alt="psych" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/psych.png" width="502" height="363" /></td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="psych_v" border="0" alt="psych_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/psych-v.png" width="502" height="366" /> </td>
</tr>
<tr>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="md" border="0" alt="md" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/md.png" width="483" height="367" /> </td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="md_v" border="0" alt="md_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/md-v.png" width="484" height="360" /> </td>
</tr>
<tr>
<td valign="top" width="499"><a href="http://www.alternativerecursion.info/wp-content/uploads/2009/05/english.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="english" border="0" alt="english" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/english-thumb.png" width="485" height="365" /></a> </td>
<td valign="top" width="499"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="english_v" border="0" alt="english_v" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/english-v.png" width="495" height="367" /> </td>
</tr>
<tr>
<td valign="top" width="499">in the 4 areas of study above, the quantitative GRE exam does a good job at differentiating the the people.&#160; The distributions are very normal, with the max and min score occurring far less than the mode.</td>
<td valign="top" width="499">Even in the fields of study which attract the most verbally talented people, the verbal GRE test doesn’t break down, it still yields relatively normal distributions where the mode is far more common than the max or min.</td>
</tr>
</tbody>
</table>
<p>lets do a real basic analysis of what’s going on:</p>
<p>&#160;</p>
<p>the actual distribution of quantitative ability probably looks something like this:</p>
<p>&#160; <img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="1" border="0" alt="1" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/1.png" width="696" height="400" /></p>
<p>note: normal curves have no maximum or minimum value of ability, just like there is no maximum IQ value, its just insanely unlikely to have an IQ of , say , 500… but still possible.</p>
<p>With practical limitations like a finite time limit, I can understand the need for bounds on the scores.</p>
<p>When you set a maximum, everyone with an ability higher than the maximum shall now be bundled at that maximum value, so lets look at what that will look like with a max=800 and min=200:</p>
<p>&#160; <img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="2" border="0" alt="2" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/21.png" width="682" height="395" /></p>
<p>here you see unnaturally high probability to achieve a 200 and an 800,&#160; the combined probability to score higher than the maximum will be lumped into that one score.&#160; This cannot be avoided, but the number of people who would naturally score higher than the max can be minimized as to not be too significant, like the verbal GRE does.</p>
<p>So Why is the Quantitative so much worse than the Verbal GRE??</p>
<p>well the Verbal GRE has a mean of 477, almost equidistant to the max and min, while the quantitative has a literal (but misleading) mean of 579, so the entire distribution is nudged closer to the maximum boundary,&#160; its also a bit wider than the verbal (higher std dev)</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="3" border="0" alt="3" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/3.png" width="665" height="394" /></p>
<p>see the massive data point at an 800 score?&#160; its value is equal to the accumulated area under entire tail end of the curve (above 800).</p>
<p>which of course looks very similar to the actual GRE Quantitative distribution:</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="all" border="0" alt="all" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/all.png" width="488" height="367" />so this is a fundamental issue with the test and should be corrected.</p>
<p>It can be fixed by lowering the mean to ~500 by making all questions more difficult across the board.</p>
<p>&#160;</p>
<p>for those interested, the plots were done in maple of testdist2, where:</p>
<p>&#160;</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/image.png" width="410" height="70" /></p>
<p>and</p>
<p>testdist2 := (min, max, x, mean, stdv) -&gt; piecewise(x = min, int(distr(y, mean, stdv), y = -infinity .. min), min &lt; x and x &lt; max, int(distr(y, mean, stdv), y = 10*floor((1/10)*x) .. 10*floor((1/10)*x)+10), x = max, int(distr(y, mean, stdv), y = max .. infinity), 0) ;</p>
<p>&#160;</p>
<p>using a plot command like this:</p>
<p>mean1 := 579; stdv1 := 130; gremax := 800; gremin := 200; plot(testdist2(gremin, gremax, x, mean1, stdv1), x = gremin .. gremax, numpoints = 100, style = point, symbol = cross, symbolsize = 8, labels = [ability, `~probability`], title = &quot;Normal Curve with mean of 579, std deviation of 130, score increment = 10&quot;) </p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=723</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>trading lawns for frogs</title>
		<link>http://www.alternativerecursion.info/?p=687</link>
		<comments>http://www.alternativerecursion.info/?p=687#comments</comments>
		<pubDate>Mon, 04 May 2009 02:19:43 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[nature]]></category>
		<category><![CDATA[frogs]]></category>
		<category><![CDATA[lawns]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=687</guid>
		<description><![CDATA[A study of amphibians found that in suburban ponds of CT, about 21% of frogs were deformed, like males growing eggs inside their testes. Probably the result of lawn care products&#8230; Lawns are stupid: we destroy nature, what has been there far longer than Europeans on these lands, to try to grow a plant which [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pbs.org/wnet/nature/episodes/frogs-the-thin-green-line/introduction/4763/">A study of amphibians</a> found that in suburban ponds of CT, about 21% of frogs were deformed, like males growing eggs inside their testes. Probably the result of lawn care products&#8230;</p>
<p>Lawns are stupid: we destroy nature, what has been there far longer than Europeans on these lands, to try to grow a plant which will not survive without all sorts of chemicals, machinery and energy to protect it, to show others that we too adhere to the same cultural standard for &quot;well-kept&quot; land, at the sacrifice of nature and the environment.</p>
<p>I&#8217;ve said it before but these kind of ground keeping is an arms race of suburbia where we all lose.</p>
<p>Isn&#8217;t sustainable nature beautiful?    <br />Who&#8217;s really impressed with a lawn of cut grass?</p>
<p>&#160;</p>
<table border="0" cellspacing="0" cellpadding="0" width="800">
<tbody>
<tr>
<td width="297"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="lawn-lines" border="0" alt="lawn-lines" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/lawnlines1.jpg" width="408" height="308" /> </td>
<td width="235">&#160;<br />
<h1><font color="#ffffff">*</font>&gt;?</h1>
</td>
<td width="266">&#160;<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="US07_SSM0001_M-FB~Forest-Ferns-in-Misty-Morning-Church-Farm-Connecticut-USA-Posters" border="0" alt="US07_SSM0001_M-FB~Forest-Ferns-in-Misty-Morning-Church-Farm-Connecticut-USA-Posters" src="http://www.alternativerecursion.info/wp-content/uploads/2009/05/us07-ssm0001-mfbforestfernsinmistymo.jpg" width="338" height="450" /> </td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=687</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Performance in modern browsers *DOM results added</title>
		<link>http://www.alternativerecursion.info/?p=617</link>
		<comments>http://www.alternativerecursion.info/?p=617#comments</comments>
		<pubDate>Wed, 11 Mar 2009 00:30:32 +0000</pubDate>
		<dc:creator>stephen</dc:creator>
				<category><![CDATA[it]]></category>

		<guid isPermaLink="false">http://www.alternativerecursion.info/?p=617</guid>
		<description><![CDATA[I use google chrome almost exclusively when doing the web, but I see many people using a wide variety of web browsers these days. So I wanted to see how fast they are in the immensely popular javascript: &#60;&#8211;relative speed. (higher is better)—&#62; OS: windows 7 64-bit b7048 RAM: 4GB DDR2-800 CPU: intel 2-core 3Ghz [...]]]></description>
			<content:encoded><![CDATA[<p>I use google chrome almost exclusively when doing the web, but I see many people using a wide variety of web browsers these days.</p>
<p>So I wanted to see how fast they are in the immensely popular javascript:</p>
<p><img class="alignnone size-full wp-image-657" title="js6" src="http://www.alternativerecursion.info/wp-content/uploads/2009/03/js6.png" alt="js6" width="737" height="437" /></p>
<p align="center">&lt;&#8211;relative speed. (higher is better)—&gt;</p>
<p align="center">
<p><a title="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html"></a></p>
<pre>OS: windows 7 64-bit b7048
RAM: 4GB DDR2-800
CPU: intel 2-core 3Ghz Penryn w/6MB cache
HDD: Samsung F1 7200rpm
Chipset: intel G45</pre>
<p>v8 is <a title="http://v8.googlecode.com/svn/data/benchmarks/v3/run.html" href="http://v8.googlecode.com/svn/data/benchmarks/v3/run.html">http://v8.googlecode.com/svn/data/benchmarks/v3/run.html</a></p>
<p>sunspider is <a title="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html">http://www2.webkit.org/perf/sunspider-0.9/sunspider.html</a></p>
<p>dromaeo JS is <a title="http://dromaeo.com/?dromaeo" href="http://dromaeo.com/?dromaeo">http://dromaeo.com/?dromaeo</a></p>
<p>dromaeo DOM is <a href="http://dromaeo.com/?dom|jslib|cssquery">http://dromaeo.com/?dom|jslib|cssquery</a></p>
<p>(ie and safari 3 were not able to complete the dromaeo DOM test suite w/default settings)</p>
<p>note:</p>
<p>the 64-bit firefox I tested is not official; <a href="http://www.mozilla-x86-64.com/">http://www.mozilla-x86-64.com/</a></p>
<p>google chrome 2.0.269.0 is a dev/beta build.</p>
<p>opera, IE, chrome, firefox, k-meleon, safari are all 32-bit unless otherwise noted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alternativerecursion.info/?feed=rss2&amp;p=617</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
