![]() |
|
|
#1 |
|
∂2ω=0
Sep 2002
República de California
22×2,939 Posts |
This is a cute little way to illustrate one of the basic aspects of the Crandall-Fagin discrete weighted transform algorithm used by all modern LL test programs - the mixed-based aspect. I prefer that to Crandall's original "irrational base" terminology, because even though the mixed bases give a transform-length effect which is in some sense equivalent to that which would obtain if an irrational base 2p/n were able to be used, at no point in the Mersenne-mod DWT does one actually *use* irrational wordsizes - one instead uses a clever mix of just *two* wordsizes, having floor(p/n) and ceiling(p/n) bits. (A common colloquialism here is to call these the "smallwords" and "bigwords", respectively, of the mixed-base representation of the LL-test residues.)
A nice way of illustrating how the mixed-based approach works is by costructing a hypothetical calendar using the mixed-base approach to determine the number of days in each month. In such a DWT-based calendar, each month of a year will have either 30 days ("smallmonth") or 31 days ("bigmonth"). So, dust off your dog-eared copies of Crandall/Fagin and enjoy the following puzzle: Using the wordsize formula prescribed for Mersenne-mod DWT in the above paper, specify the number of days in each of the 12 months of a standard 365-day year. Now repeat the exercise for a leap year. Can you identify any obvious practical drawbacks to divvying up the days in a year this way? I'd like to ask folks already familiar with the DWT to feel free to work the puzzle and provide hints to those less so, but to please refrain from giving the answer for at least (say) a week from today. Thanks. Last fiddled with by ewmayer on 2007-04-18 at 18:13 Reason: littlemonth ==> smallmonth so terminology is consistent |
|
|
|
|
|
#2 | |
|
∂2ω=0
Sep 2002
República de California
22·2,939 Posts |
Quote:
The DWT variable-wordsize scheme uses one of two word sizes for each digit, or in our present example, number of days for each month: #days = ceil[(i+1)*p/n] - ceil[i*p/n], where i=0,...,n-1. This, for a standard year (p=365, n=12) we have: Code:
Month: i [i*p/n] [(i+1)*p/n] #days ----- -- --- --- ------------ Jan 0 0 31 31- 0 = 31 Feb 1 31 61 61- 31 = 30 Mar 2 61 92 92- 61 = 31 Apr 3 92 122 122- 92 = 30 May 4 122 153 153-122 = 31 Jun 5 153 183 183-153 = 30 Jul 6 183 213 213-183 = 30 Aug 7 213 244 244-213 = 31 Sep 8 244 274 274-244 = 30 Oct 9 274 305 305-274 = 31 Nov 10 305 335 335-305 = 30 Dec 11 335 365 365-335 = 30 Code:
Month: i [i*p/n] [(i+1)*p/n] #days ----- -- --- --- ------------ Jan 0 0 31 31- 0 = 31 Feb 1 31 61 61- 31 = 30 Mar 2 61 92 92- 61 = 31 Apr 3 92 122 122- 92 = 30 May 4 122 153 153-122 = 31 Jun 5 153 183 183-153 = 30 Jul 6 183 214 214-183 = 31* Aug 7 214 244 244-214 = 30* Sep 8 244 275 275-244 = 31* Oct 9 275 305 305-275 = 30* Nov 10 305 336 336-305 = 31* Dec 11 336 366 366-336 = 30 We now return the podium to the crickets... Last fiddled with by ewmayer on 2007-04-18 at 18:06 Reason: Corrected leap year months (thanks, ppo) |
|
|
|
|
|
|
#3 | |
|
Aug 2004
italy
1618 Posts |
Quote:
This gives a nice pattern for a leap year: 31,30,31,30,.....31,30 days. Regards, Pierpaolo. |
|
|
|
|
|
|
#4 | |
|
∂2ω=0
Sep 2002
República de California
267548 Posts |
Quote:
Thanks for giving the poor overworked crickets a brief rest. ;) |
|
|
|
|
|
|
#5 |
|
"Lucan"
Dec 2006
England
2×3×13×83 Posts |
My assembler-friendly algorithm for choosing 5 months
out of twelve to have 31 days instead of 30 goes like this: -1>= acc(umulator) >=-12 FOR n = 1 to 12 acc = acc+5 IF carry THEN month(n) =31: acc = acc-12 ELSE month(n)=30 NEXT |
|
|
|
|
|
#6 |
|
"Lucan"
Dec 2006
England
2·3·13·83 Posts |
I was glad to note the confirmation that " irrational base"
meant what I thought it did, What does a number to the base pi (say) look like??? David |
|
|
|
|
|
#7 | |
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
22·3·641 Posts |
Quote:
|
|
|
|
|
|
|
#8 |
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
170148 Posts |
First, one has to decide what the digits are going to be. The obvious choice is {0,1,2,3}, but there are other possibilities, such as digits whose value is e/pi or pi/2, that make the addition and multiplication tables more complex. Pi itself can't be a digit, because pi = 10base-pi.
Last fiddled with by cheesehead on 2007-04-19 at 22:41 |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| On crt based factorization? | Unabomber | Math | 1 | 2014-04-04 20:19 |
| Calendar math | science_man_88 | Lounge | 11 | 2011-06-26 11:13 |
| Mersenneforum calendar | ET_ | Lounge | 8 | 2010-09-02 08:40 |
| Prime95 on NT-based OS | ThomRuley | Software | 2 | 2004-03-21 15:30 |
| 4 checkins in a single calendar month from a single computer | Gary Edstrom | Lounge | 7 | 2003-01-13 22:35 |