From 602e80c02b0be98fa3f4acf2a30f636cd36e72e2 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Thu, 14 Nov 2024 23:49:13 -0600 Subject: [PATCH] cs-3333: add hw 5 --- .../CS-3333/Assignments/5/Assignment.typ | 567 ++++++++++++++++++ 1 file changed, 567 insertions(+) create mode 100644 Fall-2024/CS-3333/Assignments/5/Assignment.typ diff --git a/Fall-2024/CS-3333/Assignments/5/Assignment.typ b/Fall-2024/CS-3333/Assignments/5/Assignment.typ new file mode 100644 index 0000000..df779dc --- /dev/null +++ b/Fall-2024/CS-3333/Assignments/5/Assignment.typ @@ -0,0 +1,567 @@ +#show link: set text(blue) +#set text(font: "Calibri") +#show raw: set text(font: "Fira Code") +#set table.cell(breakable: false) +#set table(stroke: (x, y) => ( + left: if x > 0 { + .1pt + }, + top: if y == 1 { + 0.5pt + } else if y > 1 { + 0.1pt + }, +)) + + +#set math.mat(delim: "[") +#set page("us-letter") +#let solve(solution) = { + block( + inset: 5pt, + stroke: blue + .3pt, + fill: rgb(0, 149, 255, 15%), + radius: 4pt, + )[#solution] +} + +#let solvein(solution) = { + let outset = 3pt + h(outset) + box( + outset: outset, + stroke: blue + .3pt, + fill: rgb(0, 149, 255, 15%), + radius: 4pt, + )[#solution] +} + +#let note(content) = { + block( + inset: (left: 5pt, right: 5pt, top: 10pt, bottom: 10pt), + stroke: luma(20%) + .3pt, + fill: luma(95%), + radius: 4pt, + )[#content] +} + +#let notein(content) = { + let outset = 3pt + h(outset) + box( + outset: outset, + stroke: luma(20%) + .3pt, + fill: luma(95%), + radius: 4pt, + )[#content] +} + +#align(center)[ + = CS 3333 Mathematical Foundations + Homework 5 (100 pts)\ + #underline[Price Hiller] | #underline[zfp106] +] +#line(length: 100%, stroke: .25pt) + + +*Questions*\ +Please write down the major intermediate steps. + +1. Calculate the rank of the following matrices. (12 pts) + + #grid( + columns: 2, + align: center, + gutter: 2em, + [ + $A = mat( + 2, -1, 3; + 1, 0, 1; + 0, 2, -1; + 1, 1, 4; + )$ + ], + [ + (6 pts) + ], + grid.cell( + colspan: 2, + [ + #note[ + #grid( + column-gutter: (1em, 4em, 1em, 1em), + columns: 2, + align: left + horizon, + row-gutter: 2em, + [$R_4 = R_4 - R_2$], + [$mat( + 2, -1, 3; + 1, 0, 1; + 0, 2, -1; + 0, 1, 3; + )$], + [$R_1 = 1 / 2 R_1$], + [$mat( + 1, -1/2, 3/2; + 1, 0, 1; + 0, 2, -1; + 0, 1, 3; + )$], + + [$R_2 = R_2 - R_1$], + [$mat( + 1, -1/2, 3/2; + 0, 1/2, -1/2; + 0, 2, -1; + 0, 1, 3; + )$], + [$R_2 = 2R_2$], + [$mat( + 1, -1/2, 3/2; + 0, 1, -1; + 0, 2, -1; + 0, 1, 3; + )$], + + [$R_4 = R_4 - R_2$], + [$mat( + 1, -1/2, 3/2; + 0, 1, -1; + 0, 2, -1; + 0, 0, 4; + )$], + [$R_3 = R_3 - 2R_2$], + [$mat( + 1, -1/2, 3/2; + 0, 1, -1; + 0, 0, 1; + 0, 0, 4; + )$], + + [$R_4 = R_4 - 3R_3$], + [$mat( + 1, -1/2, 3/2; + 0, 1, -1; + 0, 0, 1; + 0, 0, 0; + )$], + grid.cell(colspan: 2, align: center, solve[The rank of $A$ is 3.]) + ) + ] + ], + ), + colbreak(), + colbreak(), + [ + $B = mat( + 3, 2, -1; + 2, -3, -5; + -1, -4, -3; + )$ + ], + [ + (6 pts) + ], + grid.cell( + colspan: 2, + [ + #note[ + #grid( + column-gutter: (1em, 4em, 1em, 1em), + columns: 2, + align: left + horizon, + row-gutter: 2em, + [$R_2 = R_2 + 2R_4$], + [$mat( + 3, 2, -1; + 0, -11, -11; + -1, -4, -3; + )$], + + [$R_2 = -1 / 11 R_2$], + [$mat( + 3, 2, -1; + 0, 1, 1; + -1, -4, -3; + )$], + + [$R_4 ↔ R_2$], + [$mat( + 3, 2, -1; + -1, -4, -3; + 0, 1, 1; + )$], + + [$R_2 = R_2 + 1 / 3R_1$], + [$mat( + 3, 2, -1; + 0, -10/3, 10/3; + 0, 1, 1; + )$], + + [$R_2 = -3 / 10 R_2$], + [$mat( + 3, 2, -1; + 0, 1, 1; + 0, 1, 1; + )$], + + [$R_3 = R_3 - R_2$], + [$mat( + 3, 2, -1; + 0, 1, 1; + 0, 0, 0; + )$], + grid.cell(colspan: 2, align: center, solve[The rank of $B$ is 2.]) + ) + ] + ], + ), + ) + + + + +2. Solve the following systems using the inverse of a matrix. (12 pts) + + #grid( + columns: 2, + align: center, + gutter: 2em, + [ + $ + -7x + 3y &= -34\ + 8x -4y &= 44 + $ + ], + [ + (4 pts) + ], + grid.cell( + colspan: 2, + [ + #note[ + #columns(2)[ + $ + cases( + -7x + 3y = -34\ + 8x -4y = 44 + ) -> mat( -7, 3, -34; 8, -4, 44; augment: #2)\ + $ + $ + R_1 &= -1 / 7 R_1& &-> mat( 1, -3/7, -34/7; 8, -4, 44; augment: #2)\ + R_2 &= R_2 - 8R_1& &-> mat( 1, -3/7, -34/7; 0, -4/7, 36/7; augment: #2)\ + R_2 &= -7 / 4R_2& &-> mat( 1, -3/7, -34/7; 0, 1, -9; augment: #2)\ + R_1 &= R_1 + 3 / 7R_2& &-> mat(1, 0, 1; 0, 1, -9; augment: #2)\ + $ + #solve[$x = 1, y = -9$] + ] + ] + ], + ), + [ + + $ + 5x + 15y + 56z &= 35\ + -4x - 11y -41z &= -26\ + -x - 3y - 11z &= -7 + $ + ], + [ + (8 pts) + ], + grid.cell( + colspan: 2, + [ + #note[ + #block(inset: (left: 30pt, right: 30pt))[ + $ + cases( + 5x + 15y + 56z& =& 35\ + -4x - 11y -41z& =& -26\ + -x - 3y - 11z& =& -7 + ) -> mat(5, 15, 56, 35; -4,-11,-41,-26;-1,-3,-11,-7; augment: #3)\ + $ + $ + R_1 &= 1 / 5 R_1& &-> mat(1, 3, 56/5, 7; -4,-11,-41,-26;-1,-3,-11,-7; augment: #3)\ + R_2 &= R_2 + 4R_1& &-> mat(1, 3, 56/5, 7; 0, 1, 19/5, 2;-1,-3,-11,-7; augment: #3)\ + R_3 &= R_3 + R_1& &-> mat(1, 3, 56/5, 7; 0, 1, 19/5, 2;0,0,1/5,0; augment: #3)\ + R_1 &= R_1 - 3R_2& &-> mat(1,0,-1/5,1; 0, 1, 19/5, 2;0,0,1/5,0; augment: #3)\ + R_3 &= 5R_3& &-> mat(1,0,-1/5,1; 0, 1, 19/5, 2;0,0,1,0; augment: #3)\ + R_1 &= R_1 +1 / 5 R_3& &-> mat(1,0,0,1; 0, 1, 19/5, 2;0,0,1,0; augment: #3)\ + R_2 &= R_2 - 19 / 5 R_3& &-> mat(1,0,0,1; 0, 1, 0, 2;0,0,1,0; augment: #3)\ + $ + #solve[$x = 1, y = 2, z=0$] + ] + ] + ], + ), + ) + +#align(center + bottom, note[#text(size: 3em)[⇊ SEE NEXT PAGE ⇊]]) +#pagebreak() + +3. Find the eigenvalues and eigenvectors of the following matrices. (12 pts) + + #grid( + columns: 2, + align: center, + gutter: 2em, + [ + $A = mat( + 2, 3; + -3, -5; + )$ + ], + [ + (4 pts) + ], + grid.cell( + colspan: 2, + [ + #note[ + #block(inset: (left: 30pt, right: 30pt))[ + #underline[Calculating Eigenvalues] + $ + A - λ ⋅"I" &= mat(2 - λ, 3;-3, -5 - λ)&\ + mat(delim: "|", 2 - λ, 3;-3, -5 - λ) &= 0&\ + (2 - λ)(-5-λ) - 3(-3) &=0&\ + (2 - λ)(-5-λ) + 9 &=0&\ + (-3 + sqrt(13)) / 2,(-3 - sqrt(13)) / 2&= λ&\ + $ + #underline[Calculating Eigenvectors] + #solve[ + Eigen Values: $(-3 + sqrt(13)) / 2,(-3 - sqrt(13)) / 2$ + ] + ] + ] + #align(left)[#text( + red, + weight: "black", + )[And it is at this point that I have run out of time :(. I forgot this was due tonight, I thought today was the 13th until I saw that football was on at 9pm. My stomach dropped a few miles as you might imagine. At this point, I've winged it and scraped what I could together. May the dice roll in my favor.]] + ], + ), + [ + $B = mat( + 2, 0, 0; + 0, 4, 5; + 0, 4, 3; + )$ + ], + [ + (8 pts) + ], + grid.cell(colspan: 2, []), + ) + + +4. List all the permutations of ${P,Q, R, S}$ (6 pts). + + #solve[ + #grid( + align: center, + columns: 4, + [ + ${P,Q,R,S}$ + ${P,Q,S,R}$ + ${P,R,Q,S}$ + ${P,R,S,Q}$ + ${P,S,Q,R}$ + ${P,S,R,Q}$ + ], + [ + ${Q,P,R,S}$ + ${Q,P,S,R}$ + ${Q,R,P,S}$ + ${Q,R,S,P}$ + ${Q,S,P,R}$ + ${Q,S,R,P}$ + ], + [ + ${R,P,Q,S}$ + ${R,P,S,Q}$ + ${R,Q,P,S}$ + ${R,Q,S,P}$ + ${R,S,P,Q}$ + ${R,S,Q,P}$ + ], + [ + ${S,P,Q,R}$ + ${S,P,R,Q}$ + ${S,Q,P,R}$ + ${S,Q,R,P}$ + ${S,R,P,Q}$ + ${S,R,Q,P}$ + ], + )] + +#align(center + bottom, note[#text(size: 3em)[⇊ SEE NEXT PAGE ⇊]]) +#pagebreak() + +5. Calculate the value of each of these quantities (10 pts). + + #grid( + columns: 3, + align: center, + gutter: 2em, + [ + a. $P(7,2)$ + #solve[$7! / (7 - 2)! = 42$] + ], + [ + b. $P(6,3)$ + #solve[$6! / (6 - 3)! = 120$] + ], + [ + c. $P(12,9)$ + #solve[$12! / (12 - 9)! = 79,833,600$] + ], + + [ + d. $C(9,5)$ + #solve[$9! / (5! ⋅ (9 - 5)!) = 120$] + ], + [ + f. $C(12,7)$ + #solve[$12! / (7! ⋅ (12 - 7)!) = 792$] + ], + ) + +6. How many ways are there to select a first-prize winner, a second-prize winner, and a third-prize winner from 180 different people who have entered a contest? (6 pts) + + #note[$180 ⋅ 179 ⋅ 178 = #solvein[5,735,160]$] + +7. How many bit strings of length 16 contain... (12 pts) + + #grid( + columns: 2, + align: center, + gutter: 2em, + [ + a. Exactly five 0s? + #solve[$16! / (5! ⋅ (16 - 5)!) = 4,368$] + ], + [ + b. At most five 0s? + #note[ + $ + &C(16,0) &= &16! / (0! ⋅ (16 - 0)!)& &= &1\ + + &C(16,1) &= &16! / (1! ⋅ (16 - 1)!)& &= &16\ + + &C(16,2) &= &16! / (2! ⋅ (16 - 2)!)& &= &120\ + + &C(16,3) &= &16! / (3! ⋅ (16 - 3)!)& &= &560\ + + &C(16,4) &= &16! / (4! ⋅ (16 - 4)!)& &= &1,820\ + + &C(16,5) &= &16! / (5! ⋅ (16 - 5)!)& &= &4,368\ + $ + #align(center)[#solve[$6,885$]] + ] + ], + + [ + c. At least five 0s? + #note[ + $ + 2^16 - 6,885 = #solvein[58,651] + $ + ] + ], + [ + d. An equal number of 0s and 1s? + #note[ + $ + C(16,8) = 16!/(8! ⋅ (16 - 8)!) = #solvein[12,870] + $ + ] + ], + ) +#align(center + bottom, note[#text(size: 3em)[⇊ SEE NEXT PAGE ⇊]]) +#pagebreak() + +8. How many permutations of letters ${"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"}$ contain (no letters repeated)... (12 pts) + +#grid( + columns: 2, + gutter: 1em, + inset: (left: 2em, right: 2em), + [ + a. The string AJ? + #note[ + Our set is ${{"AJ"}, "B", "C", "D", "E", "F", "G", "H", "I"}$. + + Total of 9 permutations: $9! = #solvein[362,880]$ + ] + ], + [ + b. The string BIG? + #note[ + Our set is ${{"BIG"}, "A", "C", "D", "E", "F", "H", "J"}$. + + Total of 8 permutations: $8! = #solvein[40,320]$ + ] + ], + + [ + c. The strings AEG and DB? + #note[ + Our set is ${{"AEG"}, {"DB"}, "C", "F", "H", "I", "J"}$. + + Total of 7 permutations: $7! = #solvein[5,040]$ + ] + ], + [ + d. The strings BG, FC, and AE? + #note[ + Our set is ${{"AE"}, {"BG"}, {"FC"}, "D", "H", "I", "J"}$. + + Total of 7 permutations: $7! = #solvein[5,040]$ + ] + ], + + [ + e. The strings FIG and GIF? + #note[ + FIG = GIF + + Our set is ${"A", "B", "C", "D", "E", {"GIF"}, "H", "J"}$. + + Total of 8 permutations: $8! = #solvein[40,320]$ + ] + ], + [ + f. The strings CD and DJ? + #note[ + CD and DJ overlap, thus the string can be considered CDJ. + + Our set is ${"A", "B", {"CDJ"}, "E", "F", "G", "H", "I"}$. + + Total of 8 permutations: $8! = #solvein[40,320]$ + ] + ], +) + +9. Suppose that a department contains 9 dentists and 15 optometrists. How many ways are there to form a committee with 7 members if it must have more dentists than optometrists? (8 pts) + #note[ + $ + "1. 4 dentists and 3 optometrists" -> C(9,4) ⋅ C(15,3) &= 126 ⋅ 455 &=& 57,330\ + "2. 5 dentists and 2 optometrists" -> C(9,5) ⋅ C(15,2) &= 126 ⋅ 105 &=& 13,230\ + "3. 6 dentists and 1 optometrists" -> C(9,6) ⋅ C(15,1) &= 84 ⋅ 15 &=& 1,260\ + "4. 7 dentists and 0 optometrists" -> C(9,7) ⋅ C(15,0) &= 36 ⋅ 1 &=& 36\ + \ + \ + 57,330 + 13,230 + 1,260 + 63 = #solvein[71,883] + $ + ] + +#align(center + bottom, note[#text(size: 3em)[⇊ SEE NEXT PAGE ⇊]]) +#pagebreak() + +10. What is the coefficient of $x^17 ⋅ y^14$ in $(2x - 3y)^31$? (You do not need to calculate the final value. Just write down the formula of the coefficient) (10 pts) + + #note[ + $x = 2x, y = -3y, (X + Y)^31$ + $ + &= mat(31; 17) X^17 ⋅ Y^14\ + &= mat(31; 17) (2x)^17 ⋅ (-3y)^14\ + &= mat(31; 17) (2)^17 ⋅ (-3)^14 x^17 ⋅ y^13\ + &= #solve[$-mat(31; 17) 2^17 ⋅ 3^14$] + $ + ]