Permutation Problem! Need some experts.

There are 5 different red balls,5 different green balls,5 different blue balls and 5 different black balls.In how many ways can they be arranged so that no two balls of same color are adjacent ?

#Combinatorics #Logic #Permutation #HelpMe! #Advice #MathProblem #Math #Opinions

Note by Rushi Rokad
7 years, 8 months ago

No vote yet
13 votes

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

I think this is right, but it needs checking... Some of the formulae are very long, so you may need to scroll to read this.

I am assuming that the red balls are indistinguishable from each other, and similarly for the green, blue and black balls. If you want to be able to tell the red (green, blue, black) balls apart, multiply by 5!45!^4.

For any a,b,c,d1a,b,c,d \ge 1, let N(a,b,c,d)N(a,b,c,d) be the number of orderings of aa red balls, bb green balls, cc blue balls and dd black balls for which no two consecutive balls are the same colour.

There are (a+b+c+d)!a!b!c!d! \frac{(a+b+c+d)!}{a!b!c!d!} orderings of aa red balls, bb green balls, cc blue balls and dd black balls altogether. For any of these orderings the red balls will occur in some number α\alpha (where 1αa1 \le \alpha \le a) of sequences of consecutive reds. The number of ways in which the aa red balls can be distributed amongst α\alpha sequences of consecutive reds is just equal to the number of ordered partitions of aa which have α\alpha elements, namely (a1α1){a-1 \choose \alpha-1}. If the bb green balls come in β\beta sequences of consecutive greens, the cc blue balls come in γ\gamma sequences of consecutive blues, and the dd black balls come in δ\delta sequences of consecutive blacks, then there are (b1β1){b-1 \choose \beta-1} ways of distributing the green balls amongst the β\beta sequences, (c1γ1){c-1 \choose \gamma-1} ways of distributing the blue balls amongst the γ\gamma sequences, and (d1δ1){d-1\choose \delta-1} ways of distributing the black balls amongst the δ\delta sequences. Moreover there are N(α,β,γ,δ)N(\alpha,\beta,\gamma,\delta) ways in which the sequences can be ordered so that no two sequences of the same colour are next to each other (in which case they would join in to a single sequence), and this leads us to the fairly daunting formula: (a+b+c+d)!a!b!c!d!  =  α=1aβ=1bγ=1cδ=1dN(α,β,γ,δ)(a1α1)(b1β1)(c1γ1)(d1δ1) \frac{(a+b+c+d)!}{a!b!c!d!} \; = \; \sum_{\alpha=1}^a \sum_{\beta=1}^b \sum_{\gamma=1}^c \sum_{\delta=1}^d N(\alpha,\beta,\gamma,\delta){a-1 \choose \alpha-1}{b-1\choose \beta-1}{c-1 \choose \gamma-1}{d-1 \choose \delta-1} We need to invert this formula to calculate N(a,b,c,d)N(a,b,c,d). Introduce the generating function F(A,B,C,D)  =  α,β,γ,δ=1N(α,β,γ,δ)(α1)!(β1)!(γ1)!(δ1)!AαBβCγDδ F(A,B,C,D) \; = \; \sum_{\alpha,\beta,\gamma,\delta=1}^\infty \frac{N(\alpha,\beta,\gamma,\delta)}{(\alpha-1)!(\beta-1)!(\gamma-1)!(\delta-1)!}A^\alpha B^\beta C^\gamma D^\delta Then eA+B+C+DF(A,B,C,D)=(p,q,r,s=0ApBqCrDsp!q!r!s!)(α,β,γ,δ=1N(α,β,γ,δ)(α1)!(β1)!(γ1)!(δ1)!AαBβCγDδ)=p,q,r,s0α,β,γ,δ1N(α,β,γ,δ)p!q!r!s!(α1)!(β1)!(γ1)!(δ1)!Ap+αBq+βCr+γDs+δ=a,b,c,d1(α=1aβ=1bγ=1cδ=1dN(α,β,γ,δ)(a1α1)(b1β1)(c1γ1)(d1δ1))(a1)!(b1)!(c1)!(d1)!AaBbCcDd=a,b,c,d1(a+b+c+d)!a!b!c!d!(a1)!(b1)!(c1)!(d1)!AaBbCcDd \begin{array}{rcl} e^{A+B+C+D}F(A,B,C,D) & = & \displaystyle\left(\sum_{p,q,r,s=0}^\infty \frac{A^pB^qC^rD^s}{p!q!r!s!}\right)\left(\sum_{\alpha,\beta,\gamma,\delta=1}^\infty \frac{N(\alpha ,\beta,\gamma, \delta)}{(\alpha-1)!(\beta-1)!(\gamma-1)!(\delta-1)!}A^\alpha B^\beta C^\gamma D^\delta \right) \\ & = & \displaystyle\sum_{{p,q,r,s \ge 0}\atop{\alpha,\beta,\gamma,\delta\ge1}} \frac{N(\alpha,\beta,\gamma,\delta)}{p!q!r!s!(\alpha-1)!(\beta-1)!(\gamma-1)!(\delta-1)!}A^{p+\alpha}B^{q+\beta}C^{r+\gamma}D^{s+\delta} \\ & = & \displaystyle\sum_{a,b,c,d \ge1}\frac{\left(\sum_{\alpha=1}^a \sum_{\beta=1}^b \sum_{\gamma=1}^c \sum_{\delta=1}^d N(\alpha,\beta,\gamma,\delta){a-1 \choose \alpha-1}{b-1\choose \beta-1}{c-1 \choose \gamma-1}{d-1 \choose \delta-1}\right)}{(a-1)!(b-1)!(c-1)!(d-1)!} A^aB^bC^cD^d \\ & = & \displaystyle\sum_{a,b,c,d \ge 1} \frac{(a+b+c+d)!}{a!b!c!d!(a-1)!(b-1)!(c-1)!(d-1)!}A^aB^bC^cD^d \end{array} and so F(A,B,C,D)  =  e(A+B+C+D)(a,b,c,d1(a+b+c+d)!a!b!c!d!(a1)!(b1)!(c1)!(d1)!AaBbCcDd) F(A,B,C,D) \; = \; e^{-(A+B+C+D)}\left(\sum_{a,b,c,d \ge 1} \frac{(a+b+c+d)!}{a!b!c!d!(a-1)!(b-1)!(c-1)!(d-1)!}A^aB^bC^cD^d\right) and a similar calculation to the one above shows that F(A,B,C,D)  =  p,q,r,s1a=1pb=1qc=1rd=1s(1)p+q+r+sabcd(a+b+c+d)!a!b!c!d!(p1a1)(q1b1)(r1c1)(s1d1)(p1)!(q1)!(r1)!(s1)!ApBqCrDs F(A,B,C,D) \; = \; \sum_{p,q,r,s\ge1}\frac{\sum_{a=1}^{p}\sum_{b=1}^{q}\sum_{c=1}^{r}\sum_{d=1}^{s} (-1)^{p+q+r+s-a-b-c-d}\frac{(a+b+c+d)!}{a!b!c!d!}{p-1 \choose a-1}{q-1 \choose b-1}{r-1 \choose c-1}{s-1 \choose d-1}}{(p-1)!(q-1)!(r-1)!(s-1)!}A^pB^qC^rD^s which gives us N(p,q,r,s)  =  a=1pb=1qc=1rd=1s(1)p+q+r+sabcd(a+b+c+d)!a!b!c!d!(p1a1)(q1b1)(r1c1)(s1d1) N(p,q,r,s) \; = \; \sum_{a=1}^{p}\sum_{b=1}^{q}\sum_{c=1}^{r}\sum_{d=1}^{s} (-1)^{p+q+r+s-a-b-c-d}\frac{(a+b+c+d)!}{a!b!c!d!}{p-1 \choose a-1}{q-1 \choose b-1}{r-1 \choose c-1}{s-1 \choose d-1} for p,q,r,s1p,q,r,s \ge 1. This is not a closed formula, but good enough for our purposes, since we only need to calculate 625625 terms to evaluate N(5,5,5,5)N(5,5,5,5). Mathematica tells me that N(5,5,5,5)=134631576N(5,5,5,5) = 134631576. For comparison 20!5!×5!×5!×5!=11732745024\tfrac{20!}{5!\times5!\times5!\times5!} = 11732745024.

