#OK to post homework #Zhizhang Deng, 09/26/2020, Assignment 5 1. Because P(n) is divided into a number of P_j(n) set. Based on the definition of 'pi' in P_j(n), P(n) totally has n P_j(n) set, reason being at location 1, there are n possbilities. Now we look at P_j(n) closely, each element 'pi' in this P_j(n) has j as fixed location 1, so |P_j(n)| = |P(n - 1)|, because j is fixed. So |P(n)| = n * |P_j(n)| * |P(n - 1)|. This is a recursive definition of p(n), p(n) = n!. 2. Let P_i be the set that contains the words in alpha bet that adds up to n but with ai as it's first element E.g. If (a1, a2, a3) = (1,2,3) and n = 3. P_1 will be the set of words that add up to 3 and with a1 as it's first element. P_1 = {{1, 1, 1}, {1, 2}}. P_2 will be {{2, 1}} etc. We can observe that the number of P_i sets in a P(n;a1,a2,a3) set will be the same as the amount of characters in the alphabet. As each character gets to be the first element at one time. Then we can define P(n;a1, a2, a3) = P_1 + P_2 + P_3. We observe closely at each of the P_i set. For each element in the P_i set, if we remove the first leading element, P_i will become P(n - ai;a1, a2, a3). So the original P(n;a1,a2,a3) = P(n - a1;a1,a2,a3) + P(n - a2;a1,a2,a3) + P(n - a3;a1, a2, a3). 4. [Clever & Good Looking] (1) in line 1, he's included 2 times (2) in line 2, he's excluded 1 times (3) in line 3, he's included 0 times (4) in line 4, he's excluded 0 times [Clever & strong & good-looking & kind-hearted] (1) in line 1, he's included 4 times (2) in line 2, he's excluded 6 times (3) in line 3, he's included 4 times (4) in line 4, he's excluded 1 times