CS-113 Discrete Structures
- p ∨ q: p or q
- p ∧ q: p and q
- ¬ p, − p, p bar: not p
- p → q: if p, then q
- p ↔ q: p if and only if q
- P ≡ Q: P and Q are logically equivalent
- ∀: for all
- ∃: there exists
- ∴: therefore
- {x1, ... , xn}: set consisting of the elements x1, ... , xn
- {x | p(x)}: set consisting of those elements x satisfying property p(x)
- x ∈ X: x is an element of X
- x ∉ X: x is not an element of X
- X = Y: set equality (X and Y have the same elements)
- |X|: number of elements in X
- ∅: empty set
- X ⊆ Y: X is a subset of Y
- P(X): power set of X (all subsets of X)
- X ⋃ Y: X union Y (all elements in X or Y)
- i = 1 ⋃ n Xi: union of X1, ... , Xn (All elements that belong to at least one of X1, X2, ... , Xn)
- i = ∞ ⋃ n Xi: union of X1, X2, ... , (All elements that belong to at least one of X1, X2, ...)
- ⋃ S: union of S (all elements that belong to at least one set in S)
- X ∩ Y: X intersect Y (all elements in X and Y)
- i = 1 ∩ n Xi: intersection of X1, ... , Xn (All elements that belong to every one of X1, X2, ... , Xn)
- i = ∞ ∩ n Xi: intersection of X1, X2, ... , (All elements that belong to every one of X1, X2, ...)
- ∩ S: intersection of S (all elements that belong to at every set in S)
- X − Y: set difference (all elements in X but not in Y)
- X̄: complement of X (all elements not in X)
- (x, y): ordered pair
- (x1, ... , xn): n-tuple
- X × Y: Cartesian product of X and Y [pairs (x, y) with x in X and y in Y]
- xRy: (x, y) is in R (x is related to y by the relation R)
- [x]: equivalence class containing x
- R−1: inverse relation (all (y, x) with (x, y) in R)
- R2 ∘ R1: composition of relations
- x ≼ y: xRy
- f(x): value assigned to x
- f: X → Y: function from X to Y
- f ∘ g: composition of f and g
- f−1: inverse function (all (y, x) with (x, y) in f)
- f(n) = Ο(g(n)): |f(n)| ≤ C|g(n)| for n sufficiently large
- f(n) = Ω(g(n)): c|g(n)| ≤ |f(n)| for n sufficiently large
- f(n) = Θ(g(n)): c|g(n)| ≤ |f(n)| ≤ C|g(n)| for n sufficiently large
- C(n, r): number of r-combinations of an n-element set (n!/[(n − r)!r!])
- P(n, r): number of r-permutations of an n-element set (n(n − 1) ... (n − r + 1))
- G = (V, E): graph G with vertex set V and edge set E
- (v, w): edge
- δ(v): degree of vertex v
- (v1, ... , vn): path from v1 to vn
- (v1, ... , vn): v1 = vn: cycle
- Kn: complete graph on n vertices
- Km, n: complete bipartite graph on m and n vertices
- w(i, j): weight of edge (i, j)
- Fij: flow in edge (i, j)
- Cij: capacity of edge (i, j)
- (P, P̄): cut in a network
- P(x): probability of outcome x
- P(E): probability of event E
- P(E|F): conditional probability of E given F[P(E ∩ F)/P(F)]
- x ∨ y: x or y (1 if x or y is 1, 0 otherwise)
- x ∧ y: x and y (1 if x and y are 1, 0 otherwise)
- x ⊕ y: exclusive-OR of x and y (0 if x = y, 1 otherwise)
- x̄: not x (0 if x is 1, 1 if x is 0)
- x ↓ y: x NOR y (0 if x or y are 1, 1 otherwise)
- x ↑ y: x NAND y (0 if x and y are 1, 1 otherwise)
- Circuits:
- More Information: ExtendedCircuits.png, Circuits.md, Circuit Symbols from Electronics Club
- λ: null string
- |s|: length of the string s
- st: concatenation of strings s and t (s followed by t)
- an: aa ... a (n a's)
- X*: set of all strings over X
- X+: set of all nonnul strings over X
- α → β: production in a grammar
- α ⇒ β: β is derivable from α
- α1 ⇒ α2 ⇒ ... ⇒ αn: derivation of αn from α1
- L(G): language generated by the grammar G
- S ::= T: Backus normal form (BNF)
- S ::= T1 | T2: S ::= T1, S ::= T2
- Ac(A): set off strings accepted by A
- (aij): matrix with entries aij
- A = B: matrices A and B are equal (A and B are the same size and their corresponding entries are equal)
- A + B: matrix sum
- cA: scalar product
- − A: (−1)A
- A − B: A + (− B)
- AB: matrix product
- An: matrix product AA ... A (n A's)
- lg x: logarithm to the base 2 of x
- ln x: natural logarithm of x (logarithm to the base e of x)
- m mod n: remainder when m is divided by n
- ⌊x⌋: floor of x (greatest integer less than or equal to x)
- ⌈x⌉: ceiling of x (smallest integer greater than or equal to x)
- b | a: b divides a
- b ∤ a: b does not divide a
- gcd(a, b): greatest common divisor of a and b
- n!: n factorial (n(n − 1) ... 2 ⋅ 1)
- fn: n th Fibonacci number
- Cn: n th Catalan number
- i = m Σ n ai: am + am+1 + ... + an
- i ∈ X Σ ai: the sum of the elements in the set {ai | i ∈ X}
- i = m ∏ n ai: am ⋅ am+1 ⋅ ... ⋅ an
- i ∈ X ∏ ai: the product of the elements in the set {ai | i ∈ X}
x := y
- assign the value
y
tox
- assign the value
begin end
- mark the beginning and end of a block of statements
-
if p then action
- if
p
is true, executeaction
- if
-
if p then action 1 else action 2
- if
p
is true, executeaction1
; ifp
is false, executeaction2
- if
//
- a comment starts with
//
and continues to the end of the line
- a comment starts with
return
- suspend execution and return to invoker
return(x)
- suspend execution and return the value
x
to invoker
- suspend execution and return the value
-
while p do action
- if
p
is true, executeaction
and repeat this process
- if
-
for var := init to limit do action
- execute
action
for values ofvar
frominit
tolimit
- execute
call proc(p1, ... , pk)
- invoke procedure
proc
with argumentsp1, ... , pk
- invoke procedure