Composition

## 2810077

https://math.stackexchange.com/questions/2810077

How many functions are there from 9 to 7 if every image in the codomain has 3 arguments in the domain?

I going to apply to a maths major the coming year and in order to do that, I need to pass the entry test (just so you know my level ain't high).

The general species associated to this sort of problem is :

E
(
E
(
X
)
⋅
Y
)
⋅
E
(
Y
)

{\displaystyle E(E(X)\cdot Y)\cdot E(Y)}

We consider objects like {1,2,3}-A, {4,5,6}-B, {7,8,9}-C and {D,E,F,G}

Overall we get a formula for specific cardinality :

E

3

(

E

3

(
X
)
⋅
Y
)
⋅

E

4

(
Y
)

{\displaystyle E\_{3}(E\_{3}(X)\cdot Y)\cdot E\_{4}(Y)}

Passing to e.g.f. one has

1

3
!

(

x

3

3
!

y

)

3

.

y

4

4
!

{\displaystyle {\frac {1}{3!}}\left({\frac {x^{3}}{3!}}y\right)^{3}.{\frac {y^{4}}{4!}}}

after calculus we got the sollution that is the coefficient of the e.g.f :

x

9

9
!

.

y

7

7
!

{\displaystyle 58880.{\frac {x^{9}}{9!}}.{\frac {y^{7}}{7!}}}

## 104597

https://math.stackexchange.com/questions/104597

Suppose we have six slots and six balls to allocate (one per slot). The balls are of three different colors (so two per each color), say black (b), white (w), and red (r).

How many ways are there to allocate these balls into the slots, given that the ordering of the colors does not matter, so that for example ssbbww = bbwwss, sbswwb = wswbbs and so forth.

Place a ball in the first slot and notice its color. Then the second ball of this color has 5 posision to be placed. Than we have to look to the color of the first slot of the four remaining. The second ball of the second color may be placed in 3 position. The last two positions are determined, hence 15 = 5x3
In Species Theory the described structure is a 3-set of 2-sets having the formula :

E
n

s

3

(
E
n

s

2

(
X
)
)

{\displaystyle Ens\_{3}(Ens\_{2}(X))}

The corresponding egf is

1

3
!

(

x

2

2
!

)

3

=
15

x

6

6
!

{\displaystyle {\frac {1}{3!}}({\frac {x^{2}}{2!}})^{3}=15{\frac {x^{6}}{6!}}}

In conclusion, there are 15 such different structures. Given the slots are labelled, there is no ambiguity. For example, the slot 4 and the slot 6 receive same color.

## 2937270

https://math.stackexchange.com/questions/2937270

how many ways are there to divide 180 items into 36 groups of 5

If someone want to use only once the number five and only once the number 36 he has to write the species formula which is:

E

36

(

E

5

[
X
]
)

{\displaystyle E\_{36}(E\_{5}[X])}

and means that we have a 36-set whose elements are 5-sets of one sort X.

The associated e.g.f is:

1

36
!

(

x

5

5
!

)

36

=

180
!

36
!
5

!

36

x

180

180
!

{\displaystyle {\frac {1}{36!}}\left({\frac {x^{5}}{5!}}\right)^{36}={180! \over 36!5!^{36}}{x^{180} \over 180!}}

and the answer is the coefficient of

x

180

180
!

{\displaystyle {x^{180} \over 180!}}

 i.e.

180
!

36
!
5

!

36

{\displaystyle {180! \over 36!5!^{36}}}

## 2929506

https://math.stackexchange.com/questions/2929506

How to solve 4 apples, 5 oranges and 6 bananas in 4 baskets?

The species formula for one non-empty basket is

o
n
e
B
a
s
k
e
# t
E
n

s

0

4

(
A
)
⋅
E
n

s

0

5

(
O
)
⋅
E
n

s

0

6

(
B
)
−
1

{\displaystyle oneBasket=Ens\_{0}^{4}\ (A)\cdot Ens\_{0}^{5}\ (O)\cdot Ens\_{0}^{6}\ (B)-1}

where

E

0

k

{\displaystyle E\_{0}^{k}}

 are sets with at most

k

{\displaystyle k}

 elements. A set of four non-empty baskets is:

E
n

s

4

(
o
n
e
B
a
s
k
e
t
)

{\displaystyle Ens\_{4}\ (oneBasket)}

Since the parts of a partition must be non-empty, we will have to calculate four cases, from one non-empty basket to four non-empty baskets.

After writing the cycle index we will extract some coefficients of

a

4

4
!

o

5

5
!

b

6

6
!

{\displaystyle \ {a^{4} \over 4!}{o^{5} \over 5!}{b^{6} \over 6!}\ }

 for the e.g.f. and

a

4

o

5

b

6

{\displaystyle \ a^{4}o^{5}b^{6}\ }

 for the GF, the types generating function.

**1)** We write down the cycle indices of considered species

