Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Math for CS CMPSC 360 LECTURE 44 Last time:

Similar presentations


Presentation on theme: "Discrete Math for CS CMPSC 360 LECTURE 44 Last time:"β€” Presentation transcript:

1 Discrete Math for CS CMPSC 360 LECTURE 44 Last time:
Countable/uncountable sets Diagonalization argument Existence of problems that can’t be solved by computers. The Halting problem. Today: Review. Some topics of the exam problems. Wrap up. CMPSC 360 11/29/2018

2 Clicker question (frequency BC)
Let X be the number of heads in 𝑛 independent coin tosses of a fair coin. What are the expectation and the variance of X? 0.5𝑛 and 0.25𝑛, respectively. (A) has correct expectation, but wrong variance. (A) has wrong expectation, but correct variance. Both expectation and variance are wrong in (A). 11/29/2018

3 Clicker question (frequency BC)
The Triangle Fraternity is organizing a party. They invited 𝑛 guests (𝑛β‰₯2). To keep track of which guests know which other guests, they've drawn a directed graph 𝐺 with 𝑛 nodes (one per guest), with an edge from guest π‘₯ to guest 𝑦 whenever π‘₯ knows 𝑦. A guest π‘₯ is a celebrity if every other guest knows π‘₯, but π‘₯ does not know any other guest. For this picture: A is a celebrity. B is a celebrity. C is a celebrity. D is a celebrity. There are no celebrities. A B C D 11/29/2018

4 Clicker question (frequency BC)
The Triangle Fraternity is organizing a party. They invited 𝑛 guests (𝑛β‰₯2). To keep track of which guests know which other guests, they've drawn a directed graph 𝐺 with 𝑛 nodes (one per guest), with an edge from guest π‘₯ to guest 𝑦 whenever π‘₯ knows 𝑦. A guest π‘₯ is a celebrity if every other guest knows π‘₯, but π‘₯ does not know any other guest. For this picture: A is a celebrity. B is a celebrity. C is a celebrity. D is a celebrity. There are no celebrities. A B C D 11/29/2018

5 Clicker question (frequency BC)
A guest π‘₯ is a celebrity if every other guest knows π‘₯, but π‘₯ does not know any other guest. If a party has a celebrity, can it have a Eulerian cycle (the one that visits every edge exactly once)? Can it have a Hamiltonian cycle (the one that visits each node exactly once)? It can have both. Eulerian, but not Hamiltonian. Hamiltonian, but not Eulerian. It can have neither. A B C D 11/29/2018

6 Clicker question (frequency BC)
A guest π‘₯ is a celebrity if every other guest knows π‘₯, but π‘₯ does not know any other guest. How many celebrities can a party have? 0 or 1. 0 or 1 or 2. 0 or 1 or 2 or 3. Any integer from 0 to 𝑛. None of the above. 11/29/2018

7 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Examples: The probability that π‘₯ knows 𝑦 and 𝑦 also knows π‘₯ is 𝑝 2 . The probability that 𝑀 knows π‘₯ and 𝑦 but doesn’t know 𝑧 is 𝑝 2 1βˆ’π‘ . 11/29/2018

8 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. What is the probability space? Uniform over all directed graphs on 𝑛 nodes. Uniform over all undirected graphs on 𝑛 nodes. A pair knows each other with probability 𝑝 and does not know each other with probability 1βˆ’π‘. 1/ 𝑛 2 The set of all directed graphs, where each graph with π‘˜ edges for π‘˜=0,1,…,𝑛(π‘›βˆ’1) has probability 𝑝 π‘˜ 1βˆ’π‘ 𝑛 π‘›βˆ’1 βˆ’π‘˜ . 11/29/2018

9 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. What is the probability that all guests know each other? 𝑝 𝑛 𝑝 𝑛(π‘›βˆ’1) 𝑝 𝑛 2 1/ 𝑛 2 𝑝 𝑛(π‘›βˆ’1)/2 . 11/29/2018

10 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let X be the number of pairs of guests that know each other. What is the value of X for the depicted outcome? 1 2 𝑝 2 None of the above. A B C D 11/29/2018

11 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let X be the number of pairs of guests that know each other. What is the expectation of X? 𝑝𝑛. 𝑝 2 𝑛. 𝑝 2 𝑛(π‘›βˆ’1)/2. 𝑝 2 𝑛 π‘›βˆ’1 . None of the above. 11/29/2018

12 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let X be the number of pairs of guests that know each other. What is the variance of X? 𝑝 2 𝑛 2 βˆ’π‘ 4 𝑛 2 2 𝑝 2 𝑛. 𝑝 2 𝑛 2 𝑝 2 (1βˆ’ 𝑝 2 ) 𝑛 2 None of the above. 11/29/2018

13 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let’s pick a particular guest 𝑣. What is the probability that 𝑣 is a celebrity? 𝑝 𝑛 (1βˆ’π‘) 𝑛 𝑝 π‘›βˆ’1 𝑝 𝑛 𝑝 π‘›βˆ’1 (1βˆ’π‘) π‘›βˆ’1 None of the above. 11/29/2018

14 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let π‘ž be the probability that 𝑣 is a celebrity (from the previous slide). What is the expected number of celebrities? 𝑝𝑛. π‘žπ‘›. 𝑝 𝑛 2 . π‘ž 𝑛 2 . None of the above. 11/29/2018

15 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let π‘ž be the probability that 𝑣 is a celebrity (from the previous slide). Let’s pick another guest 𝑒. What is the probability that 𝑒 knows 𝑣, given that 𝑒 is not a celebrity? 1βˆ’π‘. 𝑝/π‘ž. 𝑝/(1βˆ’π‘ž). π‘ž/(1βˆ’π‘). None of the above. 11/29/2018

16 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let π‘ž be the probability that 𝑣 is a celebrity (from the previous slide). What is the probability that one of 𝑒 and 𝑣 is a celebrity? π‘ž. 2π‘ž. π‘žβˆ’ π‘ž 2 . 2π‘žβˆ’ π‘ž 2 . None of the above. Hint: They can’t be celebrities together. 11/29/2018

17 Clicker question (frequency BC)
Suppose G is generated randomly as follows. π‘₯ knows 𝑦 with probability 𝑝 for every two guests π‘₯ and 𝑦. All such events are independent. Let π‘ž be the probability that 𝑣 is a celebrity (from the previous slide). What is the probability that there are no celebrities? 1βˆ’π‘›π‘ž. 1βˆ’π‘ž 𝑛 . 1βˆ’ π‘ž 𝑛 . π‘ž 𝑛 . None of the above. Hint: They can’t be celebrities together. 11/29/2018

18 Wrap Up Some of the topics we covered:
logic, proofs, modular arithmetic, polynomials, graphs, counting, probability, countability, computability. Applications we covered: RSA, error-correcting codes, secret sharing, hashing, load balancing, limits of computation. Skills we worked on: rigorous thinking about computer science problems; problem solving. 11/29/2018

19 What is next? CMPSC 465: Data Structures and Algorithms
CMPSC 464: Theory of Computation More advanced classes: cryptography, randomized algorithms, sublinear algorithms, privacy, machine learning, quantum computing, programming languages,… Keep in touch! 11/29/2018


Download ppt "Discrete Math for CS CMPSC 360 LECTURE 44 Last time:"

Similar presentations


Ads by Google