# A Math Problem

Permutation: “one of the ways in which a number of things can be ordered or arranged.”

Collins English Dictionary

Ever since introducing Mini Pans back in 2017, I’ve been amazed at the many different ways Pocket Palette owners have been customizing their palettes using our stainless steel watercolor pans. After scratching our heads about this around the shop, we’d really like to know–how many permutations of our four sizes of pans are possible in our standard Pocket Palette?

We’ll give the first three people who show us proof–or at least a good enough argument to convince us–a free Essential Colors Pocket Palette and a water brush.

Rules and guidelines:

- Any combination of our four pan sizes is allowed, so long as there are no empty spaces left over.
- Different arrangements that use the same combination of sizes should be included (such as left-handed and right-handed variations), as they offer distinct experiences.
- The Pocket Palette fits 28 mini pans in a 4×7 grid.
- 1 Standard Pan = 2 Mini Pans.
- 1 Double Pan = 2 Standard Pans side-by-side, or 4 Mini Pans in a square.
- 1 Large Pan = 2 Double Pans, 4 Standard Pans, or 8 Mini Pans as pictured below.

Happy calculating!

## 28 Responses to “A Math Problem”

## Kat

Infinite. No matter how you arrange the pans, of which there are numerous ways, you can always rearrange and change the colors in said pans. This, as you stated, creates a new unique experience. With all the variations in shades, you could be creating new palettes for the rest of your life.

## Kat

Though, I suppose if you’re looking for a mathematical proof, we can break out the factorials 28! + 14! + 6! + 3!, not sure about the other bits…it’s been awhile since math class. That would be 3.0488834e+29 at least.

## Carl

Kat,

I think you are over counting. 28! would reflect the number of ways you can arrange 28 unique 1×1 pans, but I believe that the intent of the question is to consider each 1×1 pan identical.

So, I think you need to count the number of different combinations that could fill the pan from:

28 1x1s = one arrangement

26 1x1s, 1 1×2 = 21 + 24 = 35 arrangements

….

…

3 2x4s, 2 1x2s = at least 14 arrangements

## xavier

Oh this is tricky.

I tried first to think like that. Ok lets have 3 mixing pans and a remaining column.

The column can be 4 minis, 2 standards or 2 minins and 1 sandards with 3 alternate positions . So 5 different rows.

