Author Topic: A puzzle for everyone  (Read 2829 times)

Offline Mince

  • .
  • Posts: 6978
  • Utter Waste of Time
A puzzle for everyone
« on: September 16, 2015, 03:19:38 PM »
I have a puzzle which I think everyone is capable of doing, though it takes some thinking.

Let's say that the day number d of any date is a number from 0 to 6, with SUN = 0, MON = 1, TUE = 2, WED = 3, THU = 4, FRI = 5, SAT = 6.

EXAMPLES: the day number of WED 16 SEP 2015 is 3 because it's a Wednesday, and the day number of THU 17 SEP 2015 is 4 because it's a Thursday.


PUZZLE: If you are given the day number d of 01 January of any year, how many days must you add to that first day to get to the first Monday of that year? For example, the first day of this year THU 01 JAN 2015, so you would have to add on 4 days to get to the first Monday. For this puzzle, however, you have to provide a formula (such as 2 x d + 1) for ANY year.

You can use add +, subtract -, multiply ×, and brackets.


You can also use divide ÷, but assume this always gives the whole number only, so:

    10 ÷ 2 = 5     20 ÷ 4 = 5     23 ÷ 10 = 2
    11 ÷ 2 = 5     21 ÷ 4 = 5     35 ÷ 10 = 3
    12 ÷ 2 = 6     25 ÷ 4 = 6     48 ÷ 10 = 4
    13 ÷ 2 = 6     27 ÷ 4 = 6     89 ÷ 10 = 8


You can also use remainder %, which always gives the remainder of a divide (which I hope you remember from primary school), so:

    10 % 2 = 0     20 % 4 = 0     23 % 10 = 3
    11 % 2 = 1     21 % 4 = 1     35 % 10 = 5
    12 % 2 = 0     25 % 4 = 1     48 % 10 = 8
    13 % 2 = 1     27 % 4 = 3     89 % 10 = 9



So your answer might look like this: You have to add on (d % 10) ÷ 2 days to get to the first Monday of the year, where d is the day number of 1 JAN of that year. (And, no, this is not the correct answer, before everyone on the board PMs me this.)

The first person who provides the correct answer gets a GENIUS badge.

Feel free to post here, but PM the answer once you have it.

Those who find this easy might wish to come up with a second formula for the number of days you have to subtract from the last day of the year (31 DEC) to get the last Monday of the year, again assuming you know the day number of the last day of the year.
« Last Edit: September 16, 2015, 03:45:11 PM by Mince »

Offline Tarquin Thunderthighs lll

  • .
  • Posts: 5847
  • They call me Tarqs... and other stuff.
Re: A puzzle for everyone
« Reply #1 on: September 16, 2015, 03:52:53 PM »
Dammit - I've almost had it three times, but I keep taking away the number I first thought off, right at the death...  >:(
I apologise, in advance.

Offline Roger Kettle

  • Roger
  • *
  • Posts: 5008
  • Ho! Ho! £$%^&* Ho!
Re: A puzzle for everyone
« Reply #2 on: September 16, 2015, 07:39:45 PM »
Is it Pancake Tuesday?

Sandy Buttcheeks

  • Guest
Re: A puzzle for everyone
« Reply #3 on: September 16, 2015, 08:36:54 PM »
I have two answers, but I'm not sure which is correct...

Answer 1...Who gives a shit.
Answer 2...Stick your genius award up your ar*e

Was I close?

Offline Diane CBPFC

  • .
  • Posts: 4538
Re: A puzzle for everyone
« Reply #4 on: September 17, 2015, 12:11:27 AM »
I'll take the #4 special.
People will come from strange lands to hear me speak my words of wisdom. They will ask me the secret of life and I will tell them. Then maybe I'll finish off with a song. The Nomad

Offline Mince

  • .
  • Posts: 6978
  • Utter Waste of Time
Re: A puzzle for everyone
« Reply #5 on: September 17, 2015, 06:17:59 AM »
Another that has taxed my brain is the following: given a span of days and a starting date (say 200 days starting from 12 FEB 2015), and given that you know the day number of the first day, how many Sundays are there in this span?

These are puzzles I have had to solve recently, and a clue as to why is that the Beau Peep strip does not appear on a Sunday.

Offline Mince

  • .
  • Posts: 6978
  • Utter Waste of Time
Re: A puzzle for everyone
« Reply #6 on: September 17, 2015, 06:58:15 AM »
Anyway, here's the answer to the puzzle:

If the day number of 01 JAN is 0 (SUN), we have to add on 1 day to get to the first Monday; if it's 1 (MON), we don't have to add on any days, so 0; if it's 2 (TUE), we have to add on 6 days to get to the first Monday; and so on. Here is a table of the number of days to add on depending on the day number of 01 JAN.

DAY
SUN
MON
TUE
WED
THU
FRI
SAT
DAY NUMBER
0
1
2
3
4
5
6
DAYS TO ADD   
1
0
6
5
4
3
2

We notice in almost all cases the DAY NUMBER and the DAYS TO ADD add to 8, so first we subtract the DAY NUMBER from 8, and produce a new row in blue.

DAY
SUN
MON
TUE
WED
THU
FRI
SAT
DAY NUMBER
0
1
2
3
4
5
6
8 - DAY NUMBER   
8
7
6
5
4
3
2
DAYS TO ADD   
1
0
6
5
4
3
2

We now notice that the DAYS TO ADD is simply the remainder obtained when we divide the blue row by 7.

8 ÷ 7 = 1 rem 1
7 ÷ 7 = 1 rem 0
6 ÷ 7 = 0 rem 6
5 ÷ 7 = 0 rem 5
4 ÷ 7 = 0 rem 4
3 ÷ 7 = 0 rem 3
2 ÷ 7 = 0 rem 2

So the answer is simply to subtract the day number from 8 and then divide by 7 and take the remainder.

So the formula is (8 - day number) % 7.

Offline Tarquin Thunderthighs lll

  • .
  • Posts: 5847
  • They call me Tarqs... and other stuff.
Re: A puzzle for everyone
« Reply #7 on: September 17, 2015, 09:01:05 AM »
Ah, yes - but what about Leap Years, eh?

Can't you just get a calendar? Or a diary?
I apologise, in advance.

Sandy Buttcheeks

  • Guest
Re: A puzzle for everyone
« Reply #8 on: September 20, 2015, 07:20:12 PM »
Or a life?

Diamond Lil

  • Guest
Re: A puzzle for everyone
« Reply #9 on: September 20, 2015, 09:45:16 PM »
 :) 

Offline Mince

  • .
  • Posts: 6978
  • Utter Waste of Time
Re: A puzzle for everyone
« Reply #10 on: September 20, 2015, 10:56:20 PM »
Hey, I've already got one: I bought it from honest Abdul.