Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I could fudge something together, but wondered if there was a proper way to accomplish this.

Say I have three sets of boxes, and each day I pick from a different box, and then rotate

  • Box 1 Day1 Day4 Day7
  • Box 2 Day2 Day5 Day8
  • Box 3 Day3 Day6 Day9

What would be the best way to determine what box to use on what day?

In simple terms, I know i am on day 5, how do I know to use box 2

If there is a good solution, what "area" of maths is it (sorry, been a while!)

Thanks

share|improve this question
    
I assume that you mean for days to go on and on, so Box 1 is chosen on days 1, 4, 7, 10, 13, 16, and so on, with similar results for the other boxes. Then to find the Box number on day $n$, do this. (i) Find the remainder $r$ when $n$ is divided by $3$. (ii) If $r=1$, you use Box 1. If $r=2$, use Box 2. If $r=0$ use Box 3. The answer would be a little nicer if you renamed Box 3, called it Box 0. The subject is, sort of, elementary number theory. Most computer languages have an operation that calculates the remainder when $n$ is divided by $k$. –  André Nicolas Oct 7 '11 at 15:58
add comment

2 Answers

up vote 0 down vote accepted

Modular arithmetic: rename Box 3 as "Box 0", and divide the day number by 3 with remainder.

Day 5: $5 = 3(1) + 2$, remainder is 2, so you use Box 2.

Day 16: $16 = 3(5) + 1$, remainder is 1, so you use Box 1.

Day 96: $96 = 3(32) + 0$, remainder is 0, so you use Box 0 (that is, Box 3).

If the day number is $n$, then there is a unique $a$, $a=0$, $1$, or $2$, with $n \equiv a\pmod{3}$. You want Box $a$.

share|improve this answer
    
thanks to you and everybody else for the help! –  Keeno Oct 7 '11 at 16:13
add comment

You want the remainder on division, so on day 17 you would divide 17 by 3, getting 5 with a remainder 2 and use box 2. It is easier if you number from 0, otherwise you need to remember that instead of 0 you use 3.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.