• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/56

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

56 Cards in this Set

  • Front
  • Back

Other forms of a ≡ b (mod m)

a = b + mk


m | (a - b)

Properties of a ≡ b (mod m) which arise from congruence relation.


Properties when we consider c ≡ d (mod m) as well.

aⁿ ≡ bⁿ (mod m) for any positive integer n


a + n ≡ b + n (mod m) for any integer n


an ≡ bn (mod m) for any integer n


a + c ≡ b + d (mod m)


ac ≡ bd (mod m)

The congruence ax ≡ c (mod m) has a solution if and only if...

gcd(a,m) | c

Fermat's Little Theorem

If p is prime and gcd(a,p) = 1, then


a^(p-1) ≡ 1 (mod p)




Multiply by a: a^p ≡ a (mod p)

Modular Inverse

The solution to the congruence ax ≡ 1 (mod m).


Always (but not only) exists if gcd(a, m) = 1.

Euler's Phi (Totient) Function

Counts the number of integers from 1 to n (inclusive) that are relatively prime to n.




If gcd(a,m) = 1, then a^phi(m) ≡ 1 (mod m).


If p and q are distinct primes, then


phi(pq) = (p - 1)(q - 1)

Relatively Prime

gcd(a,b) = 1

How to set up a private and public RSA key

1) Choose 2 distinct large primes p and q


2) Find k s.t. k < phi(pq) and gcd(k, phi(pq)) = 1


3) Find d s.t. kd ≡ 1 (mod phi(pq))


4) Keep d private, make k and n = pq public.

How to send an RSA-encrypted message

1) Map the message to numbers (less than n)


2) For each number m, compute m^k ≡ r (mod n) where r < n


3) Send r

How to decrypt an RSA-encrypted message

Given encoded message r and private key d:


r^d ≡ x (mod n) where x < n

Given a proposition p implies q, we can derive what three named expressions?

The converse: q implies p. {T,T,F,T}


The inverse: NOT p implies NOT q. {T,T,F,T}


The contrapositive: NOT q implies NOT p. {T,F,T,T}

Tautology

A proposition that is always true (e.g. x OR NOT x)

Contradiction

A proposition that is always false (e.g. x AND NOT x)

Binomial Theorem

(a + b)^n = ∑ from k = 0 to n of (n choose k) a^k * b^(n - k)

The number of functions from domain X to codomain Y

|Y|^(|X|)

The number of injective functions from domain X to codomain Y

|Y|! / (|Y| - |X|)!


Only if |Y| ≥ |X|

The number of bijections from domain X to codomain Y

|Y|!


...but |X| must be equal to |Y|

Formula for (n choose k)

n!/(k! (n - k)!)

3 properties of the binomial coefficient (n choose k)

1) (n choose k) = (n choose n - k)


2) ∑ from k = 0 to n of (n choose k) = 2ⁿ


3) (n choose k) = (n - 1 choose k) + (n - 1 choose k - 1)

Meanings of (n choose k)

The number of subsets of size k of a set n, with no ordering.


The number of ways to pick k objects from n objects.

Steps of the Euclidean Algorithm to compute gcd(a,b)

Let a be the greater number and b be the lesser


1) a = __*b + r


2) Solve for b and r, shift left


3) Repeat until r = 0, then the previous r = GCD

Steps of the Extended Euclidean Algorithm

1) Complete the Euclidean Algorithm


2) Rearrange the last equation s.t. you have 1 = __*n + r₁


3) Rearrange the next equation s.t. you get n = __*__ + r₂ and then substitute back in


4) Continue until you have 1 in terms of a and b

Defintion of a Derangement

A derangement is a permutation with no fixed points

Set Operations

A ∪ B => Union => all items in A and B (all 1s)


A ∩ B => Intersection => Items in both A and B


A \ B => Set Minus => Items in A and not in B

Power Set [P(A)]

The set of all subsets of A. Size is 2^|A|. Includes {} and A.

