<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="im"><br></div>
Hi, Kirby.<br><br>
Thanks for mentioning Egyptian fractions.  I think one of the
algorithms for finding them leads to a neat programming exercise on
representing numbers in binary.<br><br>
Given p/q, where q is a prime, first find n such that<br>
2^n &lt; q &lt; 2^(n+1).  Then consider Q = q*(2^n).  Q has a
property that any positive integer below Q can be represented as a sum of
different proper divisors of Q.  In particular, P = p*(2^n) can be
represented that way.  This leads to a representation of p/q = P/Q
as a sum of Egyptian fractions (not necessarily the
&quot;best&quot;).  To find which divisors of Q add up to P use
binary representations of P<tt>//</tt>q and P<tt>%</tt>q.<br><br>
For example p/q = 5/11  ==&gt;  n = 3 ==&gt; Q = 11*(2^3) =
88  ==&gt;<br>
P = 5*(2^3) = 40 = 3 * 11 + 7 = (1 + 2) * 11 + 1 + 2 + 4 
==&gt;<br>
5/11 = 40/88 = 1/8 + 1/4 + 1/88 + 1/44 + 1/22.<br><br></div></blockquote><div><br></div><div>I&#39;m trying to figure out of that&#39;s what&#39;s going on in Eppstein&#39;s code, which includes some from me:</div><div><br>
</div><div><a href="http://www.ics.uci.edu/~eppstein/numth/egypt/egypt.py">http://www.ics.uci.edu/~eppstein/numth/egypt/egypt.py</a> </div><div><br></div><div>Milo reminds us on mathfuture that these weren&#39;t academic pursuits for the Egyptians so much as a way of divvying up grain, other dry and liquid goods, in containers of known trusted quantities, and these tended to come in 1/something, i.e. as unit fractions.  </div>
<div><br></div><div>You could pour multiple scoops of 1/88 of course, but when it comes to storage, each capsule of wheet and/or pepper needs to have a unit fraction clearly marked.  </div><div><br></div><div>These could then be aggregated and swapped in ways that made sense the The Temple (an abstraction, used for bookkeeping purposes, similar to The House in Casino Math).</div>
<div><br></div><div>His case that the solutions weren&#39;t algorithmic is really just that they weren&#39;t exclusively algorithmic, and that where many recipes yield possible results, it&#39;s up to the &quot;chef&quot; to decide what&#39;s savory.  </div>
<div><br></div><div>That&#39;s not a job best left to mere computers, even of the human variety.  </div><div><br></div><div>Gotta have a nose, like chief taster for Jack Daniels (a chiefdom in some ways -- took the tour in Lynchburg that time, a side trip of the main road from Chatanooga to Nashville).</div>
<div><br></div><div>Good hearing from ya.</div><div><br></div><div>Ed, if you&#39;re listening, I made more waves around baseball stats as the core database for our SQL teaching courses (includes languages using DBAPI), might be on the agenda next staff meeting.</div>
<div><br></div><div>People get mixed messages about SQL:  that it was designed for end users (ala MS Access), or that it&#39;s for highly skilled DBAs only, with all kinds of certification?</div><div><br></div><div>Schooling is about reducing the intimidation factor.</div>
<div><br></div><div>Kirby</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>
The number of fractions in this method does not exceed the number of
proper divisors of Q, which is 2n+1<br>
which is less than 2 * log[base 2](q) + 1 -- not too bad.  The
denominators of the fractions are below q^2.<br><br>
Gary Litvin<br>
<a href="http://www.skylit.com/" target="_blank">www.skylit.com<br>
</a></div>

</blockquote></div><br>