cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Paint mixtures

RichardJ
19-Tanzanite

Paint mixtures

Suppose you have N colors of paint. These can be mixed in n different proportions, and the proportions are in equal increments from 0 to 1. So, as an example, if we have Blue, Green, and Red, and they can be mixed in 3 different proportions we could have

1B 0G 0R
0B 1G 0R
0B 0G 1R
1/2B 1/2G 0R
1/2B 0G 1/2R
0B 1/2G 1/2R

So there are six possibilities (since we are talking about proportions the sum must always be 1, so combinations such as 1B 1G 0R are not allowed). If you had 4 different proportions allowed they would be 0, 1/3, 2/3, 1, and so on.

What is a general formula that describes the number of possible paint mixtures for given N and n?

I have posted this under Puzzles and Games, but I actually have a real problem that is exactly analagous to this. I wrote the problem in terms of paint mixtures because my real problem is kind of esoteric, and also proprietary. When I first looked at this I thought it would be easy to figure out, or I could just look it up somewhere. So far, neither has proved to be true 😞

Richard
21 REPLIES 21
StuartBruff
23-Emerald II
(To:RichardJ)

On 11/13/2009 11:30:47 AM, rijackson wrote:
== So there are six possibilities (since we are talking about proportions the sum must always be 1, so combinations such as 1B 1G 0R are not allowed). If you had 4 different proportions allowed they would be 0, 1/3, 2/3, 1, and so on.
== What is a general formula that describes the number of possible paint mixtures for given N and n?

It would seem to be related to the number of partitions of integers, ... can't look at it in more detail at the moment


Stuart

On 11/13/2009 12:13:08 PM, stuartafbruff wrote:
...
>It would seem to be related to the
>number of partitions of integers, ...
>can't look at it in more detail at the
>moment
>
>Stuart
_______________________________________

Superb, Stuart !
Thanks, saved .

Jean



>It would seem to be related to the number of partitions of integers, ... can't look at it in more detail at the moment < [Stuart]
____________________________

Your entries check with Neil Sloane.
The next step is the p(n,k)
I get same a Wiki and same error.
No time to check further.
p(n) is apparently a built-in MuPad.
It looks Maple has some error.

Jean

It is indeed partitions of integers. If you have n ratios they range from 0 to n-1 in units of n-1. Since the sum of the ratios must be one, the sum of the numerators must be n-1. Thus the problem is to partition n-1 into N parts, with zero allowed. And that, in turn, is combin(N+n-2,N-1). As a quick check, for the given example, combin(N+n-2,n-1)=combin(3+3-2,3-1)=combin(4,2)=6
__________________
� � � � Tom Gutman
RichardJ
19-Tanzanite
(To:TomGutman)

Thanks for the explanation and solution. The formula also works for 3 other examples I worked out by longhand.

Richard
RichardJ
19-Tanzanite
(To:RichardJ)

I should have added that the real problem actually has one more degree of complication: there are M paints, of which any N will be mixed in n fractions, so the full number of possibilities is

combin(M,N)*combin(N+n-2,n-1)

Richard
RichardJ
19-Tanzanite
(To:RichardJ)

I knew the numbers would get big, but I didn't realize quite how big until I worked it out. One of the real cases is to take 15 "paints" and add up to 12 of them together (note that the calculation for 12 "paints" already includes all the possibilities for 11 "paints", and 10 "paints", etc) in increments of 5% concentration (so 21 possible ratios), to get all possible cases. That is 38,525,903,325 possibilities. I think the client needs to be thinking in terms of plan B 🙂

Richard

Since the formula I gave allows for any of the paints to be zero, mixtures of less than the full number of paints are not a special case. I don;t see the need for that adjustment term.
__________________
� � � � Tom Gutman
RichardJ
19-Tanzanite
(To:TomGutman)

Suppose I have 4 paints: Red, Blue, Green, and Yellow. Extending the example above, for R, B, G I have six possible mixtures. I also have six possible mixtures for R, B, Y, six for R, G, Y and six for B, G, Y. So we multiply by the number of ways we can create a subset of N paints from M paints.

Richard

Ah -- you want no more than N of the M possible paints. But your formula is incorrect. You are multicounting. Mixtures with less then N paints will be a part of multiple N paint groupings.