Cartesian Product [A x B]

Set containing ordered pairs of every combination of elements from the two sets.


e.g. {(a₁, b₁), (a₁, b₂), (a₂, b₁), ... }

Properties of an equivalence relation

Reflexive: aRa for all a (every element must be related to itself)


Symmetric: aRb => bRa


Transitive: aRb and bRc => aRc (e.g. a < b and b < c then a < c)

Equivalence classes

Equivalence classes partition a set into distinct classes of related items.


The equivalence class containing a in the relation R is written as [a]_R


An example: 8 mod 3 is in the equivalence class of 2

Injective function

If a ≠ b, then f(a) ≠ f(b)


In other words, only one input → one output

Surjective Function

∀x ∈ X ∃ a ∈ A s.t. f(a) = x

where X is the codomain and A is the domain


In other words, every output → some input

Bijective Function

A function that is both injective and surjective.


If a function is bijective, then the domain and the codomain have the same size.

Permutation

The number of ways to order unique elements of a set


n!

Combination

The number of ways to pick some number of unique elements from a set, where order does not matter


n! / (k! (n-k)!)

Pigeonhole Principle

Weak: Given n buckets and n + 1 things, there must exist a bucket with at least 2 things in it


Strong: Given Kn + 1 items and n buckets, there must exist a bucket with at least K + 1 things in it

Stars and Bars

Ways to partition n indistinguishable objects into k categories


If every category must have at least one member: (n - 1) Choose (k - 1)


If empty categories are allowed: (n + (k - 1)) Choose (k - 1)

Big O

Upper bound on a function's growth

Big θ

Tight bound on a function's growth (f(x) * C₁ is greater than the function, f(x) * C₂ is less than the function)

Big Omega:

Lower bound on a function's growth

Probability of an event

|E| / |S| (where E is the number of event(s) we want to occur and S is the total of possible events)

Bayes' Law

Standard: P(A|B) = (P(A) * P(B|A))/P(B)


Extended: P(A|B) = P(A) * P(B|A)


P(A) * P(B|A) + P(NOT(A)) * P(B|NOT(A))


...but ONLY if A and B are independent!!

P(A and B)

P(A) * P(B) if A and B are independent


P(A) * P(B|A) otherwise

Expectation of a random variable

The expectation of a random variable X is the value X will take on average


E[X] = ∑X * P(X = x) for all x in A

Variance of a random variable

The variance of a random variable X tells on average how far away the actual value of X will be from the expected value of X, E[X]


V(X) = E[X²] - E[X]²

Linearity of Expectation

E[A + B] = E[A] + E[B]


**This works even when A and B are dependent!

Linearity of Variance

V(A + B) = E[(A + B)²] + E[A + B]² if dependent


V(A + B) = V(A) + V(B) if independent

Binomial distribution

A probability which can be modeled by a 0/1 string (e.g. a series of coin flips). Each event (coin flip) must be INDEPENDENT from the last.


If P if the probability of a success in a binomial distribution, 1 - P is the probability of a failure

Expectation and Variance for Binomial Distributions

E[X] = np (where n is the number of trials and p is the probability of success)


V(X) = np(1 - p)

Markov's Inequality

P(X ≥ a) ≤ E[X] / a

Chebyshev's Inequality

P(|X - E[X]| ≥ a) ≤ V(X) / a²

Total degree of a graph

2|E| (2 times the number of edges)

Degree of a vertex

The number of edges that connect to that vertex

Properties of a Tree

v - 1 edges, fully connected (no loose nodes or portions of the graph which do not connect to other portions), acyclic

Planar Graphs

Graphs that can be drawn on a plane without any lines crossing each other.


|E| ≤ 3|V| - 6

Eulerian Cycle

A path through a graph which visits every edge only once and returns to its starting point

Hamiltonian Cycle

A path through a graph which visits every vertex only once and returns to its starting point

Complete Graph

A graph which has an edge between every single point on it