Six standard six-sided die are rolled. Let p be the probability that the dice can be arranged in a row such that for 1\leq k \leq 6 the sum of the first k dice is not a multiple of 3. Then p can be expressed as \frac{a}{b} where a and b are coprime positive integers. What is the value of a + b?

A hint. There are three kinds of numbers in each dice. Those leaving a remainder of 1 when divided by 3, those leaving a remainder of 2 when divided by 3, and the multiples of 3.

The remainder of a sum is equal to the sum of the remainders.
So, instead of each dice having {1,2,3,4,5,6}, let's imagine they actually have {1,2,0,1,2,0}. That is, we replace each number by its remainder. We're just Changing The Representation of problem.
This will make things easier.
Now, let's try to make a configuration of dices with {1,2}, without using the {0}.
Well, if you start with {1}, then the next number can only be {1}, right? Then, applying the same reasoning, the next number can only be {2}, and the next can only be {1}, and so on. You see, when you have a certain sum at some point of the sequence, you can only add {1} or {2} (not both), for one of them would make the sum a multiple of 3.
In the end, the only possible configuration starting with {1} and having no zeros is
112121
Analogously, the only configuration starting with {2} is 221212.
And now, what about the zeros?
It's very simple. The configurations starting with {1} (having zeros or not) are:
112121
101212
100121
100012
100001
100000
And also their permutations with the zeros (I mean, you can change the place of zeros, but not the other numbers). For instance, the example you made before, (1,1,2,1,2,3), is nothing more than a zero-permutation of the above-listed {101212}.
Doesn't it make sense? The {0} doesn't interfere in the sum, so you can just put more zeros anywhere in the configuration (but not in the beginning, of course).
Also, the configurations starting with {2} are:
221212
202121
200212
200021
200002
200000
Now, what is the total of possible dice configurations, regardless of order?
We're going to need some imagination for answering that.
Imagine we have six dices in a row, but they are blank, without any number. You have a paint-brush, to paint the numbers on them. You will determine which numbers to paint using five toothpicks.
You will place the toothpicks in the spaces between the dices, or also in the extremities of the row (before the first dice or after the last one). You may put several toothpicks on the same place, but you must place them all somewhere.
Then, you paint all the dices before the first toothpick with the number 1;
all the dices between the first and second toothpick with the number 2;
all the dices between the second and third toothpick with the number 3, and so on.
Do you realize that, by analyzing all the possibilities for toothpick-placing, we're also getting all the possible dice configurations, regardless of order, through an one-to-one correspondency? Again, we're Changing The Representation of the problem (I usually do that a lot when solving them).
For example, the {1,1,1,2,2,3} is the result of the following toothpick-placing:
OOOIOOIOIII
Fine, you will have 11 imaginary objetcs on the table (6 dices and 5 toothpicks). But you don't know yet which of these objects will be "toothpicks" (for you didn't place them). You must "elect" five of them to be toothpicks. So, it's a combination problem.
11 choose 5 = 462
Now comes the hard part. We must take each one of those 12 configurations we listed before, and calculate how many "real-life" configurations they represent. Remember that each one of those digits actually stand for two real-life numbers.
Example: the configuration {101212}.
- Some of these {1}'s represent an actual {1} (they are true numbers), but others represent a {4} (they are fake numbers). We must use again the toothpick method: we have three numbers {1} and we must place one toothpick somewhere between them to separate the "true" numbers from the "fake" ones. Result: 4 possibilities.
- We do the same with the {2}'s. Result: 3 possibilities.
- And the {0} can also can be true or fake, so more 2 possibilities.
- Multiply it all: 4*3*2 = 24.
So {101212} stands for 24 dice configurations. Keep doing this toothpick-placing with all the 12 imaginary configurations, and then sum everything. Divide the result by 462 and then you'll find p. Plz tell me what the answer comes out.

The answer is 43.

To solve this problem, we need to find the number of favorable outcomes and the total number of possible outcomes.

Let's first define the events for which the sum of the first k dice is not a multiple of 3 for 1 ≤ k ≤ 6. We'll use the following notation: A1 represents the event where the sum of the first die is not a multiple of 3, A2 represents the event where the sum of the first two dice is not a multiple of 3, and so on until A6.

We can find the number of favorable outcomes for each event by using combinations. For example, to find the number of favorable outcomes for A1, we need to count the number of ways we can get a sum of the first die that is not a multiple of 3. There are 4 possible outcomes (1, 2, 4, 5), since 3 and 6 are multiples of 3. Similarly, for A2, there are (4^2 - 2) = 14 favorable outcomes, for A3 there are (4^3 - 2^3) = 56 favorable outcomes, and so on.

Now, we need to find the total number of possible outcomes. Since each die has 6 faces, there are a total of 6^6 possible outcomes when rolling six standard six-sided dice.

To compute the probability p, we need to find the product of the probabilities of the individual events A1, A2, ..., A6. Since the events are independent, we can multiply their probabilities together.

The probability of event A1 is 4/6 (since there are 4 favorable outcomes out of 6 possible outcomes). The probability of event A2 is 14/36 (14 favorable outcomes out of 36 possible outcomes), and so on.

Therefore, p = (4/6) * (14/36) * (56/216) * (304/1296) * (1504/7776) * (1296/46656) = 16128/839808.

The fraction 16128/839808 is already in reduced form, so a = 16128 and b = 839808.

Finally, a + b = 16128 + 839808 = 855936.

Thus, the value of a + b is 855936.