MyA67Final (1)

pdf

School

University of Toronto, Scarborough *

*We aren’t endorsed by this school

Course

67

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

27

Uploaded by JusticeBeePerson1048

Report
Graded FINAL EXAM Student Casper Sajewski-Lee Total Points 79 / 120 pts
Question 1 EXAM INSTRUCTIONS 17 / 22 pts 1.1 STUDENT ID and DECLARATION 2 / 2 pts + 2 pts Correct + 2 pts no student number or other info. + 0 pts no proof 1.2 Counting 4 / 4 pts + 4 pts Correct + 0 pts Incorrect 1.3 (no title) 0 / 4 pts + 4 pts Correct + 0 pts Incorrect 1.4 Pizza! 4 / 4 pts + 4 pts Correct + 0 pts Incorrect 1.5 Triangles 4 / 4 pts + 4 pts Correct. C(n, 3) = n(n-1)(n-2)/6 + 1 pt gives answer for n=8 or n=5 (56 or 10), or attempt but really not on track. + 0 pts wrong or missing + 2 pts on the right track + 3 pts small error
1.6 Triangles 3 / 4 pts + 4 pts Correct. nC3 - n C(n-4,1) - n = C(n,3) - n(n-4) - n of probability is (C(n,3) - n(n-4) - n)/C(n,3) =... alternatively ... (C(n, 3) - n C(n - 2, 1) / C(n, 3) + 4 pts correct. P = 1 - prob triangles share sides. + 0 pts missing or completely wrong. + 1 pt attempts to compute probability but values are wrong. + 2 pts gets denominator or numerator correct only. + 3 pts has correct idea but small mistake in logic or calculation. + 1 pt attempts to count the number of triangles with no shared edges + 3 pts correct answer but no work shown. Question 2 Propositional Logic 8 / 8 pts 2.1 Desert Island 4 / 4 pts + 4 pts Correct + 0 pts Incorrect 2.2 Truth Values 4 / 4 pts + 4 pts Correct + 0 pts Incorrect Question 3 Integer Equations 8 / 8 pts 3.1 Integer Equation (a) 4 / 4 pts + 4 pts Correct + 0 pts Incorrect 3.2 Integer Equation (b) 4 / 4 pts + 4 pts Correct + 0 pts Incorrect ( n −1)( n −2) ( n −4)( n −5)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 4 Birthdays 5 / 5 pts + 5 pts Correctly cites the generalized PHP and says prob is therefore 1. + 4 pts Final answer not mentioned + 2.5 pts makes a reasonable attempt to find the probability using counting arguments. + 2.5 pts NO justification + 0 pts wrong + 0 pts not submitted Question 5 Conditional Probability 4 / 4 pts + 4 pts Correct + 0 pts Incorrect Question 6 Proof 0 / 10 pts + 10 pts Correct + 4 pts Recognizes its a PHP problem. + 3 pts Correctly creates holes as all the possible sums. + 1 pt Attempts to create sums or some other reasonable notion as holes. + 3 pts Correctly creates pigeons as all the possible sets. + 1 pt attempts to create a subset or other definition that is pigeons. + 0 pts Submission not found or incorrect. Question 7 Predicate Logic 4 / 4 pts + 4 pts Correct + 0 pts Incorrect Question 8 Equivalence? 0 / 4 pts + 4 pts Correct + 0 pts Incorrect
Question 9 Combinatorial Argument 0 / 5 pts + 5 pts Correct + 1 pt gives a scenario for C(n,k) + 2 pts Gives a scenario or explanation for C(n-1, k) + 2 pts Gives a scenario of explanation for C(n-1,k-1). + 0 pts missing/no answer given + 0 pts incorrect/not a combinatorial argument + 3 pts Gives scenario for each but does not properly explain how/why they connect/add up + 4 pts Correct but does not mention variables and + 2.5 pts Only writes what each term means but does not attempt to connect them together Question 10 Proof Primes 10 / 10 pts + 10 pts Correct using direct proof. + 3 pts Notice that x-1, x, x+1 are consecutive + 3 pts if consecutive, and x-1 prime, then odd and so x is even and divisible by 2. + 3 pts if consecutive, one must be divisible by 3 and since neither x-1 or x-2 are, x must be + 1 pt x div by 2 and 3 means . + 10 pts correct by using indirect. check each possible case of for each ? possible. + 2 pts Sets up contradiction/contrapositive properly. + 1 pt Contradiction/contrapositive set up almost correct + 3 pts correctly does 1 case + 4 pts correctly does 2 remainder cases + 5 pts correctly does 3 remainder cases + 6 pts correctly does 4 remainder cases + 7 pts correctly does 5 remainder cases. + 2 pts Writes the claim in predicate logic correctly + 1 pt Claim almost correct in predicate logic + 0 pts No submission/Empty Answer or completely off (gives an example of x) n k 6 ∣ x x mod 6 =?
Question 11 Proof Primes 0 / 10 pts + 10 pts Correct. (there are different variations possible). + 4 pts Sets up proof by contrapositive properly + 2 pts shows how to factor + 3 pts nearly shows that can't work if all numbers prime. Small error. + 1 pt attempts to shows that can't work if all numbers prime. missing key component. + 3 pts Make some Progress + 6 pts use and partial correct + 0 pts Missing / Wrong Question 12 (no title) 10 / 10 pts + 10 pts Correct + 4 pts states contrapositive properly - note quantifiers should still be not . (or says "assume for contradiction can be factored", they know how to proceed by contradiction) + 2 pts attempts to write in terms of a factored form. + 2 pts derives that a = c+d for some c and d. derives that b = cd. + 2 pts shows that then a is even or b is even + 0 pts Missing or incorrect + 2 pts Contradiction/contrapositive statement written incorrectly (this docs 2 marks, use instead of "states contrapos correctly") + 3 pts states contrapositive correctly, but without quantifiers + 9.5 pts Mistake/missing some justification + 0 pts Click here to replace this description. + 1 pt Completed only 1-2 cases (whether c/d is odd/even) that show a is even or b is even OR not enough explanation in this part + 0 pts proof incomplete/partially incorrect and does not state contrapositive or contradiction (ask Anna about this because I'm not sure if we should doc the 4 marks if they didnt state contrapos/contradiction, they might have been attempting a direct proof, but didn't get it right/finish) + 1 pt derives one of a = c+d, b = cd / derives this but does not clearly state it. a = 2 c 2 b 2 a = 2 ( c + b )( c b ) a = 2 ( c + b )( c b ) a + 2 b = 2 c 2 x + 2 ax + b
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 13 Induction 7 / 10 pts + 10 pts Correct + 2 pts Correctly states S(n) and the values for which we want to prove S(n) correct + 2 pts Base Case correct. + 2 pts correctly states the induction hypotheses. + 1 pt sets up I.S. properly + 1 pt correctly applies I.H for S(k). + 2 pts finishes math to complete the proof. + 0 pts no answer + 0 pts incorrect Question 14 Strong Induction 6 / 10 pts + 10 pts Correct + 2 pts Correctly states S(n) and the values for which we want to prove S(n) correct + 1 pt correctly states the induction hypotheses. + 2 pts Base Case correct - has two base cases. + 1 pt Only one correct base case + 1 pt sets up I.S. properly + 2 pts correctly applies I.H stating that we require that n-2>= 2 and n-1>=2 for it to apply. + 1 pt correctly applies I.H. but does not state why it applies + 2 pts finishes math to complete the proof. + 0 pts Wrong or no answer
Q1 EXAM INSTRUCTIONS 22 Points ALLOWED AIDS: Calculator and one page double sided of notes. CAMERA: You must be on zoom for the duration of the exam and your camera must show as much as possible of your workspace including your writing space and face (if possible). For this whole exam, please follow the directions given for each question carefully. If you are writing a long answer solution in the boxes provided you may use $$math$$ to write mathematical symbols for example $$x^2$$ would be . NOTE: GRADESCOPE logs all clicks outside the exam webpage window. Make sure you only click between the zoom call and the exam webpage. Q1.1 STUDENT ID and DECLARATION 2 Points By entering your name and student ID here you are confirming that you are adhering to the University of Toronto's academic integrity rules. I, with name and student number below, attest that I am the person with said student number and that I have not visited any webpages/applications other than our zoom call and this exam, that I have not received any help from any other person or textbook during this exam and that my only aids are a calculator and one page double sided of notes. Name and Student number: Upload student id if you have. No files uploaded Casper Sajewski-Lee 1008493701 x 2
Q1.2 Counting 4 Points How many strings are there of 0s, 1s, and 2s if there are five 0s, three 1s and three 2s. Put your answer as a numeric value only. Do not show your work. 9240 Q1.3 4 Points How many strings of length 10 are possible where there are 0s followed by 1s followed by 2s. You should assume there is at least one 0, at least one 1 and at least one 2. For example, 0011111122 and 0122222222 are valid strings but 0001121112 is not and nor is 1111112222. Hint: Try to think how to rephrase this problem into something you know. Leave your answer as a numeric value. Do not show your work. 90 Q1.4 Pizza! 4 Points You wish to order a pizza. You want to get the pick up special which requires you to order 0, 1, 2 or 3 toppings with no double toppings. There are 5 choices of toppings. How many different choices of pizza do you have? Leave your answer as a numeric value. Do not show your work. 26
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q1.5 Triangles 4 Points Consider a regular n-gon (an n sided polygon) for . For example, if n=8, we have an octagon. How many triangles can be formed by selecting corners of the n- gon. For example, for a 5-gon, two possible triangles are shown in orange and blue. You should assume each corner of the n-gon is distinguishable. State your answer. No work needed. C(n, 3) n ≥ 3
Q1.6 Triangles 4 Points Consider the n-gon and triangles from the previous question now with . Suppose you select 3 corners of the polygon at random. What is the probability that the triangle formed does not share any sides with the n-gon sides. For example, this red triangle does not share any sides in common with the octagon. Again you should assume the corners of the n-gon are distinguishable. Briefly explain your answer. State your answer and briefly show your work. C(n-4, 3)/C(n,3). There are C(n, 3) total ways to pick a triangle from the n-gon. To make a triangle with no shared sides to the n-gon, corners adjacent to a picked corner of the triangle may not be picked. For instance, if corner a is picked, corner h and b may not be picked. This happens twice, since the first corner has 2 corners that can't be picked and the second also has two corners which also may not be picked. n ≥ 4
Q2 Propositional Logic 8 Points Q2.1 Desert Island 4 Points You are on a desert island and are approached by two natives A and B who are either truth tellers or liars. In order to get help you need to determine which is which. Only A speaks: A says "We are both liars." What are A and B? Select the best answer. Not enough information to tell. Its a paradox, there is more than one possibility. Is a contradiction, no combination of truth teller and liar matches the statement. A and B are both truth tellers. A and B are both liars. A is a truth teller and B is a liar. A is a liar and B is a truth teller.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q2.2 Truth Values 4 Points Select all truth assignments of that make the following statement is true: p , q , r ( p q ) → r p=T, q=T, r=T p=T, q=T, r=F p=T, q=F, r=T p=T, q=F, r=F p=F, q=T, r=T p=F, q=T, r=F p=F, q=F, r=T p=F, q=F, r=F
Q3 Integer Equations 8 Points Q3.1 Integer Equation (a) 4 Points How many integer solutions are there to the equation with . Leave your answer as a number without any spaces. Do not show your work. 6188 Q3.2 Integer Equation (b) 4 Points Read this question carefully. You'll notice it is slightly different than what we have seen before (highlighted in red). How many integer solutions are there to the equation with , , , , , and . Leave your answer as a number without any spaces. Do not show your work. 336 x + 1 x + 2 x + 3 x + 4 x + 5 x = 6 12 x i 0, i = 1,…,6 x 1 x + 2 x + 3 x + 4 x + 5 x = 6 12 x 1 0 0 ≤ x 2 1 x 3 1 x 4 2 x 5 2 x 6 2
Q4 Birthdays 5 Points Suppose your high school has 2000 students. What is the probability that at least 5 people have a birthday on the same day? You may assume it is a 365 day year. Carefully explain your answer. Note this need not be a long answer. Q5 Conditional Probability 4 Points You have two boxes of cookies. One has an assortment of 10 chocolate cookies and 8 vanilla cookies. The second box has 5 chocolate cookies and 10 vanilla cookies. The first box is a bit bigger so when you reach into the pantry the chance of grabbing it is 60% and the chance of grabbing the second box is 40%. If you grab a box and then a cookie at random, what is the probability that the cookie came from the first box if it is chocolate? Leave your answer as a decimal number between 0 and 1 with two decimal places. For example, if you answer is 0.647 you would write 0.65. If your answer is 0.025 you would write 0.03. You do not need to show your work. .71 100%. By the PHP, if n > r(m-1) applies, then there must be one category r with at least m objects in it. Suppose n = 2000 (# of students), r = 365 (categories are days of the year), and m= 5, (we want at least 5 students in one of the categories. 2000 > 365(4) -> 2000 > 1460. Since this is a valid statement, there must be at least one day in the year when at least 5 students have the same birthday.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q6 Proof 10 Points Consider a set where each and each is unique. Prove that there exists two subset of whose sums are equal. For example, if then two possible subsets are and . You may type your answer here or upload a handwritten answer. No files uploaded Q7 Predicate Logic 4 Points Select all statements which are equivalent to the following statement: S = { x , x , x , x , x , x } 1 2 3 4 5 6 1 ≤ x i 12 x i S S = {3,5,6,9,11,12} {3,5,12} {9,11} n Z , n is even 2 n is even All integers have even squares and are even. Given an integer whose square is even, that integer is itself even There does not exist an integer that is odd and has an even square. is even is necessary for to be even. n n 2 is even is sufficient for an is even. n n 2 All integers with even squares are even integers. All integers that are even have even squares.
Q8 Equivalence? 4 Points Select all options in which the pair of statements have the same truth value for all domains and predicate definitions. and x D ,( P ( x ) ∧ Q ( x )) (∀ x D , P ( x )) ∧ (∀ x D , Q ( x )) and x D ,( P ( x ) ∧ Q ( x )) (∃ x D , P ( x )) ∧ (∃ x D , Q ( x )) and x D ,( P ( x ) ∨ Q ( x )) (∀ x D , P ( x )) ∨ (∀ x D , Q ( x )) and x D ,( P ( x ) ∨ Q ( x )) (∃ x D , P ( x )) ∨ (∃ x D , Q ( x )) and x D ,( P ( x ) → Q ( x )) (∀ x D , P ( x )) → (∀ x D , Q ( x )) and x D ,( P ( x ) → Q ( x )) (∃ x D , P ( x )) → (∃ x D , Q ( x )) None of the above
Q9 Combinatorial Argument 5 Points We used a combinatorial argument in a proof on Assignment 1. Use a combinatorial argument to prove the following identity. Do not use algebra and the factorial form of the formulas to prove this equation. Consider how you can select items from . Put your answer in the box or upload a handwritten file. No files uploaded n is reduced by k and n-k. n-1 is reduced by k-1 and n-1-k+1, or n-k. Therefore, since we pick n-k for both combination statements and we pick both k-1 and k for one of the two combination statements, that means that In total, we pick n- k objects and k objects from n, which means we pick complete the equation C(n, k). C ( n , k ) = C ( n − 1, k ) + C ( n − 1, k − 1) k n
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q10 Proof Primes 10 Points Consider a natural number such that and are both prime. Prove that is divisible by 6. Write the claim in predicate logic and prove the statement. You may use words and symbols such as " is prime" and " ". Put your answer in the box or upload a handwritten file. x > 5 x − 1 x + 1 x x − 1 6 ∣ x
IMG_20211211_101400233.jpg Download
Q11 Proof Primes 10 Points Prove prime prime prime Put your answer in the box or upload a handwritten file. No files uploaded a N ,∀ b N ,∀ c N ,( a b c ) → a + 2 b = 2 c 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q12 10 Points Prove HINT: Consider Put your answer in the box or upload a handwritten file. a Z ,∀ b Z ,( a odd b odd ) → ( x + 2 ax + b ) cannot be factored ( x + c )( x + d )
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
IMG_20211211_102301500.jpg Download
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q13 Induction 10 Points Prove for all natural numbers . Put your answer in the box or upload a handwritten file. IMG_20211211_101340748.jpg Download = i =1 n (2 i −1)(2 i +1) 1 2 n +1 n n ≥ 1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Q14 Strong Induction 10 Points Consider the sequence definition: Prove that for all natural numbers , . Put your answer in the box or upload a handwritten file. p = 0 3 p = 1 7 p = n 3 p n −1 2 p n −2 n ≥ 2 p = n 2 n +2 1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
IMG_20211211_101311763.jpg Download
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help