E
n

s

0

4

(
A
)
,

E
n

s

0

5

(
O
)
,

E
n

s

0

6

(
B
)

{\displaystyle Ens\_{0}^{4}(A),\ Ens\_{0}^{5}(O),\ Ens\_{0}^{6}(B)}

Z
(
A
# )
1

a

1

1

2
!

(

a

1

2

a

2

)
.
.
.

1

4
!

(

a

1

4

.
.
.
6

a

4

)

{\displaystyle Z(A)=1+a\_{1}+{1 \over 2!}(a\_{1}^{2}+a\_{2})+...{1 \over 4!}(a\_{1}^{4}+...+6a\_{4})}

Z
(
B
# )
1

b

1

1

2
!

(

b

1

2

b

2

)
.
.
.

1

5
!

(

b

1

5

.
.
.
24

b

5

)

{\displaystyle Z(B)=1+b\_{1}+{1 \over 2!}(b\_{1}^{2}+b\_{2})+...{1 \over 5!}(b\_{1}^{5}+...+24b\_{5})}

Z
(
C
# )
1

c

1

1

2
!

(

c

1

2

c

2

)
.
.
.

1

6
!

(

c

1

6

.
.
.
120

c

6

)

{\displaystyle Z(C)=1+c\_{1}+{1 \over 2!}(c\_{1}^{2}+c\_{2})+...{1 \over 6!}(c\_{1}^{6}+...+120c\_{6})}

No further symmetric cycle indices are needed.

**2)** Then the cycle index of one non-empty basket is:

b
a
s
k
e
t
(

a

1

,

a

2

,

a

3

,

a

4

;

b

1

,

b

2

,
.
.
.
,

b

5

;

c

1

,

c

2

,
.
.
.
,

c

6

# )
Z
(
A
)
Z
(
B
)
Z
(
C
)
−
1

{\displaystyle basket(a\_{1},a\_{2},a\_{3},a\_{4};\ b\_{1},b\_{2},...,b\_{5};\ c\_{1},c\_{2},...,c\_{6})=Z(A)Z(B)Z(C)-1}

**3)** in order to make a "plethystic substitution" we need the ingredients :

b
a
s
k
e

t

2

=
b
a
s
k
e
t

(

a

2

,

a

4

,
0
,
0

;

b

2

,

b

4

,
0
,
0
,
0

;

c

2

,

c

4

,

c

6

,
0
,
0
,
0
)

{\displaystyle basket\_{2}=basket\ (a\_{2},a\_{4},0,0\ ;\ b\_{2},b\_{4},0,0,0\ ;\ c\_{2},c\_{4},c\_{6},0,0,0)}

b
a
s
k
e

t

3

=
b
a
s
k
e
t

(

a

3

,
0
,
0
,
0

;

b

3

,
0
,
0
,
0
,
0

;

c

3

,

c

6

,
0
,
0
,
0
,
0
)

{\displaystyle basket\_{3}=basket\ (a\_{3},0,0,0\ ;\ b\_{3},0,0,0,0\ ;\ c\_{3},c\_{6},0,0,0,0)}

b
a
s
k
e

t

4

=
b
a
s
k
e
t

(

a

4

,
0
,
0
,
0

;

b

4

,
0
,
0
,
0
,
0

;

c

4

,
0
,
0
,
0
,
0
,
0
)

{\displaystyle basket\_{4}=basket\ (a\_{4},0,0,0\ ;\ b\_{4},0,0,0,0\ ;\ c\_{4},0,0,0,0,0)}

**4)** In the cycle index of

E
n

s

4

{\displaystyle Ens\_{4}}

1
24

(

X

1

4

6

X

1

2

X

2

3

X

2

2

8

X

1

X

3

6

X

4

)

{\displaystyle {1 \over 24}(X\_{1}^{4}+6X\_{1}^{2}X\_{2}+3X\_{2}^{2}+8X\_{1}X\_{3}+6X\_{4})}

we replace

X
1
,

X
2
,

X
3
,

X
4

{\displaystyle X1,\ X2,\ X3,\ X4\ }

 with

b
a
s
k
e
t
,

b
a
s
k
e

t

2

,

b
a
s
k
e

t

3

,

b
a
s
k
e

t

4

{\displaystyle \ basket,\ basket\_{2},\ basket\_{3},\ basket\_{4}}

**5)** now we can extract information from the cycle index Z just obtained.

