mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Puzzles (https://www.mersenneforum.org/forumdisplay.php?f=18)
-   -   How many days are there *really* in a year? (https://www.mersenneforum.org/showthread.php?t=16409)

NBtarheel_33 2012-01-01 23:13

How many days are there *really* in a year?
 
Happy New Year everyone! We have entered uncharted territory for GIMPS - two consecutive full calendar years without a prime. Hope we make up for it in 2012!

Because my Roman numeral puzzler was such a thrill last year...let's again start the year off with an interesting(?) problem:

We work with the set of dates 1/1 through 12/31 (include 2/29 as this is a leap year). There are 366 distinct dates...or are there?

See, I say that 1/1 = 2/2 = 3/3 = 4/4 = ... = 12/12 = 1. Which means that there are at most 355 distinct dates. But I also claim that 1/2 = 2/4 = 3/6 = 4/8 = 5/10 = ... = 12/24. That means we're down to 344 distinct dates. See where I'm going?

How many *truly* distinct dates are there in a year?

Extra credit: Note that 1/3 = 11/33 = 12/36, where 11/33 = 12/3 and 12/36 = 1/5. Similarly, 1/8 = 12/96 = 1/65 = 2/34 = 3/5. Allowing these extra weird dates, how many distinct dates are there in a year?

science_man_88 2012-01-01 23:23

[QUOTE=NBtarheel_33;284408]We work with the set of dates 1/1 through 12/31 (include 2/29 as this is a leap year). There are 366 distinct dates...or are there?

See, I say that 1/1 = 2/2 = 3/3 = 4/4 = ... = 12/12 = 1. Which means that there are at most 355 distinct dates. But I also claim that 1/2 = 2/4 = 3/6 = 4/8 = 5/10 = ... = 12/24. That means we're down to 344 distinct dates. See where I'm going?

How many *truly* distinct dates are there in a year?[/QUOTE]

I don't see why you are subtracting only 11 each time:

1/1=2/2=3/3=4/4=5/5=6/6=7/7=8/8=9/9=10/10/=11/11=12/12 is 12 dates that are not distinct.

12/6=10/5=8/4=6/3=4/2=2/1 is another 6 that aren't distinct.

science_man_88 2012-01-01 23:35

[QUOTE=science_man_88;284410]I don't see why you are subtracting only 11 each time:

1/1=2/2=3/3=4/4=5/5=6/6=7/7=8/8=9/9=10/10/=11/11=12/12 is 12 dates that are not distinct.

12/6=10/5=8/4=6/3=4/2=2/1 is another 6 that aren't distinct.[/QUOTE]

using m/d and fractions of form 1/d r=31 maximum allowed in any month:

3*12>31 so 12 goes out with 3
11*3>31 so does 11
10*4>31 so 10 get knocked out at 4
9*4>31 so does 9
8*4>31 so does 8
7*5>31 so that knocks out 7
6*6>31 so that knocks out 6
... <- able to be figured out from lines above
...
...
2*15>29 ( the maximum in February)

Xyzzy 2012-01-02 00:33

FWIW, note that this year is a birthday year for the trolls.

[QUOTE]Trolls usually live a very long time and only celebrate birthdays on leap years. Even though their actual birthday might be in September or December, they celebrate it on February 29th.[/QUOTE][URL="http://www.mersenneforum.org/showthread.php?t=10536"][SIZE=1]http://www.mersenneforum.org/showthread.php?t=10536[/SIZE][/URL]

science_man_88 2012-01-02 00:52

[QUOTE=NBtarheel_33;284408]Happy New Year everyone! We have entered uncharted territory for GIMPS - two consecutive full calendar years without a prime. Hope we make up for it in 2012!

Because my Roman numeral puzzler was such a thrill last year...let's again start the year off with an interesting(?) problem:

We work with the set of dates 1/1 through 12/31 (include 2/29 as this is a leap year). There are 366 distinct dates...or are there?

See, I say that 1/1 = 2/2 = 3/3 = 4/4 = ... = 12/12 = 1. Which means that there are at most 355 distinct dates. But I also claim that 1/2 = 2/4 = 3/6 = 4/8 = 5/10 = ... = 12/24. That means we're down to 344 distinct dates. See where I'm going?

How many *truly* distinct dates are there in a year?

Extra credit: Note that 1/3 = 11/33 = 12/36, where 11/33 = 12/3 and 12/36 = 1/5. Similarly, 1/8 = 12/96 = 1/65 = 2/34 = 3/5. Allowing these extra weird dates, how many distinct dates are there in a year?[/QUOTE]

[CODE](20:50)>p=[];for(m=1,12,for(d=1,if((m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12),31,if(m!=2,30,29)),p=concat(p,m/d)));p=vecsort(eval(p),,8);#p
[/CODE] closest I'm going to get.

petrw1 2012-01-02 02:06

[SPOILER]232[/SPOILER] using the NBtarheel_33 implied rules that if 12 are "duplicated" it counts as 1.

[SPOILER]175[/SPOILER] using science_man_88 prosed rules (remove all duplicates)

science_man_88 2012-01-02 02:07

[QUOTE=petrw1;284418][SPOILER]232[/SPOILER] using the NBtarheel_33 implied rules that if 12 are "duplicated" it counts as 1.

[SPOILER]175[/SPOILER] using science_man_88 prosed rules (remove all duplicates)[/QUOTE]

if it counts my code got 232.

axn 2012-01-02 06:00

[QUOTE=NBtarheel_33;284408]Extra credit: Note that 1/3 = 11/33 = 12/36, where 11/33 = 12/3 and 12/36 = 1/5. Similarly, 1/8 = 12/96 = 1/65 = 2/34 = 3/5. Allowing these extra weird dates, how many distinct dates are there in a year?[/QUOTE]

Since "extra weird dates" is poorly defined, I've went with my own interpretation. Accordingly:
[CODE]? d=[31,29,31,30,31,30,31,31,30,31,30,31];
? d1=vector(12);
? s=366; for(i=1, 12, d1[i] = s; s -= d[i]);
? d1
[366, 335, 306, 275, 245, 214, 184, 153, 122, 92, 61, 31]
? sum(i=1,12,d1[i])
2384
? q=vector(%);
? c=0; for(i=1,12, for(j=1, d1[i], c++; q[c] = i/j))
? q=vecsort(q,,8);
? #q
[B]1564[/B][/CODE]

axn 2012-01-02 06:27

Perhaps this is closer to what OP wanted.
[CODE]? d=[31,29,31,30,31,30,31,31,30,31,30,31];
? q=vector(366*(1+11*6),i,1/1);
? add(m,d)={c++; q[c] = m/d }
? iterate(m,d)={ my(mm=2*m, dd=2*d); while(mm <= 12, reduce(mm, dd); mm += m; dd += d) }
? reduce(mm, dd)={ while(dd > d[mm], add(mm, dd); dd -= d[mm]; mm++; if(mm > 12, mm-=12)) }
? c=0; for(i=1,12, for(j=1, d[i], add(i,j); iterate(i, j)))
? c
1830
? r=vecsort(q,,8);
? #r
[B]784[/B][/CODE]

NBtarheel_33 2012-01-05 12:07

[QUOTE=axn;284442]Since "extra weird dates" is poorly defined, I've went with my own interpretation. Accordingly:
[CODE]? d=[31,29,31,30,31,30,31,31,30,31,30,31];
? d1=vector(12);
? s=366; for(i=1, 12, d1[i] = s; s -= d[i]);
? d1
[366, 335, 306, 275, 245, 214, 184, 153, 122, 92, 61, 31]
? sum(i=1,12,d1[i])
2384
? q=vector(%);
? c=0; for(i=1,12, for(j=1, d1[i], c++; q[c] = i/j))
? q=vecsort(q,,8);
? #q
[B]1564[/B][/CODE][/QUOTE]

Remember, we're working within a single year. Eventually, everything resolves to a single "correct form" date, e.g. 1/11 = 4/44 = 5/14, or 2/20 = 12/120 = 3/29. So, there will be no more than 366 possible outcomes (and in fact, a lot fewer!)

NBtarheel_33 2012-01-05 12:16

"Weird" dates
 
Let me add some information to help define the "weird" dates.

A "weird" date has a month 1-12 but *any integer* for the day. For instance, my birthday is September 2nd, but that's also August 33rd, or July 64th, or June 94th. It's also May 125th, or January 246th.

If you get a date that "wraps around" the calendar, like 12/77, just treat the next month as January again. So 12/77 = 1/46 = 2/15. Keep reducing the day number until it is "correct" for the month that it is paired with.

Another example: What is November 359th? Well, 11/359 = 12/329 = 1/298 = 2/267 = 3/238 = 4/207 = 5/177 = 6/146 = 7/116 = 8/85 = 9/54 = 10/24. That is, November 359th is the same as October 24th.

Basically, what is happening is that you're working with modular arithmetic, as you would with weird times like 8:75 = 9:15, or 11:136 = 1:16.

Believe it or not, I started thinking about weird stuff like this when I was eight or so. I realized that my birthday was August 33rd. I was using modular arithmetic without even knowing it. But now, I can do calendar arithmetic with the best of them. :smile:

Remember, that the set of "valid" dates to end up must be in the range 1/1 - 12/31. So your answer for the number of distinct dates will be at most 366.

I will reveal the answers in a couple of days (i.e. when I get them calculated! Shame on me!).

axn 2012-01-05 12:52

[QUOTE=NBtarheel_33;284884]
Another example: What is November 359th? Well, 11/359 = 12/329 = 1/298 = 2/267 = 3/238 = 4/207 = 5/177 = 6/146 = 7/116 = 8/85 = 9/54 = 10/24. That is, November 359th is the same as October 24th.[/QUOTE]

But 10/24 = 5/12. So all of them map to the distinct date of 5/12, no? In which case, weird dates won't add any new unique dates.

LaurV 2012-01-05 13:06

[QUOTE=axn;284891]But 10/24 = 5/12. So all of them map to the distinct date of 5/12, no? In which case, weird dates won't add any new unique dates.[/QUOTE]
It will. You can not make 1/33 (which is a valid weird date) from normal dates. I have the answer already and it is very simple to compute, for both cases (with or without weirds).

EdH 2012-01-06 17:09

But, 11/359 would be in a different year...

NBtarheel_33 2012-01-06 19:10

[QUOTE=EdH;285093]But, 11/359 would be in a different year...[/QUOTE]

Think of it as a perpetual calendar. The date rolls over from 12-31 to 1-1 but we don't worry about the year changing. IOW, the dates are just abstract entities without years to distinguish them apart.

Cow_tipping 2012-01-07 22:44

[spoiler]226[/spoiler] is my answer without weird date calculation

NBtarheel_33 2012-01-15 12:08

We have winner(s)!
 
[QUOTE=science_man_88;284419]if it counts my code got 232.[/QUOTE]

We have a winner (or several!). Given a date m/d, 1<=m<=12 and 1<=d<=#(m), where #(m) = the number of days in month m, we have (for normal dates) [B]232[/B] distinct dates (where we keep a date the first time it appears, and then throw out all equivalent dates, so for instance, keep 1/1 but throw out 2/2, 3/3, etc.)

Here is the solution for "normal dates":

[CODE]The dates of the form 1/n:

Eliminate 2/2n from 2/2 to 2/28 - 14 dates
Eliminate 3/3n from 3/3 to 3/30 - 10 dates
Eliminate 4/4n from 4/4 to 4/28 - 7 dates
Eliminate 5/5n from 5/5 to 5/30 - 6 dates
Eliminate 6/6n from 6/6 to 6/30 - 5 dates
Eliminate 7/7n from 7/7 to 7/28 - 4 dates
Eliminate 8/8n from 8/8 to 8/24 - 3 dates
Eliminate 9/9n from 9/9 to 9/27 - 3 dates
Eliminate 10/10n from 10/10 to 10/30 - 3 dates
Eliminate 11/11n from 11/11 to 11/22 - 2 dates
Eliminate 12/12n from 12/12 to 12/24 - 2 dates

So the 1/n dates eliminate a total of 59 dates.

The dates of the form 2/n:

Eliminate 4/2n from 4/2 to 4/30 - 15 dates, but 7 of these are also 4/4n - so net 8 dates
Eliminate 6/3n from 6/3 to 6/30 - 10 dates, but 5 of these are also 6/6n - so net 5 dates
Eliminate 8/4n from 8/4 to 8/28 - 7 dates, but 3 of these are also 8/8n - so net 4 dates
Eliminate 10/5n from 10/5 to 10/30 - 6 dates, but 3 of these are also 10/10n - so net 3 dates
Eliminate 12/6n from 12/6 to 12/30 - 5 dates, but 2 of these are also 12/12n - so net 3 dates

So the 2/n dates eliminate a total of 23 dates.

The dates of the form 3/n:

Eliminate 6/2n from 6/2 to 6/30 - 15 dates, but 5 of these are already counted - net 10 dates
Eliminate 9/3n from 9/3 to 9/30 - 10 dates, but 3 of these are already counted - net 7 dates
Eliminate 12/4n from 12/4 to 12/28 - 7 dates, but 2 of these are already counted - net 5 dates

So the 3/n dates eliminate a total of 22 dates.

The dates of the form 4/n:

Eliminate 8/2n from 8/2 to 8/30 - 15 dates, but 7 of these are already counted - net 8 dates
Eliminate 12/3n from 12/3 to 12/30 - 10 dates, but 5 of these are already counted - net 5 dates

So the 4/n dates eliminate a total of 13 dates.

The dates of the form 5/n:

Eliminate 10/2n from 10/2 to 10/30 - 15 dates, but 3 of these are already counted - net 12 dates

So the 5/n dates eliminate a total of 12 dates.

The dates of the form 6/n:

Eliminate 12/2n from 12/2 to 12/30 - 15 dates, but 10 of these are already counted - net 5 dates

So the 6/n dates eliminate a total of 5 dates.

There are hence 366 - (59 + 23 + 22 + 13 + 12 + 5) = 232 distinct dates.[/code]

Note that 232/366 = 0.6339, so we eliminate more than one-third of the calendar by writing dates in "lowest terms".

"Weird date" calculation coming soon...though y'all might be able to figure out that it is actually very similar, but the math is a little trickier to keep track of. If anyone has it, go ahead and post it!!

NBtarheel_33 2012-01-15 12:12

[QUOTE=Cow_tipping;285330][spoiler]226[/spoiler] is my answer without weird date calculation[/QUOTE]

You double-counted somewhere...

NBtarheel_33 2012-01-15 12:18

[QUOTE=axn;284891]But 10/24 = 5/12. So all of them map to the distinct date of 5/12, no? In which case, weird dates won't add any new unique dates.[/QUOTE]

Yes, the "weird date" 11/359 = 10/24 would be eliminated by 5/12. But you should not actually encounter 11/359 in working the puzzle. I think 1/31 = 11/341 = 10/6 = 5/3 (so it's gone) is the largest weird date for the month of November.

NBtarheel_33 2012-01-15 12:24

[QUOTE=LaurV;284894]It will. You can not make 1/33 (which is a valid weird date) from normal dates. I have the answer already and it is very simple to compute, for both cases (with or without weirds).[/QUOTE]

But, you can certainly start with 1/33. You have 1/33 = 2/2, which is eliminated by 1/1.

retina 2012-01-15 12:30

You are all writing your dates wrong!

It [b]should[/b] be: day/month. NOT month/day. Jeez. :mad::glare::judge::sick:

[color=gray]That ought to put the penguins among the bears.
:bear:[/color]

Cow_tipping 2012-01-16 22:48

[QUOTE=retina;286357]You are all writing your dates wrong!

It [b]should[/b] be: day/month. NOT month/day. Jeez. :mad::glare::judge::sick:

[color=gray]That ought to put the penguins among the bears.
:bear:[/color][/QUOTE]

Omg, I did just that! Silly date naming convention of those US people.
Change to metric system stop with the comma's in spreadsheets, write the date DDMMYYY and no more yards.
It's 226 unique days in europe, US has 232. :P

* end rant :drama:

NBtarheel_33 2012-01-17 12:04

[QUOTE=Cow_tipping;286528]Omg, I did just that! Silly date naming convention of those US people.
Change to metric system stop with the comma's in spreadsheets, write the date DDMMYYY and no more yards.
It's 226 unique days in europe, US has 232. :P

* end rant :drama:[/QUOTE]

Would you care to share the European solution with us? Forgive my US-centric construction of the problem. I am surprised that the answers are different for the different date formats!

ckdo 2012-01-17 13:50

[QUOTE=NBtarheel_33;286565]I am surprised that the answers are different for the different date formats![/QUOTE]

They are not. :judge:

NBtarheel_33 2012-02-03 11:46

[QUOTE=ckdo;286569]They are not. :judge:[/QUOTE]

I didn't think so. The dates that get eliminated are those having a "numerator" and "denominator" that have a nontrivial common factor. Obviously, if the "numerator" and "denominator" change roles (as they do in going from an American date to a European one), they still have a nontrivial common factor, and hence the date is still eliminated.

NBtarheel_33 2012-02-03 11:53

1 Attachment(s)
Once we admit the "weird dates", the calendar becomes very sparse! There are only 54 distinct dates out of 366, i.e. nearly six of every seven days get eliminated. I've attached a calendar showing what remains; chances are your birthday doesn't make an appearance...

science_man_88 2012-02-03 11:55

[QUOTE=NBtarheel_33;288172]Once we admit the "weird dates", the calendar becomes very sparse! There are only 54 distinct dates out of 366, i.e. nearly six of every seven days get eliminated. I've attached a calendar showing what remains; chances are your birthday doesn't make an appearance...[/QUOTE]

really mine does.

axn 2012-02-03 12:03

[QUOTE=NBtarheel_33;288172]Once we admit the "weird dates", the calendar becomes very sparse! There are only 54 distinct dates out of 366, i.e. nearly six of every seven days get eliminated. I've attached a calendar showing what remains; chances are your birthday doesn't make an appearance...[/QUOTE]

You'll have to explain your logic. I can't for the life of me figure out how _adding_ new dates _reduces_ the available dates.:confused:

NBtarheel_33 2012-02-03 16:38

[QUOTE=axn;288174]You'll have to explain your logic. I can't for the life of me figure out how _adding_ new dates _reduces_ the available dates.:confused:[/QUOTE]

Remember that the weird dates will ultimately boil down into regular dates (i.e. of the proper form 1/1-1/31, 2/1-2/29, etc.). It seems as though there are many of these weird dates that become regular dates that aren't necessarily eliminated on the first run through.

For example: February 8th (2/8) under the "normal" rules will eliminate the "equivalent" dates 4/16 and 6/24. But if we allow "weird" dates, we also get to throw out 8/32 = 9/1, and 10/40 = 11/9, as well as 12/48 = 1/17. So we get to throw out five dates, instead of just two. It turns out that this kind of thing happens a lot...so much so that only 54 dates are left behind.

Another way to look at it: say we are looking at the dates of the form 1/n (all the January dates). These dates are equivalent to 2/2n, 3/3n, 4/4n, and so on up to 12/12n. That is, we can cancel every even day in February, every third day in March, every fourth day in April, and so on, up to every twelfth day in December. Under the "normal" rules, we have to stop at the end of each month, i.e. we can only cancel, say, April 4, 8, 12, 16, 20, 24, and 28. But under the "weird" rules, we can keep going, cancelling every fourth day in the calendar from April 4th through April 124th, which of course, is August 2nd. There are many more chances to cancel dates out of the calendar.

Clear as mud? :smile: Things do get unwieldy when we start calculating and manipulating weird stuff like 4/124 and 12/372...

science_man_88 2012-02-04 00:48

[QUOTE=NBtarheel_33;288197]For example: February 8th (2/8) under the "normal" rules will eliminate the "equivalent" dates 4/16 and 6/24. But if we allow "weird" dates, we also get to throw out 8/32 = 9/1, and 10/40 = 11/9, as well as 12/48 = 1/17. So we get to throw out five dates, instead of just two. It turns out that this kind of thing happens a lot...so much so that only 54 dates are left behind.

[/QUOTE]


it's actually more than 5:

1/4=2/8=3/12=4/16=5/20=6/24=7/28=8/32( or 9/1)=9/36(or 10/6) = 10/40 ( or 11/9) = 11/44(or 12/14) = 12/48 ( or 1/17) starting with this new first month date it continues to cycle unless I missed a rule.


All times are UTC. The time now is 05:34.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.