The mixing pan and rows can be arranged ten ways (accounting for vertical, horizontal, and switching positions of the row and vertical mixing pan.

So we already have 10×5= 50 possibilities.

Then you can start to replace 1 mixing pan with doubles (3 ways because 3 pans). Or 2 mixing pans with doubles (also three ways. Or 3 mixing pans with doubles 1 way. Total 7 possibilities.

50×7=350.

Little problem. Some of those combinations are identical. But let’s forget about that for a while.

then we can continue and switch doubles with standard. Some of them. and combine. Then we get an extra 30000 combinations or so, added to the 350 previous (trust me, with care).

And then we continue by switching the standard with minis. Eventualy come cases will be identical if we branch out but who cares.

This step probably give us two more orders of grandeur on the total so I am guessing that we have close to 3 000 000 possibilities.

And this does not account for standard and doubles being able to be in between rows. And in between columns.

So you probably have to add a couple of millions of possibility for that.

I will guess 5.

That’s it, i wont be able to sleep now.

One way to solve this would be to the same reasoning but program this, so that for each solution found, the computer can keep track if it is already present through one other branch. Should be feasible.

My head is smoking now.

## Maria

Oh, wow! I’m fascinated. This is bigger than I expected!

## Carl

If you want to sell pre-made *sets* of pans that will fill the palette, you will need 116 SKUs to cover every possible configuration. Then it will be up to the purchaser to figure out how they want to arrange their sets. I haven’t figured out a reasonable way to compute all the different ways of packing the different configurations.

## Xavier JULLIA

This Problem is facinating. :).

Ok I still don’t knlw how to calculate how many combinaison there is but at least i found a way to calculate what it can’t be above.

If you separate lines and columns.

A combinaison in lines can be for example 1+1+1+4 or 2+2+1+2 since it must add up to seven.

seen all combinations of 1 2 and 4s and adding order you end up at max 31x31x31x31 (because 4 lines with 31 combinations each).

Doind the same for colums of 4s you get 6x6x6x6x6x6x6 (because 7 colums with 6 combinations each.

In the end if you multiply the two number you get 923521×279936

which is 258 526 774 656 variations.

And this is way over the possibilities of the real problem. Since all combinations of 1 2 and 4s are not independent. They depend on the shape of the pans. Even number of combinations row to row and colums to colums are much more limited. So it’s probably safe to say that you can divide by 10 or more.

## Terica

There are 116 possible combinations of sizes, however there is no way I’m aware of to calculate the various left/right/top/bottom/diagonal options available.

## Susan

It won’t be infinite, as we are only looking at combinations of pans and not taking different colours into consideration.

And the minimum is four, for just using one type of pan in the palette. I’ll have to go think about this one a bit more.

## xavier

line 1 you can have mini, std vertical or horizontal, multi and mixing vertical or horizontal. Combining carefully that makes 1704 possibilities for line 1.

line 2 and three you now can exclude vertical mixing pans. So we end up with 964 possibilities on each of those lines.

Line 4 you can exclude also multi and vertical std and horizontal mixing. So only 21 ways left.

1704x964x964x21 gives

33 253 928 064 possibilities.

Of course this is a maximum possible number. A lot of possibilities have to be excluded. for example if you have a multi or any vertical on a row the possibilities for the next row are affected. So maybe as much as half the cases are invalid.

Getting closer. :)

## Arnaldo

Minimum pans on the palette with no empty spaces left over is 5 (3large + 2std)

Maximum permutation for a large pan equivalent size is 10 (1 large + 2double + 1double/2std + 1double/1std/2mini + 1double/4mini + 4std + 3std/2mini + 2std/4mini + 1std/6mini + 8mini).

Maximum permutation for 2 standard pan equivalent size is 3 (2std + 1std/2mini + 4mini).

Maximum permutations possible of the four sizes of pans in a standard Pocket Palette is therefore 3000 (10x10x10x3).

I think.

## Arnaldo

Ooops, I did not read well the rules!

Different arrangements that use the same combination of sizes multiply the number of possible permutations…

## Arnaldo

4194304

Considering different arrangements that use the same combination of sizes we have 64 possible permutations for a large pan equivalent size.

We can have 3 large pans, therefore 64x64x64=262144

The remaining half large pan equivalent size can have 4 possible combinations multiplied 4 possible raw positions (right, center-right, center-left, left), that is 16 variations.

262144×16=4194304

Hopefully…

## David Jinkins

Hi Maria, very cool combinatorics problem, also one which, like many combinatorics problems is difficult and tedious to solve. I can give you a surprisingly high lower bound, though. First, let’s only consider the “dominos”, the 2×1 pieces, and the “singletons”, the 1×1 pieces. There is a really cool and surprising formula involving cos and pi for counting the number of domino tilings on a given rectangle (http://math.uchicago.edu/~may/REU2015/REUPapers/Borys.pdf). For your 7 x 4 rectangle, it turns out there are 781 domino tilings. Without double counting we can replace each of the fourteen dominos with singletons in each of the tilings to get 781 * 14 = 10934 more permutations. Continuing with this method, we can replace any two dominos (14 choose 2 = 91 ways), but we have to be careful to avoid double counting, since two adjacent vertical and two adjacent horizontal dominos will be replaced the same way by singletons. To get a conservative lower bound, we can divide by two, yielding 781 * 91 / 2 = 35,535 more permutations. Continuing with replacing three dominos with singletons, to avoid double counting we can get a lower bound by dividing by three. This gives us an additional 364 * 781 / 3 = 94,761 more permutations. Continuing with 4 dominos, I get a lower bound of 1001 * 781 / 5 = 156,356 We could keep going, but I get less confident about the right number to divide by to avoid double counting. In addition to this method, we can go the other way and place a single domino (with everything else singletons) in 45 different ways. If we place two dominos, we need cases. Following the method described here for a chess board (https://math.stackexchange.com/questions/2555783/chessboard-8-times8-and-domino-1-times2), we get (41 * 8 + 40 * 10 + 39 * 14 + 38 * 13) / 2 = 884 more permutations. Of course you could keep this counting going, but you can see it is going to get tedious fast. Adding together all the numbers here, you have a lower bound of more than 250,000 permutations just with the singletons and dominos, and I guess the actual number is one order of magnitude larger.

## Maria

Wow! Thanks for breaking that down so clearly

## Arnaldo

NO WAIT! It is the double of that… I was considering only rows.

There are still 4 possible combinations of the half large pan equivalent size!

Those are splitted to the sides of a couple of horizontally positioned large pans, either with the remaining large pan to the right or to the left.

That means the possbile positions of the half pan equivalent area are not 4 but 8, which multiplied by the 4 possible combinations results 32.

Therefore 262144×32=8388608

I hope this is my last post… :-)

## Maria

Thank you so much for all of your ideas and calculations!

## Diana

This is beautiful. The exquisite little video is beautiful- how the big pans entering the palette do so in time with the music and then the visual delight of the pans arranging and changing. Imagining my friends (Darin and Maria and Nika) sitting around puzzling with it in gorgeous Port Townsend under Northwest Winter skies that are so beautiful in my mind, and hopefully, somewhere in there, warm ceramic cups of coffee and tea, held by hands I love. And finally, the math challenge. The beauty of the number challenge itself and the attempts at formulas, the flaws of the formulas, the math-just-for-fun-ness of it all. The jolt of pure human curiosity I feel and share with other humans, and all of it on Valentine’s Day. Beautiful. Just beautiful.

## Maria

Sending you love, Diana!

## Deane

I really like Carl’s entrepreneurd answer of 116 SKUs.

This gets out of hand fast, so I’ll try starting with the easy part. Here are the numbers of combos that could fit in each of the pans (including the pan of that size itself).

1 = 1×1

2 = 2×1

8 = 2×2

81 = 4×2

The 4x2s are a bit tricky. There are 8 kinds of 2x2s, and each can stack on each to form a 4×2, so that’s 64. But there are also 4 kinds of 4x2s with a 2×2 in the middle, and there are 4 kinds of 2x2s with at least half the middle horizontal unsplit, so that’s an additional 16. Plus a single 4×2 by itself, of course. So that’s:

81 = 64 + 16 + 1

How many full kit arrangements include three 4x2s? There are 10 with a full-height column 1 wide, and 4 with half-columns 1 wide. There are 5 ways to organize a full 1-wide column and 4 ways for a 1-wide column split in the middle, so that’s:

66 = (10 x 5) + (4 x 4)

So, the total kit arrangements so far are:

4 x 10^7 = 66 * 81^3

An argument could be made that I should now add up the number of kit arrangements which include at most two 4x2s (i.e., a third 4×2 won’t fit due to the placement of the 2x1s), and multiply that by 81^2. Then do the same for the kit arrangements which include at most 1 4×2 and multiply by 81, and then add those in which not a single 4×2 will fit. However, I should also subtract duplicates from the set with three 4x2s, e.g., everything with adjacent vertical 4x2s that contain only squares will have a duplicate when the 4x2s are rotated 90 degrees.

But, those adjustments won’t change the highest order exponent in the calculation. Therefore they won’t change the order of magnitude of the answer or even the significant figure.

## Maria

Hi Deane!

Thanks for chiming in. Ok, so 66 * 81^3= 35,075,106! Wow, this is an order of magnitude more than I was imagining when we started to think about this little problem.

## Maria

And I just can’t stop laughing at

“entrepreneurd” 😆

## Mali

We’re just counting EMPTY pans right? cause with colours….*brain explodie*

## Maria

Yes, just empty. I think there’s infinite possibilities with colors!

## Oliver

A fascinating problem, indeed, and as a software developer I’ve tried to approach it with the tools of my trade.

Unless there is an error in my reasoning or a bug in the final program, we are looking at about 40,800,000 possible combinations.

I have manually verified the algorithm for a hypothetical 2×3 “Tiny Palette” which allows for 26 permutations (using only Mini, Standard, and Double Pans, as a Large Pan would not fit), but will have to perform a few more tests to be sure.

For the 4×3 Demi Palette, by the way, the result is only a “meager” 1,135 possible combinations. That seems very low compared to almost 41 million for the Pocket Palette, but that’s the way exponential problems behave.

I will send a private message with the exact number and an explanation of the algorithm once I’m confident in the numbers. :)

## Maria

Thanks for exploring this problem! 30,000,000-50,000,000 has come up a few times, now I’ll be interested in your explanation! Good to know for the Demi Palette! 1,135 is a number I can wrap my head around. 😆

## Kelly Darpinian

My son wrote a program to calculate it here: https://james.darpinian.com/pocket-palette.html. It’s a VERY large number!!!

## Maria

Wow, so cool! We’ll review it and let you know if we have any questions!