The partitions of n-1 into k groups, with none empty is combin(n-2,k-1). So overall you need sum(combin(n-2,k-1)*combin(M,k),k=1..N) That sum might have a simpler closed form, but I don't know it.
__________________
� � � � Tom Gutman

On 11/13/2009 9:47:52 PM, Tom_Gutman wrote:
>So overall you need sum(combin(n-2,k-1)*combin(M,k),k=1..N) That sum might have a simpler closed form, but I don't know it.



Alvaro
RichardJ
19-Tanzanite
(To:AlvaroDíaz)

You need combin, not binomial, which is not quite the same. Mupad doesn't do much with it, and this is what Maple gives:



I think I'll just stick with the original expression 🙂

Richard

On 11/14/2009 9:31:05 AM, rijackson wrote:

>You need combin, not binomial, which is not quite the same.

binomial(n, r) = n!/r!/(n-r)! are the coefficients of the binomial (x+a)^n, with r the index of the sum ... so, combin are the combinations of n elements taking r of them each time, simbolized with (n,r), but vertical (2d math formula, need more html to write this).


Isn't the same, or I'm confusing?


>There appears to be a problem with this formula, because it fails (i.e. can't be evaluated) for N greater than or equal to n.

This for construction of combinations

Also it's:

binomial(n, r) = GAMMA(n+1)/(GAMMA(r+1)/GAMMA(n-r+1)

Regards. Alvaro.

>Isn't the same, or I'm confusing ?< [Alvaro]
_____________________

The expansion does not look correct about "hypergeometric". It may not be correct either wrt the front end term ?

jmG

...

RichardJ
19-Tanzanite
(To:TomGutman)

On 11/13/2009 9:47:52 PM, Tom_Gutman wrote:
>Ah -- you want no more than N
>of the M possible paints. But
>your formula is incorrect.
>You are multicounting.
>Mixtures with less then N
>paints will be a part of
>multiple N paint groupings.

Yes, you are right. I should have spotted that.

>The partitions of n-1 into k
>groups, with none empty is
>combin(n-2,k-1). So overall
>you need
>sum(combin(n-2,k-1)*combin(M,k
>),k=1..N) That sum might have
>a simpler closed form, but I
>don't know it.

It's good enough for what I need as is. Thanks.

Richard
RichardJ
19-Tanzanite
(To:TomGutman)

On 11/13/2009 9:47:52 PM, Tom_Gutman wrote:

>The partitions of n-1 into k
>groups, with none empty is
>combin(n-2,k-1). So overall
>you need
>sum(combin(n-2,k-1)*combin(M,k
>),k=1..N) That sum might have
>a simpler closed form, but I
>don't know it.

There appears to be a problem with this formula, because it fails (i.e. can't be evaluated) for N greater than or equal to n.

Richard

On 11/14/2009 9:46:22 AM, rijackson wrote:
...
>There appears to be a problem with this
>formula, because it fails (i.e. can't be
>evaluated) for N greater than or equal
>to n.
>
>Richard
__________________________

It looks so.
That stuff is too much for me !
For whatever useful.

jmG



That is true. It is doing non-empty partitions, and you can't get that if N is greater than n. Use min(N,n-1) to avoid extending the sum too high. With n levels you can't use more than n-1 paints. Or redefine combin to be zero when trying to select too may elements.
__________________
� � � � Tom Gutman
RichardJ
19-Tanzanite
(To:TomGutman)

On 11/14/2009 5:04:06 PM, Tom_Gutman wrote:
>That is true. It is doing
>non-empty partitions, and you
>can't get that if N is greater
>than n. Use min(N,n-1) to
>avoid extending the sum too
>high.

That works. An alternative is to use some algebraic manipulation to come up with this:



Which calculates correctly for all N and n.

>With n levels you can't
>use more than n-1 paints.

Well, I can, but of course all possible combinations are accounted for when N=n-1.

Richard



Paints don't mix theoretically on simple RGB or else invention. If you want to patent a special paint color and depending upon the application, it might be wise to send a sample color to a potential manufacturer (automotive, aircraft = PPG). I understand the esoteric aspect of the puzzle. My view on that is about the same as already replied. Another interesting approach is the "hypergeometric" combination.

jmG
Top Tags