It would be interesting if someone who knew more multinomial identities could evaluate the sum for N(a,b,c,d)N(a,b,c,d).

N.B. Note that N(a,b,c,d)N(a,b,c,d) is sometimes 00 (for example N(7,1,1,1)=0N(7,1,1,1)=0), and this formula does give the right answer in those cases.

Mark Hennings - 7 years, 8 months ago

Log in to reply

Hi Mark,

Super! Your formula matches with the computer counted values for first few terms. Also, I think we can extend it for more colours.

N(p,q,r) matches with A110706, but does not have your formula.

Perhaps Dr. Zeilberger may be knowing whether a closed form exists or not.

gopinath no - 7 years, 8 months ago

Wow. That's a lot more complex than I was anticipating!

Rushi R.: Did you have a specific application in mind for this problem? Did it come from somewhere? Or did you just make it up and have trouble solving it yourself? The solution we have so far does not suggest the problem would be appropriate for a contest, which is kind of where I was assuming it came from.

Christopher Johnson - 7 years, 8 months ago

Log in to reply

My maths teacher is just absolutely good at creating tough questions.Accidentally, he gave us this question to solve.But,later when he tried to solve this question, he did the same mistake as everyone else..

Rushi Rokad - 7 years, 8 months ago

This looks good.

Another way of explaining the inversion would be to use the technique Principle of Inclusion and Exclusion, which would be more familiar. Of course, these approaches use the same underlying ideas, which also explains why the resultant formula looks so similar to the general case of PIE.

