Probability
- Random Variable: A variable that takes on (discrete) values with certain probabilities
- Probability Distribution for a Random Variable: The probabilities with which the variable takes on each possible value.
- Each probability must be
- Sum of probabilities should be equal to
- Event: A particular occurence in some experiment.
- Conditional Probability: Probability that one event occurs, assuming some other event occured. For example, probability that A occurs assuming B occured:
- Independent Random Variables: Two random variables are independent if
- Law of Total Probability: Say are a partition of all possibilities (no pair can occur at the same time). Then for any other event :
- Bayes Theorem: A cool trick to change the orders in conditional probability.
Discrete Probability
-
Everything here is defined over a universe , such as . The universe must be a finite set. As an example: . Also note that .
-
A probability distribution over is a function such that .
- A uniform distribution is when .
- A point distribution is when .
-
An event is a set and:
-
A union bound of and is:
-
If and are disjoint sets, then .
-
A random variable is a function where is the universe and is the value set.
EXAMPLE: Let where and returns the least significant bit of its argument.
- Let be some set such as . We write to denote a uniform random variable over , in other words: .
A deterministic algorithm is one where , but a randomized algorithm is as where . The output is a random variable which defines a distribution over all possible outputs of given . For example, is a randomized encryption!
- Two events and are independent events if .
- Two random variables taking values over are independent random variables if .
XOR Operation
XOR is a very important function that will keep appearing throughout cryptography. It is a logical operation :
a | b | a b |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Theorem: For a r.v. over and an independent uniform random r.v. over , is a uniform random variable over . This is a very important theorem!
Birthday Paradox
This is a quite surprising probabilistic result, and it will come handy in some proofs.
Theorem: Let be independent identically distributed random variables. The theorem states that when , then:
Proof: We will first negate this probability:
Let , we see that:
We will use the inequality to obtain:
We can further obtain another inequality as:
When we plug in here we get . Surely, , QED!
Entropy
In the context of discrete probability, entropy can be thought of as a measure of randomness. Suppose you have a r.v. with outcomes with probabilities .
-
Entropy is defined as:
-
Min-entropy is when for any outcome .
-
Mutual Information measures how one random variable tells us about another. Suppose you have r.v. and . Denote as the probability mass function of and , and and as the marginal probability mass functions of and respectively. The mutual information of and is then defined as:
Asymptotics
There are some special properties of functions that relate how much they grow with respect to one another.
- Negligible functions are literally negligible; too small that you should not worry much about them (especially if the functions represents the probability of failure). Formally, a positive function is negligible if for any positive polynomial there exists a constant such that we have .
- Noticeable functions are kind of like the opposite of negligible ones. A positive function is noticeable if there exists a positive polynomial and a number such that for all .
- Non-negligible functions are functions that are not negligible. This does not necessarily mean they are noticable!
- Overwhelming functions are such that if is overwhelming, then is negligible.
Note that space complexity should be upper bounded by Time complexity. You can't be using more complex space than time, because you should also spend time accessing/modifying whatever data you store.
An equivalent definition of negligible functions is given by the Big-O notation: a positive function is negligible if and only if for all positive polynomials . The following functions are negligible:
A polynomial times polynomial functions is a polynomial; however, a polynomial times negligible is a negligible function.
Negligible vs Noticable
- A positive function is negligible if and only if for any positive polynomial such that converges to 0.
- A positive function is noticable if and only if there exists a positive polynomial such that goes to .
Note that for negligible we use "for any", but for noticable we use "there exists".