Stars and Bars

Lesson · Intermediate

Combinatorics

71.1

x+y+z=20 x+y+z=20

x,y,zx,y,z are positive integers.

Stars and bars representation of x plus y plus z equals 20

There are

(192) \binom{19}{2}

ways to place two dividers between 20 stars.

71.2

x1+x2++xk=n x_1+x_2+\cdots+x_k=n
xi1 x_i\ge1
(n1k1) \boxed{\binom{n-1}{k-1}}

71.3

x+y+z+w=30 x+y+z+w=30
x5,y3,z0,w1 x\ge-5,\qquad y\ge3,\qquad z\ge0,\qquad w\ge1

Transform the variables as follows:

x=x+61 x'=x+6\ge1
y=y21 y'=y-2\ge1
z=z+11 z'=z+1\ge1
w=w1 w'=w\ge1

Then

x+y+z+w=35 x'+y'+z'+w'=35

so the number of solutions is

(343) \boxed{\binom{34}{3}}

71.4

x+y+z30 x+y+z\le30
x,y,z1 x,y,z\ge1

Consider the possible values of x+y+zx+y+z:

x+y+z#(x,y,z)30(292)29(282)28(272)3(22) \begin{array}{c|c} x+y+z & \#(x,y,z)\\ \hline 30 & \binom{29}{2}\\ 29 & \binom{28}{2}\\ 28 & \binom{27}{2}\\ \vdots & \vdots\\ 3 & \binom{2}{2} \end{array}
#(x,y,z)=(22)+(32)++(292)=(303) \#(x,y,z) = \binom{2}{2} +\binom{3}{2} +\cdots +\binom{29}{2} = \boxed{\binom{30}{3}}

71.5

x+y+z=20 x+y+z=20
7x1 7\ge x\ge1
y1 y\ge1
z1 z\ge1

Total:

x+y+z=20,x,y,z1 x+y+z=20,\qquad x,y,z\ge1
(192) \binom{19}{2}

Unfavorable:

x+y+z=20 x+y+z=20
x8,y1,z1 x\ge8,\qquad y\ge1,\qquad z\ge1

Set

x=x71 x'=x-7\ge1

Then

x+y+z=13 x'+y+z=13

and the number of unfavorable solutions is

(122) \binom{12}{2}

Therefore,

Favorable=(192)(122) \boxed{\text{Favorable}=\binom{19}{2}-\binom{12}{2}}