Calvin Lin Staff - 7 years, 8 months ago

Log in to reply

If the Inclusion-Exlcusion Principle is to be used, we need some multi-dimensional version of it. I would be interested to see that expressed...

Mark Hennings - 7 years, 8 months ago

Log in to reply

@Mark Hennings Choosing the 'correct' interpretation is extremely useful in this question. PIE is meant to be applied to events that are easily counted, and in this case considering them as distinct balls makes it easier to motivate the approach. (Note: For those who are wondering about the above comment, the 'multi-dimensional version' ends up being required because we need to account for the different colors having consecutive balls. If the question was simply about having no consecutive red balls, then we could apply PIE directly.)

So, let the 5 red balls be labelled RiR_i (same for the other colors), and we will remember to account for the double counting by dividing out by (5!)4 (5!) ^ 4. Create the events Ri,j R_{i,j} which indicates that the RiR_i and RjR_j balls are next to each other (and same for the other colors). We are interested in finding (the complement of) Ri,j \cup R_{i,j} , and to do this we apply PIE directly.

For example, the set of single events works out to having (at least) 1 pair of same colored balls next to each other. After accounting for the double counting, you will see that this correlates to your formula with values a+b+c+d=5 a+b+c+d = 5 .

The set of double events works out to having (at least) 2 pairs of same colored balls next to each other. This gets slightly complicated, as it could be 2 different colors, the same color but distinct sets of balls, the same color but 1 repeated ball. After accounting for the double counting, you can see that this correlates with having a+b+c+d=6 a+b+c+d = 6 .

Continuing on in this way, the set of nn events correlates with having a+b+c+d=n+4a+b+c+d = n +4 . This is slightly tricky to consider, but bear in mind that there are sets of 3 events with 0 outcomes, like R1,2R2,3R1,3 R_{1,2} \cup R_{2,3} \cup R_{1,3} , since we can't have all 3 balls being next to each other. In fact, the only way that nn events do not lead to 0 outcomes, is to have the colored events 'chain up', where R1,2R2,3R3,4 R_{1,2} \cup R_{2,3} \cup R_{3,4} corresponds to having 4 consecutive red balls.

Hence, in this way, we are able to get at your final formula, without requiring the generating function argument. _\square

As I pointed out earlier, the generating function argument is actually PIE in disguise. Those who are interested should figure out how and why it works, and compare it to the Mobius transform in Number Theory.

(As a side note, in your final formula, if you used the substitution a=a1 a = a-1 and p=p1 p = p-1, then the equations will appear nicer, and the formulas above will not need the constant 4.)

Calvin Lin Staff - 7 years, 8 months ago

Log in to reply

@Calvin Lin I think that both our methods are pretty much equally delicate; both have their elegancies and their clumsinesses. You have to work quite hard to break up your sum over the possibilities as a sum over four variables, and there is quite a lot of detail you have omitted. I think that honours are even, really! While the generating function technique, the PIE and the Binomial inversion formula are all equivalent in this case, there are plenty of cases where the generating function technique will succeed when the others will not.