Z

t
y
p
e
s

=
Z
(
a
,

a

2

,

a

3

,

a

4

;

o
,

o

2

,
.
.
.
,

o

5

;

b
,

b

2

,
.
.
.
,

b

6

)

{\displaystyle Z^{types}=Z(a,a^{2},a^{3},a^{4};\ o,o^{2},...,o^{5};\ b,b^{2},...,b^{6})}

is the type indicator polynomial. The coefficient of

a

4

o

5

b

6

{\displaystyle a^{4}o^{5}b^{6}}

 in

Z

t
y
p
e
s

{\displaystyle Z^{types}}

 is

5808

{\displaystyle 5808}

 and it represents the number of types of partitioning the 15 mixed fruits in four nonempty baskets.

**6)** By repeating the above for 3,2, and one nonempty bucket we get

5808
1383
104
# 1
7296

{\displaystyle 5808+1383+104+1=7296}

**7)**

Z

e
g
f

=
Z
(
a
,
0
,
0
,
0
;

o
,
0
,
.
.
.
,
0
;

b
,
0
,
.
.
.0
)

{\displaystyle Z^{egf}=Z(a,0,0,0;\ o,0,...,0;\ b,0,...0)}

is the e.g.f polynomial. The coefficient of

a

4

4
!

o

5

5
!

b

6

6
!

=
42355950

{\displaystyle {a^{4} \over 4!}{o^{5} \over 5!}{b^{6} \over 6!}=42355950}

 in

Z

e
g
f

{\displaystyle Z^{egf}}

 represents the different distributions of 4+5+6 labelled fruits in four baskets.

**8)** by considering the other cases of non-empty baskets, one has :

42355950
2375101
16383
# 1
44747435

{\displaystyle 42355950+2375101+16383+1=44747435}

**9)** we may do some double check. For example, 1+104 = 105 means to distribute 5 oranges in two baskets in three ways : 5+0, 4+1, 3+2; then the apples and bananas multiplies the number of cases to 3.5.7= 105.

**10)** the

42355950

{\displaystyle 42355950}

 may be obtained faster by taking the coefficient of

x

15

{\displaystyle x^{15}}

 in

1

4
!

(
x

1

2
!

x

2

⋯

1

15
!

x

15

)

4

{\displaystyle {1 \over 4!}(x+{1 \over 2!}x^{2}+\cdots +{1 \over 15!}x^{15})^{4}}

Indeed, when distributing labelled fruits, the colouring does not matter. Whatever comnposition of a total of 15 labelled apples, oranges and bananas will produce the same number of cases.