mm-4259 === Subject: Re: Skybuck's Third (64 bit) Prime Finder (with start and stop range) Frederick Williams Skybuck's Third (64 bit) Prime Finder (with start and stop range): > Find's all prime numbers between start and stop range. > *** Begin of Code *** > procedure PrimeFinder3( Start, Stop : uint64 ); > var > P : uint64; > Test : uint64; > Prime : boolean; > begin > writeln('Primes found:'); > P := Start; > while P <= Stop do > begin > Prime := true; > Test := 2; > while Test < P do > begin > if P mod Test = 0 then > begin > Prime := false; > break; > end; > Test := Test + 1; So you're considering _every_ integer less than P (and greater than 1) > as a possible divisor even though you know that X > sqrt(P) can't > possibly divide P? ? > end; > if Prime then > begin > writeln( P ); > end; > P := P + 1; So you're considering every integer 'twixt Start and Stop even though > you know that half of them are divisible by two? 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30 Indeed all divideable by 2. However that would make 2 a prime. I guess I can skip 2 or something. So then the only remaining values to check are the odd values. Speed up of 100% nice =D Bye, Skybuck :) === Subject: Re: Skybuck's Third (64 bit) Prime Finder (with start and stop range) > However that would make 2 a prime. 2 is a prime -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: Re: Skybuck's Third (64 bit) Prime Finder (with start and stop range) However that would make 2 a prime. 2 is a prime Indeed. -- Rudy Velthuis http://rvelthuis.de Smith & Wesson - the original point and click interface. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) Skybuck's PrimeFinder5 :) 100% speed up compared to previous version LOL. Even numbers skipped. (always divisible by 2) Odd numbers examined. // *** Begin of Code *** procedure PrimeFinder5( Start, Stop : uint64 ); var P : uint64; Test : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; Test := 2; while Test < P do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 1; end; if Prime then begin writeln( P ); end; P := P + 2; end; end; // *** End of Code *** Bye, Skybuck. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) Skybuck's PrimeFinder5 :) 100% speed up compared to previous version LOL. Even numbers skipped. (always divisible by 2) Odd numbers examined. // *** Begin of Code *** procedure PrimeFinder5( Start, Stop : uint64 ); > var > P : uint64; > Test : uint64; > Prime : boolean; > begin > writeln('Primes found:'); P := Start; // if P is even then make it odd. > // all even numbers are not primes (divisible by 2) > if P mod 2 = 0 then > begin > P := P + 1; > end; while P <= Stop do > begin > Prime := true; Test := 2; > while Test < P do > begin > if P mod Test = 0 then > begin > Prime := false; > break; > end; > Test := Test + 1; > end; How about: Test := 3; if P mod 2 = 0 then Prime := false else while Test < p do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; which gives you another 100% improvement. For extra points, work out where to put a Sqrt() and a couple of other minor changes to get improvements of more than 10,000% when Start and Stop exceed 1,000,000 Mike if Prime then > begin > writeln( P ); > end; P := P + 2; > end; > end; // *** End of Code *** Bye, > Skybuck. > === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) > says... > Skybuck's PrimeFinder5 :) > 100% speed up compared to previous version LOL. > Even numbers skipped. (always divisible by 2) > Odd numbers examined. > // *** Begin of Code *** > procedure PrimeFinder5( Start, Stop : uint64 ); > var > P : uint64; > Test : uint64; > Prime : boolean; > begin > writeln('Primes found:'); > P := Start; > // if P is even then make it odd. > // all even numbers are not primes (divisible by 2) > if P mod 2 = 0 then > begin > P := P + 1; > end; > while P <= Stop do > begin > Prime := true; > Test := 2; > while Test < P do > begin > if P mod Test = 0 then > begin > Prime := false; > break; > end; > Test := Test + 1; > end; How about: Test := 3; > if P mod 2 = 0 then > Prime := false > else > while Test < p do > begin > if P mod Test = 0 then > begin > Prime := false; > break; > end; > Test := Test + 2; > end; which gives you another 100% improvement. For extra points, work out where to put a Sqrt() and a couple of other > minor changes to get improvements of more than > 10,000% when Start and Stop exceed 1,000,000 Ah I get it ;) Sqrt( 1 000 000 ) = 1000. Could be used to detect the bigger cases... Routine still needs longgggg time to detect a real prime. Is there some way to detect a real prime without looking at lots of values ? ;) Bye, Skybuck. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) <4693BDFE.D149C318@antispamhotmail.co.uk.invalid> Routine still needs longgggg time to detect a real prime. Perhaps you need a more efficient method??? Nah! Is there some way to detect a real prime without looking at lots of values ? Yes there is. Perhaps you might benefit from studying this subject? See, for example, Candall & Pomerance, Prime Numbers, A computational Perspective Bressoud, Factorization and Primality Testing What it is that compels people on USENET to prattle about subjects that they have never studied????? I've been trying to understand this phenomenon for years... :-) === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) Bytes: 2760 > What it is that compels people on USENET to prattle about subjects > that they have never studied? Only some people, like the flying Skyfart, who thinks he is God's gift to humanity while constantly reinventing the wheel. -- Rudy Velthuis http://rvelthuis.de Biologically speaking, if something bites you it's more likely to be female. -- Desmond Morris. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) Lol, Just want some simple ideas which I can understand. So far it's going well LOL. Don't wanna spent a whole study on it ;) Bit by bit is just fine :) Bye, Skybuck. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) > For extra points, work out where to put a Sqrt() and a couple of other > minor changes to get improvements of more than > 10,000% when Start and Stop exceed 1,000,000 Ah I get it ;) Sqrt( 1 000 000 ) = 1000. Could be used to detect the bigger cases... Neh that can't be it. All larger values would have been detected because div 2 or so... or div something else... But because they are gone now... they not even tested... So why add sqrt ? Maybe some other purpose ? Bye, Skybuck. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) Oh well... I guess one sqrt test could be added for each p... just once. To immediately get rid of large p's that are not prime for example. Very large prime * Very large prime = Very very Large number <- which is not prime. So it could take long to detect these longer very very large numbers as not being prime. So the squart could get rid of those real quick ;) Bye, Skybuck. === Subject: Re: Skybuck's Fith (64 bit) Prime Finder (with start and stop range,only odds examined) Skybuck Flying skrev i melding > Oh well... I guess one sqrt test could be added for each p... just once. To immediately get rid of large p's that are not prime for example. Very large prime * Very large prime = Very very Large number <- which is > not prime. So it could take long to detect these longer very very large numbers as > not being prime. So the squart could get rid of those real quick ;) Bye, > Skybuck. > Hi. I can give you a hint: a * b = b * a Karl-Olav Nyberg === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) Indeed. Skybuck's Sixth prime finder. *** Begin of Code *** // another 100% speed up compared to previous procedure PrimeFinder6( Start, Stop : uint64 ); var P : uint64; Test : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; if P = 2 then begin writeln( p ); end; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; // don't need to divide by 2 that test already done elsewhere so all those // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 // only even numbers would return zero for those... // even numbers already illiminated from test. // so don't need to test for these divisors anymore. // except for 2. Test := 3; while Test < P do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; if Prime then begin writeln( P ); end; P := P + 2; end; end; *** End of Code *** > For extra points, work out where to put a Sqrt() and a couple of other > minor changes to get improvements of more than > 10,000% when Start and Stop exceed 1,000,000 Hmmmmmmmmm... I'll have to think about that one some more. Me don't like floating point numbers. Bye, Skybuck. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) Bytes: 4331 | Indeed. | | Skybuck's Sixth prime finder. | | | *** Begin of Code *** | | // another 100% speed up compared to previous | procedure PrimeFinder6( Start, Stop : uint64 ); | var | P : uint64; | Test : uint64; | Prime : boolean; | begin | writeln('Primes found:'); | | P := Start; | | | if P = 2 then | begin | writeln( p ); | end; | | // if P is even then make it odd. | // all even numbers are not primes (divisible by 2) | if P mod 2 = 0 then | begin | P := P + 1; | end; | | while P <= Stop do | begin | Prime := true; | | // don't need to divide by 2 that test already done elsewhere so all those | // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 | // only even numbers would return zero for those... | // even numbers already illiminated from test. | // so don't need to test for these divisors anymore. | // except for 2. | | Test := 3; | while Test < P do | begin | if P mod Test = 0 then | begin | Prime := false; | break; | end; | Test := Test + 2; | end; | | if Prime then | begin | writeln( P ); | end; | | P := P + 2; | end; | end; | | *** End of Code *** | | > For extra points, work out where to put a Sqrt() and a couple of other | > minor changes to get improvements of more than | > 10,000% when Start and Stop exceed 1,000,000 | | Hmmmmmmmmm... | | I'll have to think about that one some more. | | Me don't like floating point numbers. You don't need floating point numbers to find the ISQRT (integer squart root) of an integer number. The function below computes the integer squart root of a non-negative integer. I coded it in REXX as In REXX, the WHILE clause is evaluated and tested before each DO loop iteration. % (percent) is integer divide. All variables (here) are integers. The ISQRT function returns the floor of the SQRT of an integer number. ISQRT(63) = 7 ISQRT(64) = 8 ISQRT(65) = 8 ISQRT(80) = 8 ISQRT(81) = 9 isqrt: procedure; parse arg x; q=1 do while q<=x q=q*4 end r=0 do while q>1 q=q%4; _=x-r-q; r=r%2 if _>=0 then do x=_ r=r+q end end return r No check is made to see if X is negative. __________________________________________Gerard S. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) Converted to Delphi seems working. Now me thinks... does this make sense to use in the prime finder... Yeah me think so: For example: Psquarted := ISQRT(P); if Psquarted * Psquarted = P then begin prime := false; end; Gonna update my prime finder. Hopefully ISQRT much faster than SQRT.. me don't know about that though. But I like ISQRT though... much more accurate... floating point <- yaaaakkkk ;) :) yeeahahahaahehehahaha. // *** Begin of Code *** program Project1; {$APPTYPE CONSOLE} { Integer Sqrt. Original Rexx Code by Gerard Schildberger Converted to Delphi by Skybuck Flying. version 0.01 created on 11 july 2007 by Skybuck Flying. 3 tests done... working ok so far.. more testing needs to be done though, to be sure ;) and to spot any weaknesses or problems which it might have ;) } uses SysUtils; { Rexx code by Gerard Schildberger isqrt: procedure; parse arg x; q=1 do while q<=x q=q*4 end r=0 do while q>1 q=q%4; _=x-r-q; r=r%2 if _>=0 then do x=_ r=r+q end end return r } function ISQRT( X : longword ) : longword; var q : integer; r : integer; something : integer; begin q := 1; while q <= x do begin q := q * 4; end; r := 0; while q > 1 do begin q := q div 4; something := x - r - q; r := r div 2; if something >= 0 then begin x := something; r := r + q; end; end; result := r; end; begin writeln( ISQRT(25) ); // should print 5, it DOES LOL... coool =D fluke of luck maybe ? ;) writeln( ISQRT(144) ); // should print 12, YUP it does... ok third's a charm writeln( ISQRT(12345*12345) ); // YUP, WE HAVE A WINNER =D, more testing will be done later. // THANKS BUDDY ;) readln; end. // *** End of Code *** Bye, Skybuck. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) Little improvement possibly, No need for the extra variable: > Psquarted := ISQRT(P); if Psquarted * Psquarted = P then > begin > prime := false; > end; Replaced with: if Sqr( ISQRT(P) ) = P then begin prime := false; end; Bye, Skybuck. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) if Sqr( ISQRT(P) ) = P then > begin > prime := false; > end; Bye, > Skybuck. What are you doing this for? You need the square root of P because, using trial division, you only need to test if X divides P for X less than the square root of P. Whether Sqr(ISQRT(P)) equals P is not relevant to that is it? -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) ... you only need to test if X divides P for X less > than the square root of P. Sorry: less than or equal. -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) Oi. It has little bug. 2 not detected as prime... oh-oh ;) =D Bye, Skybuck. === Subject: Re: Skybuck's Sixth (64 bit) Prime Finder (with start and stop range,only odds numbers examined, only odd divisors used) bug 2 fixed. BUG BUG fixed ;) 2 is now also found as prime. 1 seems to obey rules for primes... but maybe 1 is exception ? *** Begin of Code *** // another 100% speed up compared to previous procedure PrimeFinder6( Start, Stop : uint64 ); var P : uint64; Test : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; if P <= 2 then begin writeln('1'); // is 1 a prime, or is it special case ? (not that I care oh well;)) writeln('2'); P := 3; end; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; // don't need to divide by 2 that test already done elsewhere so all those // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 // only even numbers would return zero for those... // even numbers already illiminated from test. // so don't need to test for these divisors anymore. // except for 2. Test := 3; while Test < P do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; if Prime then begin writeln( P ); end; P := P + 2; end; end; *** End of Code **** Bye, Skybuck. === Subject: Skybuck's Seventh (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, and sqrt for speedup) suggestions. Huge speed up for large ranges. *** Begin of Code *** // unknown but big (?) speed up when searching large range. procedure PrimeFinder7( Start, Stop : uint64 ); label LabelNextP; var P : uint64; Test : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; if P <= 2 then begin writeln('1'); // is 1 a prime, or is it special case ? (not that I care oh well;)) writeln('2'); P := 3; end; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; // don't need to divide by 2 that test already done elsewhere so all those // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 // only even numbers would return zero for those... // even numbers already illiminated from test. // so don't need to test for these divisors anymore. // except for 2. // hopefully frac will always be a clean zero when sqrt can be done perfeclty ;):) if Frac( Sqrt(P) ) = 0 then begin Prime := false; goto LabelNextP; end; Test := 3; while Test < P do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; if Prime then begin writeln( P ); end; LabelNextP: P := P + 2; end; end; *** End of Code *** Bye, Skybuck. === Subject: Re: Skybuck's Seventh (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, and sqrt for speedup) Types for ISQRT changed to int64 (that will probably slow it down somewhat :)) just in case: *** Begin of Code *** function ISQRT( X : int64 ) : int64; var q : int64; r : int64; something : int64; begin q := 1; while q <= x do begin q := q * 4; end; r := 0; while q > 1 do begin q := q div 4; something := x - r - q; r := r div 2; if something >= 0 then begin x := something; r := r + q; end; end; result := r; end; *** End of Code *** Bye, Skybuck. === Subject: Re: Skybuck's Seventh (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, and sqrt for speedup) Bytes: 2938 Types for ISQRT changed to int64 (that will probably slow it down somewhat > :)) just in case: *** Begin of Code *** function ISQRT( X : int64 ) : int64; > var > q : int64; > r : int64; > something : int64; > begin > q := 1; > while q <= x do > begin > q := q * 4; > end; r := 0; while q > 1 do > begin > q := q div 4; something := x - r - q; r := r div 2; if something >= 0 then > begin > x := something; > r := r + q; > end; > end; > result := r; > end; *** End of Code *** Why are you bothering? If you're using trial division, just trial-divide up to sqrt(thing) and use whatever version of sqrt Delphi gives you. If you're worried about efficiency you shouldn't be using trail division anyway. -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: Re: Skybuck's Eightth (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, and ISQRT for speedup) Skybuck's Eightth Prime Finder LOL. the ISQRT code. For more accurate results and probably also a bit faster ! ;) No measurements in place yet... just visual inspection ;) *** Begin of Code *** function ISQRT( X : longword ) : longword; var q : integer; r : integer; something : integer; begin q := 1; while q <= x do begin q := q * 4; end; r := 0; while q > 1 do begin q := q div 4; something := x - r - q; r := r div 2; if something >= 0 then begin x := something; r := r + q; end; end; result := r; end; // Floating point SQRT replaced with ISQRT // probably a bit faster than previous version // no measurements in place yet, just visual inspection :) procedure PrimeFinder8( Start, Stop : uint64 ); label LabelNextP; var P : uint64; Test : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; if P <= 2 then begin writeln('1'); // is 1 a prime, or is it special case ? (not that I care oh well;)) writeln('2'); P := 3; end; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; // don't need to divide by 2 that test already done elsewhere so all those // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 // only even numbers would return zero for those... // even numbers already illiminated from test. // so don't need to test for these divisors anymore. // except for 2. // hopefully frac will always be a clean zero when sqrt can be done perfeclty ;):) // floating point <- yakky. { if Frac( Sqrt(P) ) = 0 then begin Prime := false; goto LabelNextP; end; } // integers jummy. if Sqr( ISQRT(P) ) = P then begin Prime := false; goto LabelNextP; end; Test := 3; while Test < P do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; if Prime then begin writeln( P ); end; LabelNextP: P := P + 2; end; end; *** End of Code *** Bye, Skybuck. === Subject: Re: Skybuck's Eightth (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, and ISQRT for speedup) > writeln('1'); // is 1 a prime, or is it special case ? (not that I care > oh well;)) This is truly bizarre. You are writing a program to o/p primes and you don't know or care what a prime is? The answer is 1 is not a prime and your code doesn't need to do anything special to deal with it. -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: Re: Skybuck's Eightth (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, and ISQRT for speedup) > Skybuck's Eightth Prime Finder LOL. > Here is another hint. If you want to know if 101 is prime and you try testing with 101 mod 2, 101 mod 3, 101 mod 5, 101 mod 7, etc. Where can you stop? Do you have to go all the way to 101 mod 98, 101 mod 99, 101 mod 100, or can you stop sooner. If x has two divisors only, i.e x=y*z, how big can the _smallest_ of y and z be? And another hint. You only need to add the lines: q : integer; q := trunc(sqrt(P)); and change the second below (by one letter) to make your function thousands of times faster for numbers in the range of 1 million. > Test := 3; > while Test < P do //this line here needs a single letter changed > begin > if P mod Test = 0 then > begin > Prime := false; > break; > end; > Test := Test + 2; > end; *** End of Code *** Bye, > Skybuck. > Good luck, Mike === Subject: Re: Skybuck's nineth (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, ISQRT, TestStop := P div 3 for speedup) > says... > Skybuck's Eightth Prime Finder LOL. > Here is another hint. If you want to know if 101 is prime and you try > testing with > 101 mod 2, > 101 mod 3, > 101 mod 5, > 101 mod 7, etc. > Where can you stop? Do you have to go all the way to > 101 mod 98, > 101 mod 99, > 101 mod 100, > or can you stop sooner. If x has two divisors only, i.e x=y*z, how big can the _smallest_ of y and > z be? At least the upper half doesn't need to be tested. 100 div 51 to 99 always is 1 with a remainder greater than zero. But since div 50 would be the same as div 2 even that test can be skipped. So final answer: 100 div (100 div 3). Only one third of the range has to be tested. 100 div 3 to 100 div 33. Or the answer to your question would be: 101 div 3 to 101 div (101 div 3) 101 div 3 to 101 div 33 (Though you answer below seems to be integer part of (sqrt(p)), i ll try that in version 10 ) Tried to explain it in the comments below as well... not too super... but will have to do ;) The example is most clear I think. *** Begin of Code *** the first one third // The upper half of P can be ignored for the test because dividing by half P would give result 2 and mod zero. // Vice versa P div 2 would be half P and all those numbers can't be primes. // Since we skip dividing by 2 in general, even more tests can be skipped by dividing P by 3 and using that as the test range. // In other words the upper test ranges of the previous test where simply way too large and redundant and unnecessary to test. //Example: { 50 div/mod 49 = 1 = 1 50 div/mod 48 = 1 = 2 50 div/mod 47 = 1 = 3 50 div/mod 46 = 1 = 4 50 div/mod etc 50 div/mod 25 = 2 = 0 So testing all those upper values is useless, always div=1, mod remainder. Only till 25 is it div=2, mod=0. And even that test is skipped. 50 div/mod 24 = 2 = 2 50 div/mod 23 = 2 = 4 50 div/mod 22 = 2 = 6 50 div/mod 21 = 2 = 8 etc ^^ skipped So finally these are tested: 50 div/mod 16 = 3 = 2 50 div/mod 15 = 3 = 5 etc 50 div/mod 10 = 5 = 0 } procedure PrimeFinder9( Start, Stop : uint64 ); label LabelNextP; var P : uint64; Test : uint64; TestStop : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; if P <= 2 then begin writeln('1'); // is 1 a prime, or is it special case ? (not that I care oh well;)) writeln('2'); P := 3; end; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; // don't need to divide by 2 that test already done elsewhere so all those // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 // only even numbers would return zero for those... // even numbers already illiminated from test. // so don't need to test for these divisors anymore. // except for 2. // hopefully frac will always be a clean zero when sqrt can be done perfeclty ;):) // floating point <- yakky. { if Frac( Sqrt(P) ) = 0 then begin Prime := false; goto LabelNextP; end; } // integers jummy. if Sqr( ISQRT(P) ) = P then begin // Prime := false; // value assigned to prime never used. goto LabelNextP; end; Test := 3; TestStop := P div 3; while Test < TestStop do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; if Prime then begin writeln( P ); end; LabelNextP: P := P + 2; end; end; *** End of Code *** And another hint. You only need to add the lines: q : integer; q := trunc(sqrt(P)); and change the second below (by one letter) to make your function > thousands of times faster for numbers in the range of > 1 million. Ok... I'll try that in a 10th version. Maybe sqrt even better than div 3 ;) > Test := 3; > while Test < P do //this line here needs a single letter changed > begin > if P mod Test = 0 then > begin > Prime := false; > break; > end; > Test := Test + 2; > end; > *** End of Code *** > Bye, > Skybuck. > Good luck, > Mike Bye, Skybuck. === Subject: Re: Skybuck's 10th (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, ISQRT, TestStop := ISQRT(P) for 1 million procent speedup) Yup, Implemented Mike's TestStop := Sqrt(P); improvement suggestion. A speed up of 1 million procent at least ! WOW :) *** Begin of Code *** { Example why ISQRT(P) is much better than P div 3 for the test stop: 1000.000.000 div 3 = 333.333.333 SQRT(1000.000.000 ) = 31.622 ((333.333.333 div 31.622) -1) * 100% = 1.054.100% speed improvement !!!! HOLY. SUPER BIG SPEED IMPROVEMENT. } procedure PrimeFinder10( Start, Stop : uint64 ); label LabelNextP; var P : uint64; Test : uint64; TestStop : uint64; Prime : boolean; begin writeln('Primes found:'); P := Start; if P <= 2 then begin writeln('1'); // is 1 a prime, or is it special case ? (not that I care oh well;)) writeln('2'); P := 3; end; // if P is even then make it odd. // all even numbers are not primes (divisible by 2) if P mod 2 = 0 then begin P := P + 1; end; while P <= Stop do begin Prime := true; // don't need to divide by 2 that test already done elsewhere so all those // divisors illiminated... div 2, div 4, div 6, div 8, div 10, div 12 // only even numbers would return zero for those... // even numbers already illiminated from test. // so don't need to test for these divisors anymore. // except for 2. // hopefully frac will always be a clean zero when sqrt can be done perfeclty ;):) // floating point <- yakky. { if Frac( Sqrt(P) ) = 0 then begin Prime := false; goto LabelNextP; end; } // integers jummy. if Sqr( ISQRT(P) ) = P then begin // Prime := false; // value assigned to prime never used. goto LabelNextP; end; Test := 3; // TestStop := P div 3; TestStop := ISQRT(P); while Test < TestStop do begin if P mod Test = 0 then begin Prime := false; break; end; Test := Test + 2; end; if Prime then begin writeln( P ); end; LabelNextP: P := P + 2; end; end; *** End of Code *** Bye, Skybuck. === Subject: Re: Skybuck's 10th (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, ISQRT, TestStop := ISQRT(P) for 1 million procent speedup) Yup, Implemented Mike's TestStop := Sqrt(P); improvement suggestion. So you're considering _every_ integer less than P (and greater than 1) as a possible divisor even though you know that X > sqrt(P) can't possibly divide P? -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: Re: Skybuck's 10th (64 bit) Prime Finder (with start/stop range,only odd numbers examined, only odd divisors used, ISQRT, TestStop := ISQRT(P) for 1 million procent speedup) <4693BDFE.D149C318@antispamhotmail.co.uk.invalid> This entire thread is stupid. It is pointless to discuss how to make improvements in a prime testing algorithm based on trial division, because: (1) *Much* faster algorithms are known. (2) You are re-inventing something that is already known; This algorithm has been well known for a VERY long time and has been extensively optimized already. (3) It puts the cart before the horse. The first step in implementing an arithmetic procedure is to READ what is already known and then to select the right method. === Subject: Re: Craps Probability Question > Nevertheless, if you had to bet on a single outcome > as opposed to a set of outcomes (such as one, two > or three rolls), the one to bet on is 1 roll. > Well yes: The probability that it takes exactly n rolls for a 7 to > appear is 5^(n-1)/6^n, a strictly decreasing function of n.- Hide quoted > text - > - Show quoted text - So, which it? Does a 7 appear after 4 rolls more often, and less on > rolls 1, 2, and 3, or more on the first roll and decreasingly on each > subsequent roll, like the craps simulator in the earlier post shows? > There is considerable ambiguity in the expression after four rolls. Does a 7 appear within 100 rolls more often than it appears within one roll, two rolls, etc? yes, obviously. Does a 7 appear on the hundredth roll more often that it does on the first? No. Is a 7 more likely to appear for the first time on the 100th roll than on the first roll? Definitely not. The probability of a 7 appearing on the 100th roll is still 1/6, but the chance that the other 99 rolls did not include a 7 is pretty small. === Subject: Re: Commentary - Drill & Kill Bytes: 3354 >The complete commentary is posted at: >http://vormath.info/WordPress1/ >July 6, 2007 >Drill & Kill Math - Travell Style >Site Commentary - Drill & Kill. >I had never heard of the saying drill & kill until I started reading >and researching the history behind the math debate. A debate that is >tied forever to the 1989 release of math standards developed by the >private organization, NCTM, and the subsequent development of math >curricula material with funds through NSF grants. >I have heard and I do subscribe to the adage of practice, practice, >practice. SOME practice is useful, but practice after understanding has been attained only hones skills. While skills in mathematics are useful, without understanding they can only be used in previously taught situations, and even worse, they may make it difficult to achieve understanding. As a teaching tool, most of the assigned work should be problems which will involve thinking, not doing problems which are sheer memorization or routine. Memorizing the multiplication table can be useful, but not enlightening; having the student construct it from principles gives the enlightenment, and will help in using it later, especially if some of it has been forgotten. >What I find interesting is the phrase, drill & kill, is always used >by the pro-reform or pro-NCTM standards side of the math debate as to >what the traditional way of math was and what the REFORM math is >not. Drill and kill is appropriate; the one who already understands it does not need cheap drill, and can be turned off by it. The one who does not yet understand it can end up being disabled from understanding by the drill. Try teaching current or prospective teachers the conceptS (plural emphasized) associated with the integers and the operations on them; that they can add and multiply makes it harder for them to learn the basic concepts. >Yet, here is an example and its not from a school utilizing a >traditional math program. It is from a school with a fuzzy NCTM based >curriculum. A district curriculum that was cut & pasted from poorly >rated state standards (but thats another story). >... -- This address is for information only. I do not claim that these views are those of the Statistics Department or of Purdue University. Herman Rubin, Department of Statistics, Purdue University hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558 === Subject: Re: Commentary - Drill & Kill has been attained only hones skills. While skills in > mathematics are useful, without understanding they can > only be used in previously taught situations, and even > worse, they may make it difficult to achieve understanding. Excuse me?! If I hone my skills it may make it more difficult to acheive understanding? Exactly how? It is easy to see how a lack of skill can impede understanding - for example if my students are unable to perform operations with fractions, it makes it more difficult to extend the idea of common denominators to rational functions, or if my students do not know how to perform long division, they will have difficulty learning synthetic division. I have noticed that these difficulties remain *even if they manage to 'discover' another algorithm of their own. Why- because the algorithms we expect students to learn for adding rational functions or performing synthetic division are exactly those used with adding fractions or performing long division. So - how does a greater level of skill impede understanding? I have noticed that those students with a higher degree of skill in computation consistently understand the underlying concepts to a higher degree than those that do not. I have never seen a counterexample- but admittedly, I have only taught around 60-70 students to date. > Drill and kill is appropriate; the one who already > understands it does not need cheap drill, and can be > turned off by it. Very true- which is why part of our job as instructors is to identify these students and give them something at a higher level to practice doing. > The one who does not yet understand it can end up being > disabled from understanding by the drill. How? This is the part of your thesis that I do not understand. > Try teaching current or prospective teachers the conceptS > (plural emphasized) associated with the integers and the > operations on them; that they can add and multiply makes > it harder for them to learn the basic concepts. Strangely, I thought that the operations of addition and multiplications *were* the basic concepts of integer arithmetic. What would you say the basic concepts are? The fact that addition and multiplication are associative? Don't the students need to know what addition and multiplication *are* before we can reasonably talk about the *properties* of addition and multiplication? (Much less talking about the extensions of those properties to abstract binary operations). Should we teach the concept of 'successor' before teaching addition? (And the rest of the Peano postulates)? Why not skip that and start everyone off with category theory first (from which we can 'derive' the Peano postulates, and thence the rest of the properties of the integers? If not- why not? What level of abstraction is the appropriate level to start teaching students? And really- this is all academic. I have been lurking for the last couple of months as I see Dom post something and a bunch of people respond to it, but I have not seen any discussion of what it is we expect students to be able to do with their mathematics instruction when they leave high school. cheers- Eric === Subject: Re: Commentary - Drill & Kill It is unfortunate that investigative math and discovery are implemented so poorly. They are vital to understanding math, but only way AFTER complete mastery of basic facts. Historically, people who make important math discoveries know how to multiply. For people looking for a simple, afordable set of worksheets to teach basic math to you students or kids, I find the books at http://www.thinkerpress.com/books.html are simple yet effective. Contains different levels of problems for both challenging and remedial help. Good luck! > The complete commentary is posted at: http://vormath.info/WordPress1/ July 6, 2007 > Drill & Kill Math - Travell Style > Site Commentary - Drill & Kill. I had never heard of the saying drill & kill until I started reading > and researching the history behind the math debate. A debate that is > tied forever to the 1989 release of math standards developed by the > private organization, NCTM, and the subsequent development of math > curricula material with funds through NSF grants. I have heard and I do subscribe to the adage of practice, practice, > practice. What I find interesting is the phrase, drill & kill, is always used > by the pro-reform or pro-NCTM standards side of the math debate as to > what the traditional way of math was and what the REFORM math is > not. Yet, here is an example and its not from a school utilizing a > traditional math program. It is from a school with a fuzzy NCTM based > curriculum. A district curriculum that was cut & pasted from poorly > rated state standards (but thats another story). > ... === Subject: Re: Reform math draws criticism >David Klein, professor of mathematics at California State University, >Northridge, says he began noticing many years ago that his calculus >students were weak in algebra. They understood the concepts, but >couldn't do the basic skills, says Klein. >Oops. I wonder what Herman Rubin thinks of that line %^) Your guess is correct. But what does professor Klein think are the concepts, and what are the skills? Do they have the major concepts of algebra, the use of variables and the law of equality? Can they formulate word problems? That they know the algorithms for solving certain types of equations is NOT knowing concepts, but skills. It is more common for them to know these, and not have any idea of the meaning of formulation with variables. -- This address is for information only. I do not claim that these views are those of the Statistics Department or of Purdue University. Herman Rubin, Department of Statistics, Purdue University hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558 === Subject: Re: Reform math draws criticism David Klein, professor of mathematics at California State University, >Northridge, says he began noticing many years ago that his calculus >students were weak in algebra. They understood the concepts, but >couldn't do the basic skills, says Klein. Oops. I wonder what Herman Rubin thinks of that line %^) lojbab hmmmmmmm, could not do the basic skills, eh? OH DARN IT!!! You don't suppose that awful John Taylor Gatto (The Underground History of American Education) entire book online here: http://www.johntaylorgatto.com/underground/toc1.htm might have some explanation of this utterly mysterious trend? NO! can't be (could it?) we ALL know he is just one of those libertarian kooks. Citizen Jimserac === Subject: Re: Reform math draws criticism >David Klein, professor of mathematics at California State University, >Northridge, says he began noticing many years ago that his calculus >students were weak in algebra. They understood the concepts, but >couldn't do the basic skills, says Klein. > Oops. I wonder what Herman Rubin thinks of that line %^) > lojbab hmmmmmmm, could not do the basic skills, eh? OH DARN IT!!! You don't suppose that awful John Taylor Gatto >(The Underground History of American Education) >entire book online here: http://www.johntaylorgatto.com/underground/toc1.htm might have some explanation of this utterly mysterious trend? Of course he might have *AN* explanation. Just like Biblical Creationists have an explanation as to why snakes have no legs and women have labor pains, his explanation has little to do with reality. There is no mystery, much less an utterly mysterious trend. Indeed no trend was mentioned in the posts that you responded to, merely a generalization of his observations of students over many years, and my question, which incidentally suggests that Rubin who is also a libertarian would not agree with Klein. I hope you do realize that your posts come across as shilling Gatto's book rather than legitimate posting. >NO! can't be (could it?) we ALL know he is just one of those libertarian kooks. He is. And you are looking like even more of one. lojbab === Subject: Re: Reform math draws criticism On Tue, 10 Jul 2007 16:00:50 -0400, Bob LeChevalier >David Klein, professor of mathematics at California State University, >Northridge, says he began noticing many years ago that his calculus >students were weak in algebra. They understood the concepts, but >couldn't do the basic skills, says Klein. Oops. I wonder what Herman Rubin thinks of that line %^) Well clearly Dr.(?) Klein doesn't understand mathematics! 8^} === Subject: Re: Math guru critical of county's math curriculum > http://www.gazette.net/stories/070407/prinsch174932_32360.shtml > Wednesday, July 4, 2007 > Math guru critical of county's math curriculum > Board of Eduction member also concerned about math lessons > by Dennis Carter | Staff Writer > The question was straightforward: What is 9x8? > Prince George's school board member Pat Fletcher (Dist. 3) of Landover > posed the question to a group of middle school students last spring. > Six of about 25 students could answer the question right away, The question itself also reveals ignorance on the part of the poser. The question should not be: What is 9x8?. A *properly posed* mathematical question would ask: If the domain is the real numbers, what real number [or integer] > *equals* 9x8? Valid answers to the original question might include 9x8 is an integer > 9x8 is the product of two integers > 9x8 is a real number. > 2, if the domain is Z/7Z > etc. Properly posing an unambiguous question is even trickier than you think. Consider What integer equals 9x8? Some legal but unwanted answers are: Three score and twelve Eight zero base nine LXXII Tightening the question to What base-ten integer equals 9x8? still allows the unwanted: Zwei und Siebsig We certainly do not want to have to say something as cumbersome as What base-ten integer, expressed as a sequence of digits without leading zeroes, equals 9x8? (And even this relies on the implicit convention that the sequence is big endian.) > If the poser, hearing one of these latter responses, then says > Yes, but which number?, one might say that was not the question > asked. One needs *specificity*, and this was lacking in the > original question. > Part of posing a problem should be stating the DOMAIN in which the > problem arises. Yes, I am being pedantic. But part of learning mathematics needs to > include learning how to pose unambiguous questions. Which as shown above is very tricky. A lot of what passes for explicit non-ambiguity actually relies on implicit conventions, such as what the simplest form is. > Half of solving a > problem in math is posing the right question. Math is a language in > which it is possible to state *precisely* what is intended. But this > aspect of math is hardly ever taught in our schools because the teachers > themselves only have a hand waving understanding of what they are doing. -- --------------------------- | BBB b Barbara at LivingHistory stop co stop uk | B B aa rrr b | | BBB a a r bbb | Quidquid latine dictum sit, | B B a a r b b | altum viditur. | BBB aa a r bbb | ----------------------------- === Subject: Re: Math guru critical of county's math curriculum http://www.gazette.net/stories/070407/prinsch174932_32360.shtml > Wednesday, July 4, 2007 > Math guru critical of county's math curriculum > Board of Eduction member also concerned about math lessons > by Dennis Carter | Staff Writer > The question was straightforward: What is 9x8? A high school boy with whom I was speaking just this week knew the value of 72; unfortunately, I had just asked him for the product of 7 times 8. I say: VIVA THE OLD MULTIPLICATION TABLE!! Grover Hughes retired engineer, Sandia National Laboratories === Subject: Re: Skybuck's Delphi's 64 bit random function, the real thing !!! ;) =D Bytes: 1585 Here's Skybuck's Delphi's 64 bit random function: > function: What is the result of running the Chi-Squared test on this generator implementation? (Me no gots Delphi to test with) Eli === Subject: Re: Middle Grades Mathematics Textbook Evaluation > Looking over some of the links in the blog, I read this: The Government Flunks Math Earlier this year, James Milgram of Stanford University got curious > about something called the Connected Mathematics Project (CMP), an > intermediate-school math curriculum lately developed at Michigan > State. So he carefully analyzed CMP's sequence of 24 student > booklets. And in one of the seventh-grade units, he found the > following review exercise, a problem of basic algebra and arithmetic > that depends for its solutions on an equally basic understanding of > percentages: In 1980, the town of Rio Rancho, located on a mesa outside Santa > Fe, New Mexico, was destined for obscurity. But as a result of hard > work by its city officials, it began adding manufacturing jobs at a > fast rate. As a result, the city's population grew 239 percent from > 1980 to 1990, making Rio Rancho the fastest-growing small city in > the United States. The population of Rio Rancho in 1990 was 37,000. Forgive me for venturing off the subject of mathematics for a bit, but I feel constrained to remark that among the other arguable errors in the above reference, I lived for more than a half-century in Albuquerque, New Mexico, and I never heard that Santa Fe had a town named Rio Rancho nearby. The only Rio Rancho I know about is across the Rio Grande river from Albuquerque. Yeah, I know this wasn't the point of the post, but I like for geography to be correct, also----- so, like I said: please forgive! Grover Hughes === Subject: Re: Middle Grades Mathematics Textbook Evaluation Bytes: 7561 >The following is part of the June 30, 2007 post at: >http://vormath.info/WordPress1/ >Middle Grades Mathematics Textbook Evaluation: >It was not written by scientists. Rather, the AAAS has lent its >imprimatur, under the name 'Project 2061', to a group of EDUCATORS who >are not trained in mathematics or science. >So? Do we really need scientists to write such textbooks? On top of >that, the term scientists is a pretty generic one - what sort of >scientist needs to authoring these books - an anthropologist maybe? or a >psychologist? >These educators have a specific political agenda: >Doesn't everybody these days? It's really nothing new that politics play >a big part in how public school do things. >* all education done in group settings with the 'discovery method' and >with no instruction from the teacher. >* math classes with writing assignments >* no practice problems >* reliance on calculators >Sounds pretty reasonable for intermediate / middle schools based on the >kids I've seen and the way classes are scheduled. It really all depends >on what the powers-that-be are trying to accomplish. > The following example, posted by Wayne Bishop, is indicative of the > type of writing assignments that some fifth-graders are doing. > http://mathforum.org/kb/message.jspa?messageID=5803435&tstart=0 > Seems that a fifth-grade student was moved to an Everyday Math (EM) > school from a traditional program in which multiplication tables had > been assumed and his mother happened to be observing a class in which > the in-class assignment was to calculate the number of chairs in four > rows of six chairs in each row and to support their work. People were > When the teacher noticed that, she kept insisting that he support his > work (some were drawing rows of chairs, others rows of little x's, > etc.) but he just had no idea what in the world she meant. Finally in > frustration he blurted out, I learned that in third grade! A pretty > good explanation from my perspective; sketches of chairs at this stage > are inappropriate but maybe not in third. >Huh - so there was one student in the class that knew the answer and >who pretty much thought it was beneath him to do the actual work - >i.e., documenting his answer in some way. You are right about the need for documentation; unfortunately, she was not teaching the others well. There are too many unstated assumptions, and the arithmetic concepts are so poorly stated that real understanding may or may not occur. The teacher needs to read a development of the integers and arithmetic from a postulational approach, using both major concepts (the integers are the same, but the meanings are different) as well as derived concepts. >Problem I have with condemning this activity based on the one student is >I don't know the full context as to what the kids were suppose to be >getting out of this assignment. Would it be possible for you to post the >actual lesson plan for this activity so as to put the anecdotal story in >context? >Personally I would think that a class called Everyday Math as being >aimed at students that had some problems understand some of the >fundamental basic concepts that kids are suppose to have learned in >previous grade level classes. Here where I teach there is (maybe was, >not sure if it's still around) a hs class called Math Models, which >pretty much was such a class. The basic concepts are not taught; possibly the teachers have some intuitive idea about them, but they need to be rigorous; in mathematics, rigor should not be confused with difficulty. >Contrary to some peoples belief, not all kids have the same capacity to >learn at the same age. This is a major understatement. >But anyway - to get back to the story that you are relating. How do you >know that the multiplication operation is the focus of the lesson? It >could be that the documenting of the answer to the problem was the >actual focus. >I do a lot of similar stuff in my elective classes - give the kids some >basic (I've already done this before....) type of activity - just so >that it's not the multiplication operation that they spent their time >focusing on - but rather the what we are doing with the answer part. >For instance - in teaching kids in my web mastery class about html >tables , I have an assignment where the kids build a periodic chart. I >can tell you that every time we do this assignment, I get a number of >kids that whine Why are we doing this?, This ain't a chemistry class >or We did this last year in chemistry!, why do we have to do it >again?. I sure someone observing the class and not know what exactly I >was trying to teach the kids might wonder why I was trying to cover >chemistry in a web class. Point is, I'm not - I'm just trying to use >something that I know most of them already know to teach them something >that they don't. The periodic chart works great - IMO, it's divided up >into cells, with each containing a small amount of unique text and there >are different background colors assigned to diffrent groups of elements. I am assuming that this was not the only such chart; you might try the isotope chart (atomic number and atomic weight, as well as stability and decay type information, and also shell structure) to give another, which was probably not covered in the chemistry class. One can use examples. It would be much more useful it, instead of having children memorize the addition and multiplication tables, they constructed them from the ordinal characterizations of those operations. And they should also do it for other bases, as well as show how knowing the operations in one base can be used to get them in another. I do a fair amount of base 16 arithmetic (I probably should use the computer more) but I have not memorized the tables. >Martin -- This address is for information only. I do not claim that these views are those of the Statistics Department or of Purdue University. Herman Rubin, Department of Statistics, Purdue University hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558 === Subject: Re: Middle Grades Mathematics Textbook Evaluation >The following is part of the June 30, 2007 post at: >http://vormath.info/WordPress1/ >Middle Grades Mathematics Textbook Evaluation: >It was not written by scientists. Rather, the AAAS has lent its >imprimatur, under the name 'Project 2061', to a group of EDUCATORS who >are not trained in mathematics or science. >So? Do we really need scientists to write such textbooks? On top of >that, the term scientists is a pretty generic one - what sort of >scientist needs to authoring these books - an anthropologist maybe? or a >psychologist? >These educators have a specific political agenda: >Doesn't everybody these days? It's really nothing new that politics play >a big part in how public school do things. >* all education done in group settings with the 'discovery method' and >with no instruction from the teacher. >* math classes with writing assignments >* no practice problems >* reliance on calculators >Sounds pretty reasonable for intermediate / middle schools based on the >kids I've seen and the way classes are scheduled. It really all depends >on what the powers-that-be are trying to accomplish. The following example, posted by Wayne Bishop, is indicative of the >type of writing assignments that some fifth-graders are doing. >http://mathforum.org/kb/message.jspa?messageID=5803435&tstart=0 >Seems that a fifth-grade student was moved to an Everyday Math (EM) >school from a traditional program in which multiplication tables had >been assumed and his mother happened to be observing a class in which >the in-class assignment was to calculate the number of chairs in four >rows of six chairs in each row and to support their work. People were >When the teacher noticed that, she kept insisting that he support his >work (some were drawing rows of chairs, others rows of little x's, >etc.) but he just had no idea what in the world she meant. Finally in >frustration he blurted out, I learned that in third grade! A pretty >good explanation from my perspective; sketches of chairs at this stage >are inappropriate but maybe not in third. >Huh - so there was one student in the class that knew the answer and >who pretty much thought it was beneath him to do the actual work - >i.e., documenting his answer in some way. > You are right about the need for documentation; Think you and I are thinking of a different kind of documentation. > unfortunately, she was not teaching the others well. There > are too many unstated assumptions, and the arithmetic > concepts are so poorly stated that real understanding may or > may not occur. The teacher needs to read a development of > the integers and arithmetic from a postulational approach, > using both major concepts (the integers are the same, but the > meanings are different) as well as derived concepts. Well - again, without the actual lesson plan in front of us - we really don't know what the point of the lesson was. >Problem I have with condemning this activity based on the one student is >I don't know the full context as to what the kids were suppose to be >getting out of this assignment. Would it be possible for you to post the >actual lesson plan for this activity so as to put the anecdotal story in >context? >Personally I would think that a class called Everyday Math as being >aimed at students that had some problems understand some of the >fundamental basic concepts that kids are suppose to have learned in >previous grade level classes. Here where I teach there is (maybe was, >not sure if it's still around) a hs class called Math Models, which >pretty much was such a class. > The basic concepts are not taught; possibly the teachers > have some intuitive idea about them, but they need to be > rigorous; in mathematics, rigor should not be confused > with difficulty. Again - with just this one snapshot description of the class and what they were doing - it's impossible to guess whether or not it was being done right or wrong. >Contrary to some peoples belief, not all kids have the same capacity to >learn at the same age. > This is a major understatement. But it something that seems to be constantly ignored. >But anyway - to get back to the story that you are relating. How do you >know that the multiplication operation is the focus of the lesson? It >could be that the documenting of the answer to the problem was the >actual focus. >I do a lot of similar stuff in my elective classes - give the kids some >basic (I've already done this before....) type of activity - just so >that it's not the multiplication operation that they spent their time >focusing on - but rather the what we are doing with the answer part. >For instance - in teaching kids in my web mastery class about html >tables , I have an assignment where the kids build a periodic chart. I >can tell you that every time we do this assignment, I get a number of >kids that whine Why are we doing this?, This ain't a chemistry class >or We did this last year in chemistry!, why do we have to do it >again?. I sure someone observing the class and not know what exactly I >was trying to teach the kids might wonder why I was trying to cover >chemistry in a web class. Point is, I'm not - I'm just trying to use >something that I know most of them already know to teach them something >that they don't. The periodic chart works great - IMO, it's divided up >into cells, with each containing a small amount of unique text and there >are different background colors assigned to diffrent groups of elements. > I am assuming that this was not the only such chart; you > might try the isotope chart (atomic number and atomic > weight, as well as stability and decay type information, and > also shell structure) to give another, which was probably > not covered in the chemistry class. The focus is not suppose to be the chemistry - but rather learning to build the table itself - the periodic chart was only meant to be something the students had seen before. This year I dump doing that chart and instead had the students do a standard calendar month - the periodic chart proved to be too much of a distraction from the actual focus of the activity. Martin > One can use examples. It would be much more useful it, > instead of having children memorize the addition and > multiplication tables, they constructed them from the > ordinal characterizations of those operations. And > they should also do it for other bases, as well as > show how knowing the operations in one base can be > used to get them in another. I do a fair amount of > base 16 arithmetic (I probably should use the computer > more) but I have not memorized the tables. >Martin === Subject: Re: General Matrix for affine transformation of three points Bytes: 2869 <12784737.1184032679326.JavaMail.jakarta@nitrogen.mathforum.org>, > I was wondering if there exists a general matrix A and vector b such that > given three initial points:x,y,and z in R^2 and their desired images x',y', > and z' respectively, Ax +b= x' ; Ay +b = y' ; Az + b = z' The purposes of having this are computational and I am aware that one could > easily spend 4 hours of their life solving the necessary number of linear > equations, I was just wondering if the solution was known already. Moreover, for my purposes, the images will be x' = (0,1) ; y' = (1,0) ; and > z' = (0,-1) Ideally I would like a similar matrix for 4 points in R^3.... Transforming a perfectly general triangle to a fixed position is the geometrical equivalent of solving some linear equations with perfectly general coefficients, slightly modified to deal with the vector b. So I'm afraid you can't avoid the work of solving sets of linear equations. The only general formula you could hope for would be some variant of Cramer's Rule, which you probably wouldn't like (and which would become computationally inefficient in higher dimensions). Hard luck! :-( Ken Pledger. === Subject: Re: General Matrix for affine transformation of three points <7555682.1184095941304.JavaMail.jakarta@nitrogen.mathforum.org>, [It is a good idea to quote the post to which you are replying.] > ok sorry, let me clarify another requirement to avoid that case. The > original three points: x,y, and z are affinely independent. (i.e. i am > mapping any arbitrary triangle to my desired image triangle (the 2-simplex > in R^2)). Maybe , #2 will help. -- Paul Sperry Columbia, SC (USA) === Subject: Re: +1600 Solutions Manual to low cost <46937A13.109EEE89@antispamhotmail.co.uk.invalid> I need the following Kinematics and Dynamics of Machinery (3rd Ed., Wilson & Sadler) I needed the yesterday. Your help is greatly appreciated. Please contact me @ antmarsh85@yahoo.com ASAP..THANKS!!!! === Subject: Re: +1600 Solutions Manual to low cost I need the following Kinematics and Dynamics of Machinery (3rd Ed., Wilson & Sadler) I needed the yesterday. Your help is greatly appreciated. Please > contact me @ antmarsh85@yahoo.com ASAP..THANKS!!!! You are replying to the wrong person and the person you should (in some sense) be replying to has said that he wishes to be e-mailed. -- Remove antispam and .invalid for e-mail address. He that giveth to the poor lendeth to the Lord, and shall be repaid, said Mrs Fairchild, hastily slipping a shilling into the poor woman's hand. === Subject: solution and manual hi bhupala, could u please send me the solution manual for these books: Concepts of Modern Physics by arthur beiser Modern Physics by Tipler Theory.3rd edition.Reitz,Milford,Christy require it for exams my email address is dlsah27@hanmail.net Please.... === Subject: Re: solution and manual >hi bhupala, could u please send me the solution manual for these books: >Concepts of Modern Physics by arthur beiser >Modern Physics by Tipler >Theory.3rd edition.Reitz,Milford,Christy require it for exams >my email address is dlsah27@hanmail.net >Please.... Do your own work. If someone does it for you then you'd be a slimy, low-life cheat.Cheats are scum.n === Subject: Re: solution and manual > hi bhupala, could u please send me the solution manual for these books: > Concepts of Modern Physics by arthur beiser > Modern Physics by Tipler > Theory.3rd edition.Reitz,Milford,Christy require it for exams > my email address is dlsah27@hanmail.net > Please.... > So you can sell it on the internet ?? Indian students are cheating on tests to get degrees, do not help them. === Subject: Re: solution and manual > hi bhupala, > could u please send me the solution manual for these books: > Concepts of Modern Physics by arthur beiser > Modern Physics by Tipler > Theory.3rd edition.Reitz,Milford,Christy > require it for exams > my email address is dlsah27@hanmail.net > Please.... So you can sell it on the internet ?? Indian students are cheating on tests to get degrees, do not help them. > What makes yoiu think it's Indian students. American students by the dozens have been here wanting homework done for them!! And unfortunarely, someone will! === Subject: Re: solution and manual > hi bhupala, > could u please send me the solution manual for these books: > Concepts of Modern Physics by arthur beiser > Modern Physics by Tipler > Theory.3rd edition.Reitz,Milford,Christy > require it for exams > my email address is dlsah27@hanmail.net > Please.... So you can sell it on the internet ?? Indian students are cheating on tests to get degrees, do not help them. === Subject: solution and manual .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0),gzip(gfe),gzip(gfe) Initiating server query ... Looking up the domain name for IP: 24.2.79.62 The domain name for the IP address is: c-24-2-79-62.hsd1.ut.comcast.net Connecting to the server on standard HTTP port: 80 No response was received from the machine and port at that IP. The machine may be offline or the connection port may be stealthed. Query complete. 24.2.79.62 is found in United States IP Whois Results: Connecting to whois.arin.net... Comcast Cable Communications, Inc. EASTERNSHORE-1 (NET-24-0-0-0-1) 24.0.0.0 - 24.15.255.255 Comcast Cable Communications UTAH-9 (NET-24-2-64-0-1) 24.2.64.0 - 24.2.95.255 http://physics.inha.ac.kr/physlab/member_05-1.htm === Subject: deadbeat with minimal time. I need a calculation on how to group 16 numbers into 4 groups without the same number appearing with another number twice, but having all numbers appear with every other number only once. ... the numbers have to come out of quadrants of 4.( 1,2,3,4 quad 1 ...5,6,7,8 quad 2....9,10,11,12 quad 3...13,14,15,16 quad 4 ) ex 1: group 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ex 2: 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 ex 3: 1 6 11 16 2 7 12 13 3 8 09 14 4 5 10 15 Theres 5 of em. I did this on paper 10 years ago...just short the time this year. King of the beach volleyball tourney...top 16 play with each other once.... happy hunting. Come by & I'll grill you some of my unfamous shrimp if ya can beat me by doing this thing in my head.....shrimp good...head weary...volleyball skills eroding, but still there. johzeppi@aol === Subject: JSH: Not time to come back yet. JSH: We at sci.math are not ready for any more of your postings. Many of us are on summer vacations because school is out. In another month or so, their will be enough of us professors back to give your postings the thoroughness they deserve. alt.math.undergrad however is able to accommodate your posts for the summer session and we have several there already. We have taken up a donation and bought you a real on-line math course which you can study online in the interim; http://en.wikipedia.org/wiki/Algebra -the Hive, Swarm, Parasites, etc === Subject: Re: Not time to come back yet. > JSH: We at sci.math are not ready for any more of your postings. > Many of us are on summer vacations because school is out. In another month or so, their will be enough of us professors back to give > your postings the thoroughness they deserve. > alt.math.undergrad however is able to accommodate your posts for the > summer session and we have several there already. We have taken up a donation and bought you a real on-line math course > which you can study online in the interim; > http://en.wikipedia.org/wiki/Algebra -the Hive, Swarm, Parasites, etc > sci.crypt is also ready