If I make the substitutions you suggest, then my binomial coefficients become simpler, but my multinomial coefficient becomes more complex (it collects the 11s and 44s), and the formula is then for N(p+1,q+1,r+1,s+1)N(p+1,q+1,r+1,s+1). A matter of swings and roundabouts.

Mark Hennings - 7 years, 8 months ago

I was just waiting for your answer....Thanks..

Rushi Rokad - 7 years, 8 months ago

Hi;

Here is a nifty way to compute it but it will require a CAS to expand the expression.

The answer is

(1,1,1,1)(w0000x0000y0000z).((0111101111011110).(w0000x0000y0000z))19.(1111)\left (1,1,1,1 \right )\cdot\left( \begin{array}{cccc} w & 0 & 0 & 0 \\ 0 & x & 0 & 0 \\ 0 & 0 & y & 0 \\ 0 & 0 & 0 & z \\ \end{array} \right).\left(\left( \begin{array}{cccc} 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 \\ \end{array} \right).\left( \begin{array}{cccc} w & 0 & 0 & 0 \\ 0 & x & 0 & 0 \\ 0 & 0 & y & 0 \\ 0 & 0 & 0 & z \\ \end{array} \right)\right)^{19}.\left( \begin{array}{c} 1 \\ 1 \\ 1 \\ 1 \\ \end{array} \right)

This will yield a large, large 4 variable polynomial. If you check the coefficient of

w5x5y5z5w^5 x^5 y^5 z^5

You will see the answer 134631576.

bobbym none - 7 years, 8 months ago

Log in to reply

My knowledge of matrices is minimal, but I'm very interested in what your formula is "saying" on an intuitive level. What concepts is it expressing, and why does it work?

Christopher Johnson - 7 years, 8 months ago

Log in to reply

Do some of the matrix multiplication first, to make things simpler. We are looking at aTA19b  =  (wxyz)(0xyzw0yzwx0zwxy0)19(1111) \mathbf{a}^\mathsf{T}A^{19}\mathbf{b} \; = \; \left( \begin{array}{cccc}w & x & y & z\end{array}\right) \left(\begin{array}{cccc}0 & x & y & z \\ w & 0 & y & z \\ w & x & 0 & z \\ w & x & y & 0 \end{array}\right)^{19}\left(\begin{array}{c} 1 \\ 1 \\ 1 \\ 1 \end{array}\right) If we consider the row vector aTAn1\mathbf{a}^\mathsf{T}A^{n-1} for any positive integer nn, we see that all four terms in the vector are sums of monomials in w,x,y,zw,x,y,z of order nn. The effect of the matrix multiplication by AA is that none of the monomials has ww followed directly by ww, xx followed directly by xx, yy followed directly by yy or zz followed directly by zz. The monomials in the first term in aTAn1\mathbf{a}^\mathsf{T}A^{n-1} all end in ww. Those in the second term all end in xx, those in the third term all end in yy and those in the fourth term all end in zz. At least, all of this is true if we do not perform any algebra like identifying xyxxyx with x2yx^2y.

Thus, if we look at aTA19b\mathbf{a}^\mathsf{T}A^{19}\mathbf{b}, we are simply adding together all the monomials in aTA19\mathbf{a}^\mathsf{T}A^{19}, and so we have the sum of all monomials of order 2020 which never contain the same variable repeated consecutively. If we now use algebra to identify like terms and collect them together, we end up with a homogeneous polynomial of degree 2020 in w,x,y,zw,x,y,z, where the coefficient of waxbyczdw^ax^by^cz^d is the number of monomials in four variables of order 2020 which contain aa copies of ww, bb copies of xx, cc copies of yy and dd copies of zz and which, moreover, have no variable repeated consecutively. In other words, the coefficient of waxbyczdw^ax^by^cz^d is N(a,b,c,d)N(a,b,c,d).

This formula enables a computer to sort the 4×3194\times3^{19} sequences of length 2020 of four colours which contain no consecutively repeated colours, and pick out the coefficient N(5,5,5,5)N(5,5,5,5) (and others). In computational terms, however, the formula effectively requires us to calculate all 4.64.6 billion monomials, only to throw most of them away. The computation time for N(5,5,5,5)N(5,5,5,5) using this method is quite big.

