[Note: this webpage last modified Tuesday, 26-Apr-2011 15:53:06 EDT]
This page collects sample quiz questions, or questions from past quizzes.
(2 Points)
(a) What is the probability of tossing 10 coins and getting 0 heads?
(b) What is the probability of tossing 10 coins and getting exactly 1 heads?
(a) Suppose you flip n coins. What is the expected number of times that you will see two coins in a row that are either both heads or both tails?
(b) Use Markov's inequality to give a bound on the probability that more than 3*(n-1)/4 times you will see either two heads in a row or two tails in a row.
(a) Let A be a randomized algorithm that solves a BPP problem and that runs in time n2. Give a randomized algorithm A' that solves the same problem and has a probability of error less than 1/2n.
(b) Prove your algorithm has at most this probability of error.
(c) What is the running time of A'?
What is the probability of tossing 10 coins and getting exactly 1 heads?
What is the expected number of coins that come up heads when tossing 10 coins?
What is the expected number of 0's in a sequence of 10 random bits?
You look at n random bits. What is the expected number of 1's? Use Markov's inequality to give a bound on the probability that the number of 1's is greater than (n/2 + n/10). Use the Chernoff bound to give a bound on the same probability.
Which of the following are (known to be) contained in each other? L, P, BPP, NP, PSPACE, EXP.
Let A be a randomized algorithm that solves a BPP problem. Give a deterministic algorithm to solve the problem. What is the running time of your algorithm?
Let A be a randomized algorithm that solves a ZPP problem. Give a randomized algorithm A' that solves the same problem and has a probability of error less than 1/2n, and prove your algorithm has at most this probability of error.
Give a randomized algorithm to test whether a given polynomial is identically zero. You do not need to prove the algorithm is correct, just give the steps of the algorithm, and explain the running time.
Suppose you flip n coins. What is the expected number of times that you will see two coins in a row that are either both heads or both tails? The highest this could possibly be is n-1. What is the expected number of times you will see k heads or k tails in a row? The highest this could possibly be is n-(k-1).
Consider the following algorithm for determining if a Boolean formula is satisfiable.
Input: formula phi Repeat k times: Choose an assignment a to phi at random. If phi(a) is true, return true If phi(a) was false for all randomly chosen assignments, return false
True or false - this algorithm shows that SAT is in BPP. Explain.
Consider this algorithm.
Isolated-vertex Input: adjacency matrix A for a graph G Output: true if the graph contains an isolated vertex (vertex with no neighbors/edges). Algorithm: for i=1 up to n { hasNeighbor=false for j=1 up to n { if (A[i,j]) { hasNeighbor=true } if (hasNeighbor == false) { return true} } return false
Question: What is the running time and memory space usage for this algorithm? For the memory space, only count the amount of "working memory space" - do not count the amount of memory that A takes.
Question: Which complexity classes does the Isolated-vertex problem belong to due to this algorithm? Circle all that it is in.
L, NL, P, NP, PH, PSPACE, EXP.
Let L be a language that can be solved in PSPACE, and let M be a Turing machine that decides L while using at most n^c memory space, for some constant c. Explain how we can decide L in EXP. (This shows that PSPACE is contained in EXP).