<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: This problem can be solved by pre-school children in 5-10 minutes in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100803#M5240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite nice idea Tom. But then you can't guess the weight that 4 would have, since none of the examples contains a 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2012 19:22:18 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2012-08-21T19:22:18Z</dc:date>
    <item>
      <title>This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100797#M5234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: Georgia, 'Times New Roman', Times, serif; margin: 0px 0px 19px; color: #666666; font-size: 13px; background-color: #ffffff; text-align: justify;"&gt;This problem can be solved by pre-school children in 5-10 minutes. By programmers in one hour. By people with a higher education… Well, check it out yourself and post the answer in the comments when you have solved it. Now, those who want to solve it, do not cheat to see if anyone has posted the answer. But then, posting just the answer does not explain the logic here.&lt;/P&gt;&lt;P style="font-family: Georgia, 'Times New Roman', Times, serif; margin: 0px 0px 19px; color: #666666; font-size: 13px; background-color: #ffffff; text-align: justify;"&gt;This took me just few minutes, so I guess I have a pre-school mentality….&lt;/P&gt;&lt;P style="font-family: Georgia, 'Times New Roman', Times, serif; margin: 0px 0px 19px; color: #666666; font-size: 13px; background-color: #ffffff; text-align: justify;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;&lt;SPAN id="more-13205" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;Now, think outside the box, folks. There are a couple links to clues below the problem if you get frustrated, as well as a link to the answer and logic used to solve the problem.&lt;/P&gt;&lt;PRE style="font-family: 'Courier 10 Pitch', Courier, monospace; margin: 0 0 19px; color: #666666; font-size: 13px; text-align: center;"&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;8809 = 6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;7111 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;2172 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;6666 = 4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;1111 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;3213 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;7662 = 2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;9313 = 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;0000 = 4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;2222 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;3333 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;5555 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;8913 = 3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;8096 = 5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;7777 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;9999 = 4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;7756 = 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;6855 = 3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;9881 = 5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; font-family: inherit; font-style: inherit; font-size: 13px;"&gt;&lt;STRONG&gt;5531 = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;PRE style="font-family: 'Courier 10 Pitch', Courier, monospace; margin: 0 0 19px; color: #666666; font-size: 13px; text-align: center;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt; 2581 = ????&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;source: &lt;A class="active_link" href="http://motleynews.net/2012/03/24/can-you-solve-this-problem/" title="http://motleynews.net/2012/03/24/can-you-solve-this-problem/"&gt;Can You Solve This Problem? &amp;amp;laquo; Motley News and Photos&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, instead of solving this problem with logic, solve it with SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my dirty solution (hidden as white text):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;data have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;array n[4];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;array a[0:9] zero one two three four five six seven eight nine;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;infile cards dlm='2c'x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;input (n1-n4 answer) (:) @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;call pokelong( repeat(put(0,rb8.),9) , addrlong(a[0]) , 80 );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;do x=1 to 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt; a[n&lt;X&gt;]++1;&lt;/X&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;drop x n1-n4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;8,8,0,9,6,7,1,1,1,0,2,1,7,2,0,6,6,6,6,4,1,1,1,1,0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;3,2,1,3,0,7,6,6,2,2,9,3,1,3,1,0,0,0,0,4,2,2,2,2,0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;3,3,3,3,0,5,5,5,5,0,8,1,9,3,3,8,0,9,6,5,7,7,7,7,0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;9,9,9,9,4,7,7,5,6,1,6,8,5,5,3,9,8,8,1,5,5,5,3,1,0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;2,5,8,1,.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;ods exclude all;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;proc reg data=have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt; model answer=zero--nine /noint selection=none;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt; output out=scores p=expected;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;ods exclude none;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;proc print data=scores(firstobs=21) noobs label split='*';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt; var expected;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt; label expected='The Answer is*2581 = ';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;The Answer is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2581&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 16:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100797#M5234</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-21T16:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100798#M5235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I wrote my answer in white below &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ffffff;"&gt;Count the number of loops in the digits. 0, 4, 6, 9 have one loop, 8 has two loops.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;PG&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Well, so much for that trick... Preview shows it all in black :smileylaugh:&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 17:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100798#M5235</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-21T17:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100799#M5236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PG, that's the correct logical solution but this is meant to be a programming exercise... &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 17:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100799#M5236</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-21T17:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100800#M5237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, here is a string based solution :&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;input dig $ @@;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;s = lengthn(trimn(compress(tranwrd(translate(dig,"1&amp;nbsp;&amp;nbsp; 1 1 21","0123456789"),'2','11'))));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;put dig "= " s;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;8809 7111 2172 6666 1111 3213 7662 9313 0000 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;2222 3333 5555 8913 8096 7777 9999 7756 6855 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;9881 5531 2581 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 18:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100800#M5237</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-21T18:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100801#M5238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or we could use REG to figure out the weights for the digits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;242&amp;nbsp; data puzzle;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;243&amp;nbsp; input str $ @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;244&amp;nbsp; score = lengthn(trimn(compress(tranwrd(translate(str,"1&amp;nbsp;&amp;nbsp; 1 1 21","0123456789"),'2','11'))));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;245&amp;nbsp; if str='2581' then score=.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;246&amp;nbsp; array dig(0:9) dig0 - dig9 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;247&amp;nbsp; do _n_=0 to 9; dig(_n_)=0; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;248&amp;nbsp; do _n_=1 to 4; dig(input(substr(str,_n_,1),1.))+1; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;249&amp;nbsp; datalines;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: The data set WORK.PUZZLE has 21 observations and 12 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;253&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;254&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;255&amp;nbsp; proc reg noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;256&amp;nbsp;&amp;nbsp;&amp;nbsp; model score=dig0-dig9 / noint ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;257&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=scores p=expected ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;258&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: The data set WORK.SCORES has 21 observations and 13 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;259&amp;nbsp; data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;260&amp;nbsp;&amp;nbsp;&amp;nbsp; set scores;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;261&amp;nbsp;&amp;nbsp;&amp;nbsp; if score=. then put str= expected= 2. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;262&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;str=2581 expected=2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: There were 21 observations read from the data set WORK.SCORES.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 19:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100801#M5238</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-08-21T19:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100802#M5239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi FE,&lt;/P&gt;&lt;P&gt;Sorry, I looked at the clues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input dig $ @@;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;8809 7111 2172 6666 1111 3213 7662 9313 0000&lt;/P&gt;&lt;P&gt;2222 3333 5555 8913 8096 7777 9999 7756 6855&lt;/P&gt;&lt;P&gt;9881 5531 2581&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data want (keep=dig s);&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;ndig=translate(dig,"1000001021","0123456789");&lt;/P&gt;&lt;P&gt;array _n(*) a1-a4 ;&lt;/P&gt;&lt;P&gt;do i=1 to 4;&lt;/P&gt;&lt;P&gt;_n(i)=substr(ndig,i,1);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;s=sum(of _n(*));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 19:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100802#M5239</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-08-21T19:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100803#M5240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite nice idea Tom. But then you can't guess the weight that 4 would have, since none of the examples contains a 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 19:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100803#M5240</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-21T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100804#M5241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The solutions posted all rely on logically solving the problem first, which is obviously good, but was not really my intention for the exercise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not think you can presume anything for the value of 4 since it does not have training data and can easily break the logical rule depending on the font used to write it (&lt;A href="http://www.enchantedlearning.com/books/howmany/4/0small.GIF" title="http://www.enchantedlearning.com/books/howmany/4/0small.GIF"&gt;http://www.enchantedlearning.com/books/howmany/4/0small.GIF&lt;/A&gt;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 19:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100804#M5241</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-21T19:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100805#M5242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fried, I think there was no alternative to solving the problem logically first. There is no way even a powerful algorithm could have covered all the possibilities offered by the imagination of preschoolers. The solution could have been related to a nursery rime, to cartoon characters, to ways of counting on your fingers, to the difference between consecutive digits, etc. The possibilities are endless. Assigning a value or a weight to each digit explores only a tiny fraction of the solution space. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 15:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100805#M5242</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-22T15:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100806#M5243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PG, I disagree.&amp;nbsp; The problem states it is mathematically based and provides a series of training data.&amp;nbsp; While the logical solution is to count the number of circles present in the numbers the riddle part is that you are told about toddlers and assume there is some sort of outside relationship as you describe.&amp;nbsp; In my opinion the riddle presents a humerus problem solvable through a least squares analysis of the training data which took only a few minutes to write and run in SAS without any need to solve the problem logically beforehand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 19:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100806#M5243</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-09-05T19:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100807#M5244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fried, interesting discussion. What technique would identify the very simple mathematical rule behind the following training set :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8809 = 1&lt;/P&gt;&lt;P&gt;7111 = 0&lt;/P&gt;&lt;P&gt;2172 = 2&lt;/P&gt;&lt;P&gt;6666 = 0&lt;/P&gt;&lt;P&gt;1111 = 0&lt;/P&gt;&lt;P&gt;3213 = 2&lt;/P&gt;&lt;P&gt;7662 = 1&lt;/P&gt;&lt;P&gt;9313 = 0&lt;/P&gt;&lt;P&gt;0000 = 0&lt;/P&gt;&lt;P&gt;2222 = 0&lt;/P&gt;&lt;P&gt;3333 = 0&lt;/P&gt;&lt;P&gt;5555 = 0&lt;/P&gt;&lt;P&gt;8913 = 1&lt;/P&gt;&lt;P&gt;8096 = 2&lt;/P&gt;&lt;P&gt;7777 = 0&lt;/P&gt;&lt;P&gt;9999 = 0&lt;/P&gt;&lt;P&gt;7756 = 1&lt;/P&gt;&lt;P&gt;6855 = 1&lt;/P&gt;&lt;P&gt;9881 = 2&lt;/P&gt;&lt;P&gt;5531 = 0&lt;/P&gt;&lt;P&gt;2581 = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now don't cheat and use logic or intuition &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 22:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100807#M5244</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-09-05T22:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100808#M5245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm with PG on this one. The SAS "solution" posted can only be written by somebody who's already guessed that f(x) might be a sum of individual digit scores. But at that point, they've already done 99% of the heavy lifting. Somebody who has that idea in mind doesn't even need SAS; it's easy enough to figure out the digit values and verify the results by eye.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 01:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100808#M5245</guid>
      <dc:creator>GeoffreyBrent</dc:creator>
      <dc:date>2012-09-06T01:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100809#M5246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are absolutely correct Geoffrey, I came to that conclusion late last night while driving.&amp;nbsp; Sorry for the confusion PG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 12:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100809#M5246</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-09-06T12:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100810#M5247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubt very much this problem, as presented, was solved by any pre-school child, unless they are in the Mensa pre-school. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 14:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100810#M5247</guid>
      <dc:creator>dmorrell</dc:creator>
      <dc:date>2012-09-06T14:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100811#M5248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The part about preschoolers is probably made up, it is simply a subtle way of giving the reader a very good clue. As a side effect, it might contribute to the frustration of those who can't find the answer. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 15:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100811#M5248</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-09-06T15:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100812#M5249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't participated in this discussion, as yet, but unfortunately looked at it while I was waiting for another (long) program to finish running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the part about preschoolers is important, as that limits their capabilities to just counting.&amp;nbsp; As for any solution not assigning a value to 4, I think that is irrelevant as 4 has never been introduced into the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following, I think, mimics the way a preschooler might approach reaching a solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input n1-n4 answer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;8 8 0 9 6&lt;/P&gt;&lt;P&gt;7 1 1 1 0&lt;/P&gt;&lt;P&gt;2 1 7 2 0&lt;/P&gt;&lt;P&gt;6 6 6 6 4&lt;/P&gt;&lt;P&gt;1 1 1 1 0&lt;/P&gt;&lt;P&gt;3 2 1 3 0&lt;/P&gt;&lt;P&gt;7 6 6 2 2&lt;/P&gt;&lt;P&gt;9 3 1 3 1&lt;/P&gt;&lt;P&gt;0 0 0 0 4&lt;/P&gt;&lt;P&gt;2 2 2 2 0&lt;/P&gt;&lt;P&gt;3 3 3 3 0&lt;/P&gt;&lt;P&gt;5 5 5 5 0&lt;/P&gt;&lt;P&gt;8 1 9 3 3&lt;/P&gt;&lt;P&gt;8 0 9 6 5&lt;/P&gt;&lt;P&gt;7 7 7 7 0&lt;/P&gt;&lt;P&gt;9 9 9 9 4&lt;/P&gt;&lt;P&gt;7 7 5 6 1&lt;/P&gt;&lt;P&gt;6 8 5 5 3&lt;/P&gt;&lt;P&gt;9 8 8 1 5&lt;/P&gt;&lt;P&gt;5 5 3 1 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data eliminate (keep=e:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array n[4];&lt;/P&gt;&lt;P&gt;&amp;nbsp; array a[0:9] e0-e9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have end=lastone;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if answer eq 0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a(n(i)) in (.,0) then a(n(i))=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else a(n(i))=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if lastone then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=0 to 9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a(i) ne 0 then a(i)=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ eq 1 then set eliminate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array n[4];&lt;/P&gt;&lt;P&gt;&amp;nbsp; array a[0:9] e0-e9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array recode[4] r1-r4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; recode(i)=a(n(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if recode(i) eq 0 then n(i)=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; test=sum(of recode(*));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if test ne answer then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data commonalities (keep=c:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set test1 (keep=n:) end=lastone;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array common(0:9) c0-c9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array n(4);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=0 to 9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i in n then common(i)+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if lastone then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=0 to 9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if common(i) ne _n_ then common(i)=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else common(i)=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set commonalities;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set eliminate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array n[4];&lt;/P&gt;&lt;P&gt;&amp;nbsp; array e[0:9] e0-e9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array c(0:9) c0-c9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array t(0:9) t0-t9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array recode[4] r1-r4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; recode(i)=e(n(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=0 to 9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if c(i) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=0 to 9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i eq j then t(j)=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else t(j)=e(j);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do k=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; recode(k)=t(n(k));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _test=sum(of recode(*));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _test eq answer then _true=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else _true=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=test2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test2 (keep=t:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set test2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.i then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _total=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; recs=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _total+_true;&lt;/P&gt;&lt;P&gt;&amp;nbsp; recs+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last.i then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _total=recs then output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data answer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input n1-n4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ eq 1 then set test2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array n[4];&lt;/P&gt;&lt;P&gt;&amp;nbsp; array t(0:9) t0-t9;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array recode[4] r1-r4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; recode(i)=t(n(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; answer=sum(of recode(*));&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;2 5 8 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 17:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100812#M5249</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-06T17:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100813#M5250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art,&lt;/P&gt;&lt;P&gt;Very impressive! How long does it take you to come up the code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 17:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100813#M5250</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-09-06T17:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100814#M5251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Linlin: About an hour.&amp;nbsp; It wasn't meant to be impressive, just an attempt to code what may or may not really be a child's thought process.&amp;nbsp; I didn't bother to expand the code to account for additional complexities like what to do if the solution called for point values beyond 0, 1 and 2, as the solution was reached with just considering those possibilities and I don't have ANY plans for putting the code into "production".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 18:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100814#M5251</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-06T18:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100815#M5252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You psychologists...&amp;nbsp; Nice work Art.&amp;nbsp; This is the spirit by which I meant to post the question to receive.&amp;nbsp; I suppose I explained that poorly.&amp;nbsp; I've been on the road for the past 2 weeks, 55 hours behind the wheel so far.&amp;nbsp; Under 10 hours left.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 19:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100815#M5252</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-09-06T19:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: This problem can be solved by pre-school children in 5-10 minutes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100816#M5253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Theres a reason why kids can solve this in less than 5 minutes.&amp;nbsp; I did it in 30 seconds.&amp;nbsp; I dont know how any of you were taught to logically solve problems early but I defnitely saw something like this on IQ tests.&amp;nbsp; This is simply about pattern recognition.&amp;nbsp; The reason why young kids can get this so fast is because its one of the only few forms of math they know at that age.&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P&gt;From this list you can automatically determine that every digit has a place value like binary but this would be something else..im having a brainfart at the moment. Anyway so you can already take all the numbers that equal 0 and assign them all values of 0.&amp;nbsp; So now we have 1=0 2=0 3=0 5=0 7=0 and now we can take another number and figure out its value.&amp;nbsp; so let me try to type it out properly with the value above the number.&amp;nbsp; Keep in mind our goal is to figure out 2851.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right now we have&amp;nbsp; 0+0+?+0=?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp; 5&amp;nbsp; 8&amp;nbsp; 1=?&lt;/P&gt;&lt;P&gt;Now we see that 0000=4 and 9999=4 so we can say that 0 and 9=1&amp;nbsp;&amp;nbsp;&amp;nbsp; Now our list looks as follows:&lt;/P&gt;&lt;P&gt;0=1&lt;/P&gt;&lt;P&gt;1=0&lt;/P&gt;&lt;P&gt;2=0&lt;/P&gt;&lt;P&gt;3=0&lt;/P&gt;&lt;P&gt;4=?&lt;/P&gt;&lt;P&gt;5=0&lt;/P&gt;&lt;P&gt;6=?&lt;/P&gt;&lt;P&gt;7=0&lt;/P&gt;&lt;P&gt;8=?&lt;/P&gt;&lt;P&gt;9=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now we only need 8's value to solve this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8193=3 now expand it.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ?+0+1+0=3&amp;nbsp;&amp;nbsp; 8=2&amp;nbsp; Im sorry but im not going to white this out.&amp;nbsp; if people are smart enough theyd already know the answer before coming here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 10:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/This-problem-can-be-solved-by-pre-school-children-in-5-10/m-p/100816#M5253</guid>
      <dc:creator>Beachguy757</dc:creator>
      <dc:date>2013-04-02T10:12:06Z</dc:date>
    </item>
  </channel>
</rss>

