ebook img

CS 70 Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Final PDF

19 Pages·2015·0.21 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview CS 70 Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Final

CS 70 Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Final PRINTYourName: , (last) (first) SIGNYourName: PRINTYourStudentID: CIRCLEYourExamRoom: 2050VLSB 10EVANS OTHER Nameofthepersonsittingtoyourleft: Nameofthepersonsittingtoyourright: Thediscussionsectionyouusuallyattend: × # Time TA × # Time TA × # Time TA 9 10–11am Caroline 4 4–5pm Jerry 1 5–6pm Lexing 2 11–12pm Favian 5 4–5pm Kunal 6 5–6pm Akshay 3 12–1pm NathanZ. 7 4–5pm NathanM. 8 5–6pm Anna 10 1–2pm Diana • Aftertheexamstarts,pleasewriteyourstudentID(orname)oneveryoddpage(wewillremovethe staplewhenscanningyourexam). Youshouldnotwriteanything,includingyourSIDorname,after timeisup. • We will not grade anything on the extra pages (Pages 19–20) or outside of the space provided for a problemunlessweareclearlytoldinthespaceprovidedforthequestiontolookthere. • Exceptspecialnotices,youmustshowyourworktogetcredits. • You may consult three single-sided sheets (or one double-sided sheet plus one single-sided sheet) of notes. Apartfromthat,youmaynotlookatbooks,notes,etc. Calculators,phones,andcomputersare notpermitted. • Youhave170minutes. Thereare17questionsforatotalof160pointsplus20bonuspoints. Usethe numberofpointsasaroughguidefortheamountoftimetoallocatetothatquestion. • Thereare20pages(sides)ontheexam. Notifyaproctorimmediatelyifapageismissing. Donotturnthispageuntilyourinstructortellsyoutodoso. CS70,Summer2015,Final 1 SID: Section 1: Straightforward Questions (68 points) 1. CountingandProbability(21points,3pointsforeachpart) Forthefollowingparts,justwritedownanswers. Youdonotneedtocalculatetheexactvalueof(cid:0)a(cid:1),a!,or b ab. Noexplanationisrequired. Nopartialcreditwillbegiven. (a) HowmanydifferentanagramsofDISCRETEarethere? Answer: 8!. 2 (b) Thereare2015students. Howmanydifferentwaystochoose70studentsandletthemformateam? Answer: (cid:0)2015(cid:1). 70 (c) Howmanydifferentsubsetsof{1,2,3,...,300}arethere? Answer: 2300. (d) Howmanydifferentnon-negativeintegersolutionstox +x +x +x +···+x =2015? (Notethatit 0 1 2 3 70 is0-indexed.) Answer: (cid:0)2085(cid:1)or(cid:0)2085(cid:1). 70 2015 (e) The birthdays of three students are all in March, 1997 (there are 31 days in March). Assume their birthdays are randomly and uniformly distributed. What is the probability that their birthdays are all different? Answer: 31×30×29. 31×31×31 (f) Thereare11pokercards{♠A,♠J,♠Q,♠K,♥A,♥2,♥3,♦A,♣A,♣4,♣5}. Youdrawacard anditisanAce(A);whatistheprobabilitythatthecardistheHeart(♥)suit? Answer: 1. 4 (g) ThenumberoftyposperboardismodelledbythePoissondistribution: λi Pr[X =i]= e−λ fori=0,1,2,... i! Ifthereis1typoperboardonaverage,whatistheprobabilitythatthereare2typosonaboard? Answer: 1 . 2e Pr[X =2]= 12e−1= 1 . 2! 2e 2 SID: 2. Distribution,Expectation,andVariance(9points,3pointsforeachpart) Forthefollowingparts,justwritedownanswers. Noexplanationisrequired. Nopartialcreditwillbegiven. (a) A special dice has 2 sides with “0”, 3 sides with “1”, and 1 side with “3”. Each side has the same probabilityofbeingrolled. LetrandomvariableX betheoutcomeofthedice. Whatisthedistribution ofX? Answer: Pr[X =0]= 2,Pr[X =1]= 3,Pr[X =3]= 1. 6 6 6 (b) WhatistheexpectationofX? Calculatetheexactvalue. Answer: 1. E(X)=0·2+1·3+3·1 =1. 6 6 6 (c) WhatisthevarianceofX? Calculatetheexactvalue. Answer: 1. E(X2)=02·2+12·3+32·1 =2andVar(X)=E(X2)−E(X)2=2−1=1. 6 6 6 3 SID: 3. Markov’sInequalityandChebyshev’sInequality(9points,3pointsforeachpart) Forthefollowingparts,justwritedownanswers. Noexplanationisrequired. Nopartialcreditwillbegiven. (a) GivenapositivediscreterandomvariableX withitsexpectation10,useMarkov’sinequalitytoprovide anupperboundonPr[X ≥30]? Answer: 1. 3 Pr[X ≥30]≤ 10 = 1. 30 3 (b) Following Part (a), the variance of X is 5, use Chebyshev’s inequality to provide an upper bound on Pr[|X−10|≥20]? Answer: 5 . 400 Pr[|X−10|≥20]≤ 5 = 5 . 202 400 (c) Following Parts (a) and (b), provide an upper bound (this bound should be smaller than the answer in Part(a))onPr[X ≥30]? Answer: 5 . 400 Pr[X ≥30]=Pr[X−10≥20]≤Pr[|X−10|≥20]≤ 5 . 400 4 SID: 4. StableMarriageAlgorithm(3points) Find a female optimal stable pairing for the following case. No explanation is required. No partial credit willbegiven. Men PreferenceLists Women PreferenceLists 1 C>A>B A 1>2>3 2 B>C>A B 2>1>3 3 B>A>C C 2>3>1 Answer: {(1,A),(2,B),(3,C)}. 5 SID: 5. ModularArithmeticandRSA(6points,3pointsforeachpart) Forthefollowingparts,justwritedownanswers. Noexplanationisrequired. Nopartialcreditwillbegiven. (a) Whatisthemultiplicativeinverseof6(mod7)? Answer: 6. 6·6=36=1(mod7). (b) Assume p = 3,q = 11,e = 7,d = 3 in the RSA cryptography; if the receiver receives 4, what is the originalmessage? Answer: 31. N = pq=33and4d =43=64=31(mod33). 6 SID: 6. PolynomialsandErrorCorrectionCodes(6points,3pointsforeachpart) Forthefollowingparts,justwritedownanswers. Noexplanationisrequired. Nopartialcreditwillbegiven. (a) WorkingoverGF(7),thereisapolynomialP(x)withdegreeatmost2. GivenP(0)=3,P(1)=0,and P(2)=0,whatisthevalueofP(3)? Calculatetheexactvalue. Answer: 3. (x−1)(x−2) 1 ∆ (x) = = (x2−3x+2); 0 (0−1)(0−2) 2 (cid:18) (cid:19) 1 3 P(x) = 3 (x2−3x+2) = (x2−3x+2); 2 2 3 P(3) = (32−3·3+2)=3(mod7). 2 (b) Kevinwantstosendamessageof10orderedpacketstoStuart. Nomatterhowmanypacketsaresent, there are at most 5 lost packets (erasure errors) and 2 corrupted packets (general errors). What is the minimumnumberofpacketsKevinshouldsendsothatStuartcanrecoverthemessage? Answer: 19. 10+5+2·2=19. 7 SID: 7. TRUEorFALSE—FirstRound(14points,1pointforeachpart) For any discrete random variable X,Y,Z, any real numberC, and any proposition P,Q, determine whether the following statements are true or false. Just circle the correct choice. No explanation is required. No partialcreditwillbegiven. (a) T F ThereexistsanEulerianwalkforthegraphabove. (b) T F E(X+C)=E(X)+C. (c) T F E(X+Y)=E(X)+E(Y). (d) T F Var(X+C)=Var(X). (e) T F Var(X+Y)=Var(X)+Var(Y). (f) T F Ifyouflipafaircoin2ntimes,theprobabilitythatyougetexactlynHeads increasesasnincreases. (g) T F Theset{1,2,3}iscountablyinfinite. (h) T F N,thesetofallnaturalnumbers,iscountablyinfinite. (i) T F Z,thesetofallintegers,iscountablyinfinite. (j) T F Q,thesetofallrationalnumbers,iscountablyinfinite. (k) T F Thesetofall(n,q)wheren∈Nandq∈Q,iscountablyinfinite. (l) T F R,thesetofallrealnumbers,iscountablyinfinite. (m) T F (P=⇒Q)=⇒(Q=⇒P). (n) T F ∀y∃xP=⇒∃x∀yP. Answer: T,T,T,T,F,F,F,T,T,T,T,F,F,F. 8 SID: Section 2: 8-Point Questions (16 points) 8. MultinomialDistribution(8points) Thereare3coins: • Coin1hasHeadprobability 1. 3 • Coin2hasHeadprobability 1. 2 • Coin3hasHeadprobability 3. 4 Yourepeatthefollowingrandomexperiment100times: • YouflipCoin1first. IfyougetHead,youflipCoin2;otherwise,youflipCoin3. What is the expectation of the number of Heads? Note that you flip coins 200 times in total. Calculate the exactvalue. Answer: 100. H isarandomvariablethatcountsthetotalnumberofHeads. H isthenumberofHeadsontheitrial. i 1 1 1 1 2 3 2 1 E(H)=2· · +1· · +1· · +0· · =1; i 3 2 3 2 3 4 3 4 n E(H)= ∑E(H)=100. i i=1 9 SID: 9. GeometricDistribution(8points) Cocoistryingtocollectfourcoupons,C ,C ,C ,C . Shedoesnotknowwhichcoupon(s)shewillgetbefore 1 2 3 4 paying. Therearetwostoressellingcoupons: • InStoreA,shepays3dollarstogetacoupon,andtheprobabilityofgettingeachcouponisalways 1. 4 • InStoreB,C andC arealwayspackagedtogether,andC andC arealsoalwayspackagedtogether. 1 2 3 4 She pays 8 dollars to get one package (with two coupons), and the probability of getting each pair (either(C ,C )or(C ,C ))isalways 1. 1 2 3 4 2 Whichstoreshouldshego,oritdoesnotmatter? Answer: StoreB. Let A=A +A +A +A where A is the number of tries until Coco gets the i-th new coupon. Similarly, 1 2 3 4 i B=B +B . Inthiscase,thereareonly2distinctpackages. 1 2 4 4 4 4 4 25 E(A)= ∑E(A)= + + + = ; i 4 3 2 1 3 i=1 2 2 2 E(B)= ∑E(B)= + =3. i 2 1 i=1 CocoshouldgotoStoreBbecause3·25 >8·3. 3 10

Description:
1. Counting and Probability (21 points, 3 points for each part). For the following parts, just write down answers. You do not need to calculate the exact value of ( a b. ), a!, or ab. No explanation is required. No partial credit will be given. (a) How many different anagrams of DISCRETE are there?
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.