[Edu-sig] Brute force solutions

Kirby Urner urnerk at qwest.net
Wed Sep 21 18:31:41 CEST 2005

> (Yes, I know the original version wasn't claimed to be optimized, but it
> was crying to be optimized...)

Yes.  This is a valuable addition to the thread.  Thanks for taking the

Reminds me of when Tim Peters used to swing by in the early days of edu-sig
and optimize the hell out of my algorithms.

I just agreed to teach Python to 8th graders for 9 weeks (one session per
week) in my daughter's school, starting in November.  There's a good chance
I'll be using this phi stuff.  

Mine original draft makes sense to set the stage, cuz the reasoning is so
dang primitive.  Yours adds a layer of sophistication more reflective of how
real world programmers learn to squeeze the most out of their cycles.

Of course all of this requires temporarily ignoring the fact that algebraic
methods give us a way to compute phi as simply (1 + math.sqrt(5))/2.0.


More information about the Edu-sig mailing list