Mark Hennings - 7 years, 8 months ago

Log in to reply

@Mark Hennings Hi;

Theoretical considerations are fine but nothing beats trying the code. It only takes around 5 seconds even on my old machine with Mathematica.

The multivariable polynomial is only 891 terms and is not exactly wasted information. Solutions to every possible problem where the number of balls is 20 have been generated.

For small problems like this one it is feasible and on hand so I used it.

bobbym none - 7 years, 8 months ago

@Mark Hennings Great explanation! We are working in a non-commutative algebra, which is why xyxx2y xyx \neq x^2 y . This allows us to store the order in which the letters appear.

The middle matrix represents a transition matrix where we can only move on to a distinct letter, and hence we are guaranteed to have "no two consecutive letters" that are the same. We raise it to the power 19 since we want to have 19 pairs of consecutive letters, which gives a total of 20. The initial and final vector (matrices) then allows us to count the number of sequences which start with ww or xx or yy or zz.

Calvin Lin Staff - 7 years, 8 months ago

Hi;

This was given to me by a mathematician on the SE in the past. I am afraid it is a little bit too much for me. It looks like a matrix shorthand for a generating function since it generates all the solutions like a gf does.

There is also a recurrence equation but I did not get that either.I seemed to have caused confusion and controversy with that idea. My intent was only to corroborate Mark and Gopinath's answers. I apologize.

bobbym none - 7 years, 8 months ago

Please Explain..I am very interested in what you did ..

Rushi Rokad - 7 years, 8 months ago

Log in to reply

Hi;

Please look at my reply to Christopher. The great John von Neumann once said that in math we do not understand things we just get used to them. He was probably joking but it actually is true in my case. I can use the method, understanding like love comes later ( hopefully ).

bobbym none - 7 years, 8 months ago

Here goes: Arrange the red and green balls first. There are 5!5!25!*5!*2 ways to do this (do you see why?).

Now grabs the blue balls. Observe that there are 11 spaces to place one of them in the row of 10 red and green balls. We have to pick 5 of them, without repeating a space. This can be done in (115){11}\choose{5} ways and 5!5! orders.

After this, grab the black balls. Observe that there are now 16 spaces to place one of them in the row of 15 red, gren and blue balls. We have to pick 5 of them, without repeating a space. This can be done in (165){16}\choose{5} ways and 5!5! orders.

Thus in total we have 5!5!25!*5!*2*(115){11}\choose{5}5!*5!*(165){16}\choose{5}5!*5! ways of ordering the 20 balls.

That is over 8 trillion ways.

Ton de Moree - 7 years, 8 months ago

Log in to reply

You have considered a case where between any two red balls there is always a green ball....There are several cases where there is no green ball between two red balls..Please reply soon..I need your help.

Rushi Rokad - 7 years, 8 months ago

Log in to reply

Hmm, indeed!

My first though was to fix that by adding a factor 4!4! to account for the order of the colours, but that doesn't work either.

I'm trying to think of another way, but most involve spererating several cases, which is something we don't want to do with this amount of balls...

Ton de Moree - 7 years, 8 months ago

Log in to reply

@Ton de Moree When you arranged red and green balls in the first place, you said there are 5!5!25!*5!*2 number of ways to do that. How?

Lokesh Sharma - 7 years, 8 months ago

Log in to reply

@Lokesh Sharma You either start with a red or green ball (factor 2) then the rest of the colours is fixed. Only thing to add is 5!25!^2 for the orders of the different reds and the different greens.

Ton de Moree - 7 years, 8 months ago

Log in to reply

@Ton de Moree Thanks, you opened my eyes. I was rather using 5!6!5!*6! to computer the number of ways for arranging red and green balls. Now I am getting the same answer as yours.

Lokesh Sharma - 7 years, 8 months ago

Using the fact that if there are nn places than rr things can be arranged in nPrnPr no of ways -

  • Arranging red balls would account for 5P55P5 or 5!5! ways.
  • Arranging green balls given red balls are arranged in a particular way would result in 6P56P5 or 6!6! no of ways.
  • Arranging blue balls given the above balls are arranged in a particular way will give 11P511P5 or 11!/6!11!/6! no of ways.
  • Now black balls can be arranged in 16P516P5 or 16!/11!16!/11!

Total no of ways = 16!5! 16!*5!

