#Ok to post homework #Tifany Tong, September 27th, 2020, HW #5 # Question 1 #Let P(n) = Set of permutations with values from 1 to n. #Let P_i(n) = Set of permutations in P(n) such that pi[1] = i #P(n) = A set of cardinality n! with all the permutations #P_1(n) = The set of permutations starting with 1 and the rest being the permutation with values from 2 to n. #P_2(n) = The set of permutations starting with 2 and the rest being the permutation with values from 1 and 3 to n. # .... #P_n(n) = The set of permutations starting with n and the rest being the permutation with values 1 to n-1. #P_i(n) is in bijection with P(n-1) # Going from P_i(n) to P(n-1): # If i is n, remove n from the front # Otherwise: Remove n from P_i(n) and replace it with i. # Going from P(n-1) to P_i(n): # If i is n, we put n to the front of each in P(n-1) # Otherwise: We keep i at the front and replace where i was in P(n-1) with n. #The two sets P_i(n) and P(n-1) are in bijection since |P_i(n) = P(n-1)|. #Since there are n sets of size P(n-1), which we know to be true since there is a bijection between #P_i(n) and P(n-1), then we get |P(n)| = n * |P(n-1)|. This is what we sought to prove. # Question 2 #P(n;a1,a2,a3). For this, we know that if we use a1, then we need to find the number of ways to solve # n-a1. If we use a2, then we need to find the number of ways to solve n-a2. Finally, if we use a3, # then we need to find the number of ways to solve n-a3. These 3 options will continue for n-a1, n-a2, # and n-a3. Thus, the recurrence relation is P(n) = P(n-a1) + P(n-a2) + P(n-a3). # Question 3 helper:=proc(a1,a2,a3,N) local S, val, val1, val2, val3, L: option remember: if (N = 0) then RETURN(1):fi: L:=[a1,a2,a3]: val:=min(L): if(N