[Year 12 SofDev] An algorithm puzzler for your kids (and you?)

Mark Kelly kel at mckinnonsc.vic.edu.au
Sat Mar 10 20:28:46 EST 2007


O, Robert!  You really ought to take Margaret out dancing.

Sitting in the dark running 100 million algorithm iterations on a 
Saturday night can't be much fun!

:-)

Mark

Timmer-Arends wrote:
> Hello Mark and Robert
> 
>> Robert Hind wrote: =(ROUNDUP(n*4,0)/4)
>> Mark Kelly wrote: =(-INT(-n*4)/4)
> 
> I switched Excel to manual recalc then created a small macro that in effect
> presses F9 (recalc) one million times.
> The results for 5 runs each:
> RH: 32.31s, 34.37s, 30.10s, 34.48s, 33.86s
> MK (student?): 33.98s, 33.98s, 34.12s, 34.72s, 34.86s
> 
> Given that Excel runs in a multitasking environment where goodness knows
> what other processes get a look in while the calcs are happening probably
> explains the slight variation in times, but I'd say there's not much 
> between
> the two.
> 
> Just for interest I dragged out an old copy of TurboPascal. Because it runs
> in DOS mode times were much more consistent:
> Also I could only try out the INT version since TP doesn't have a RoundUp
> function.
> The result: 100 million iterations (yes 100 million): 43.9s
> 
> That makes Excel in the order of 100 times slower than compiled code! (and
> that's old 8086 code what's more.) Just goes to show the overheads in Excel
> and Windows generally.
> 
> It would be interesting to get some times for a compiled VB program.
> 
> Regards
> Robert T-A
> Brighton SC
> 
> 
> ----- Original Message ----- From: "Mark Kelly" <kel at mckinnonsc.vic.edu.au>
> To: "Year 12 Software Development Teachers' Mailing List"
> <sofdev at edulists.com.au>
> Sent: Friday, March 09, 2007 5:40 PM
> Subject: Re: [Year 12 SofDev] An algorithm puzzler for your kids (and you?)
> 
> 
>> 3 solutions for the price of one!
>>
>> Just goes to show the many ways an algorithm can take shape.
>>
>> Would be interesting to iterate each one a million times to compare
>> relative execution speeds...
>>
> 
> 
> _______________________________________________
> http://www.edulists.com.au
> IT Software Development Mailing List kindly supported by
> http://www.vcaa.vic.edu.au - Victorian Curriculum and Assessment 
> Authority and
> http://www.vitta.org.au  - VITTA Victorian Information Technology 
> Teachers Association Inc
> 
> 

-- 
Mark Kelly
Manager - Information Systems
McKinnon Secondary College
McKinnon Rd McKinnon 3204, Victoria, Australia
Direct line / Voicemail: 8520 9085
School Phone +613 8520 9000 << new number!
School Fax   +613 9578 9253

Webmaster - http://www.mckinnonsc.vic.edu.au
IT Lecture notes: http://vceit.com
Moderator: IPM Mailing List

Doctor - We must all face reality sooner or later.
Dowd   - I wrestled with reality for 35 years, doctor, and I'm happy to 
say I won out over it.  ('Harvey', 1950)




More information about the sofdev mailing list