[EDIT: The total number of ways are 5!5!216!6!\frac{5!*5!*2*16!}{6!} as number of ways to arrange red and green balls is 5!5!25!*5!*2 not 5!6!5!*6!]

Lokesh Sharma - 7 years, 8 months ago

Log in to reply

You got the same problem as Ton D...

Rushi Rokad - 7 years, 8 months ago

Log in to reply

Yeah, I see. The above solution is wrong. Anyway, I tried finding the answer using Python and I found out the answer is very much close to 5!5!216!6!35\frac{5!*5!*2*16!}{6!}*35.

Lokesh Sharma - 7 years, 8 months ago

Log in to reply

@Lokesh Sharma Can I please know what Python is ?

Rushi Rokad - 7 years, 8 months ago

Log in to reply

@Rushi Rokad its a programming language

siddharth shah - 7 years, 8 months ago

Log in to reply

@Siddharth Shah and a snake too.

Lokesh Sharma - 7 years, 8 months ago

Log in to reply

@Lokesh Sharma i see..very enlightening

siddharth shah - 7 years, 8 months ago

Log in to reply

@Siddharth Shah Hahaha

Lokesh Sharma - 7 years, 8 months ago

Is the answer 7,46,496?

Akshay Ginodia - 7 years, 8 months ago

Log in to reply

I am sorry I don't have the answer..

Rushi Rokad - 7 years, 8 months ago

20*15^19

Saketh Maddamsetty - 7 years, 8 months ago

The following recurrence also looks good:

f(p,q,r,s)={0if any of p,q,r,s<01if any one of p,q,r,s=1 and others 02if any two of p,q,r,s=1 and others 06if any three of p,q,r,s=1 and the other’s 024if p,q,r,s=1f(p1,q1,r,s)+f(p1,q,r1,s)+f(p1,q,r,s1)+f(p,q1,r1,s)+f(p,q1,r,s1)+f(p,q,r1,s1)+2(f(p,q1,r1,s1)+f(p1,q,r1,s1)+f(p1,q1,r,s1)+f(p1,q1,r1,s))+3f(p1,q1,r1,s1)p,q,r,s>1 f(p,q,r,s)=\left\{\begin{matrix} 0 & \text{if any of }p,q,r,s<0\\ 1 & \text{if any one of }p,q,r,s = 1 \text{ and others } 0\\ 2 & \text{if any two of }p,q,r,s = 1 \text{ and others } 0\\ 6 & \text{if any three of }p,q,r,s = 1 \text{ and the other's } 0\\ 24 & \text{if }p,q,r,s = 1 \\ f(p-1,q-1,r,s)+f(p-1,q,r-1,s)+f(p-1,q,r,s-1)+ & \\ f(p,q-1,r-1,s)+f(p,q-1,r,s-1)+f(p,q,r-1,s-1)+ & \\ 2\cdot \big(f(p,q-1,r-1,s-1) + f(p-1,q,r-1,s-1) + & \\ f(p-1,q-1,r,s-1) + f(p-1,q-1,r-1,s)\big) + & \\ 3\cdot f(p-1,q-1,r-1,s-1) & p,q,r,s > 1 \end{matrix}\right.

In plaintext: f(p,q,r,s) = f(p-1,q-1,r,s)+f(p-1,q,r-1,s)+f(p-1,q,r,s-1)+f(p,q-1,r-1,s)+f(p,q-1,r,s-1)+f(p,q,r-1,s-1)+2(f(p,q-1,r-1,s-1) + f(p-1,q,r-1,s-1) + f(p-1,q-1,r,s-1) + f(p-1,q-1,r-1,s)) + 3f(p-1,q-1,r-1,s-1)

gopinath no - 7 years, 8 months ago

201514131212111099876654332*1

Ahmed Nabih - 7 years, 7 months ago

in how many ways can a person distribute 6 books among 3 people such that none get equal of books?

Apoorv Tewari - 3 years, 6 months ago

Is the answer 80?

Ilham Adiyaksa - 7 years, 8 months ago

Log in to reply

No..The answer can not be that less..

Rushi Rokad - 7 years, 8 months ago

Log in to reply

Following ton d select any two arrange them n then put the others btw the gaps n multiply by 2.

Himank bhalla - 7 years, 8 months ago
×

Problem Loading...

Note Loading...

Set Loading...