ITSC 2175 Final
If an element is introduced for the first time in the proof, the definition is labeled ___
"Element definition" > must specify whether the element is arbitrary or particular.
(p → q) If it is raining today, the game will be cancelled. Converse:
( q → p ) > If the game is cancelled, it is raining today
(p → q) If it is raining today, the game will be cancelled. Inverse:
( ¬p → ¬q ) > If it is not raining today, the game will not be cancelled.
important (n log n) fact i guess idk it was on the quiz lol
(n log n) is O(2^n)
permutation with repetition
(n!) / (n1! * n2! * n3!) Ex. PEPPER 6!/(3! * 2! * 1!) = 60 Because P repeats 3 times, E repeats twice and R appears once
Cartesian product
> denoted A x B > the set of all ordered pairs in which the first entry is in A and the second entry is in B > A x B = { (a, b) : a ∈ A and b ∈ B }
power set
> denoted P(A) > the set of all subsets of A > always contains an empty set
Boolean multiplication
> denoted by • > applies to two elements from {0, 1} and obeys the standard rules for multiplication > The results of the multiplication operation are the same as the logical ∧ ("and") operation.
complement
> denoted with a bar symbol, reverses that element's value. > Complementing a Boolean value is analogous to applying the ¬ ("not") operation in logic.
In p → q, the proposition p is called the ___, and the proposition q is called the ___
> hypothesis > conclusion
In the words of logic, the only way for a conditional statement to be false is if ___
> the hypothesis is true and the conclusion is false > If the hypothesis is false, then the conditional statement is true regardless of the truth value of the conclusion.
cardinality
> the number of elements in A > denoted by |A|
conjunctive normal form
A Boolean expression that is a product of sums of literals > Complement only applied to single variables. > No multiplication within a clause.
disjunctive normal form
A Boolean expression that is a sum of products of literals > Complement only applied to a single variable. > No addition within a term.
constant function
A function that does not depend on n at all > f(n) = 17 is an example of a constant function.
equivalence relation
A relation R is an equivalence relation if R is reflexive, symmetric, and transitive > the notation a~b is used to express aRb
finite sequence
A sequence with a finite domain > initial index m and a final index n
element
A value that can be plugged in for variable x
vertex
A vertex is typically pictured as a dot or a circle labeled with the name of the vertex
The Cartesian product of a set A with itself can be denoted as ___
A × A or A^2
recursive calls
An algorithm's calls to itself
literal
Boolean variable or the complement of a Boolean variable (for example, x or x).
iteration
Each repetition of the block of instructions inside the for-loop
The following argument is valid. p ∨ q p ----------- ∴ q (T/F)?
False
∃x∀y (x × y = 1) is the same as ∀x∃y (x × y = 1) (T/F)?
False
C(n, r) =
P(n, r)/r!
computational complexity
The amount of resources used by an algorithm
asymptotic growth
The asymptotic growth of the function f is a measure of how fast the output f(n) grows as the input n grows
asymptotic notation
The classification of functions using Oh, Ω, and Θ notation
composition
The composition of relations R and S on set A is another relation on A, denoted S ο R. > The pair (a, c) ∈ S ο R if and only if there is a b ∈ A such that (a, b) ∈ R and (b, c) ∈ S.
term
The expression g_k
The Fundamental Theorem of Arithmetic
The fact that every integer greater than one has a unique prime factorization
entry
The first entry of the ordered pair (x, y) is x and the second entry is y
composition
The process of applying a function to the result of another function
alphabet
The set of characters used in a set of strings
attribute
The type of data stored in each entry of the n-tuple
equivalent
Two Boolean expressions are equivalent if they have the same value for every possible combination of values assigned to the variables contained in the expressions
relatively prime
Two numbers are said to be relatively prime if their greatest common divisor is 1
disjoint
Two sets, A and B, are said to be disjoint if their intersection is empty (A ∩ B = ∅).
Boolean variables
Variables that can have a value of 1 or 0
lower bound
When proving a lower bound for the worst-case complexity of an algorithm (using Ω notation), the lower bound need only apply for at least one possible input of size n.
upper bound
When proving an upper bound on the worst-case complexity of an algorithm (using Oh-notation), the upper bound must apply for every input of size n.
binary relation
a binary relation between two sets A and B is a subset R of A x B > relation C is: xCy if |x - y| ≤ 1
bit
a character in a binary string
cycle
a circuit of length at least 1 in which no vertex occurs more than once, except the first and last vertices which are the same
circuit
a closed walk in which no edge occurs more than once
partition
a collection of non-empty subsets of A such that each element of A is in exactly one of the subsets For all i, Ai ⊆ A For all i, Ai ≠ ∅ A1, A2, ...,An are pairwise disjoint. A = A1 ∪ A2 ∪ ... ∪ An
set
a collection of objects
range
a set of elements that are the results of a function
Boolean algebra
a set of rules and operations for working with variables whose values are either 0 or 1
sequence
a special type of function in which the domain is a consecutive set of integers
proof
consists of a series of steps, each of which follows logically from assumptions, or from previously proven statements, whose final step should result in the statement of the theorem being proven
compound proposition
created by the conjunction of individual propositions with logical operations
inductive step
establishes that if the theorem is true for k, then the theorem also holds for k + 1
anti-reflexive
for every x ∈ A, it is not true that xRx
floor function
maps a real number to the nearest integer in the downward direction
If two propositions are logically equivalent, then one can be ___
substituted for the other within a more complex proposition.
Recursion
the process of computing the value of a function using the result of the function on smaller input values
Z
the set of all integers.
R- and Z- are:
the set of all negative values in their respective sets
R
the set of real numbers
greatest common divisor (gcd)
the smallest positive integer that is an integer multiple of both x and y (smallest exponent) > don't forget that x^0 is implied for every possible value that only exists in one of the prime factorizations of the numbers in the gcd(x,y)
Logic
the study of formal reasoning
linear combination
the sum of multiples of those numbers
time complexity
the time the algorithm requires to run
index
the variable k > always an integer
discrete time dynamical system
time is divided into discrete time intervals and the state of the system stays fixed within each time interval > The state during one time interval is a function of the state in previous time intervals. Thus, the history of the system is defined by a sequence of states, indexed by the non-negative integers.
conjuction
using a logical operator such as 'and' to create a compound proposition from individual propositions > only true when both propositions are true > denoted with ^
incomparable
when x ⪯ y or y ⪯ x is false
Existential instantiation
∃x P(x) ----------- ∴ (c is a particular element) ∧ P(c)
(p → q) If it is raining today, the game will be cancelled. Contrapositive:
( ¬q → ¬p ) > If the game is not cancelled, then it is not raining today.
Boolean addition
> denoted by + > applies to two elements from {0, 1} and obeys the standard rules for addition, except for 1 + 1. > An outcome of 2 would not be allowed because all values in Boolean algebra must be 0 or 1 > The results of the addition operation are the same as the logical ∨ ("or") operation.
conditional operation
> denoted with the symbol →. > The proposition p → q is read "if p then q". >The proposition p → q is false if p is true and q is false, otherwise, p → q is true.
x div y
> if both numbers are positive or both are negative: divide x by y and the integer is the div > if one number is negative: find abs(x) + abs(y) and then divide the result by y, the -(integer) is the div
The empty set ∅ is ___ as { ∅ }
> not the same > The cardinality of { ∅ } is one since it contains exactly one element, which is the empty set
A statement with no free variables is a ___ because ___
> proposition > the statement's truth value can be determined
A function f: X → Y has an inverse if and only if:
> reversing each pair in f results in a well-defined function from Y to X > if f is a bijection.
mutually disjoint
A collection of sets is mutually disjoint if the intersection of every pair of sets in the collection is empty.
arithmetic sequence
a sequence of real numbers where each term after the initial term is found by taking the previous term and adding a fixed number called the common difference
geometric sequence
a sequence of real numbers where each term after the initial term is found by taking the previous term and multiplying by a fixed number called the common ratio
logical proof
a sequence of steps, each of which consists of a proposition and a justification. If the proposition in a step is a hypothesis, the justification is "Hypothesis". Otherwise, the proposition must follow from previous steps by applying one law of logic or rule of inference > The justification indicates which rule or law is used and the previous steps to which it is applied.
permutation
a sequence that contains each element of a finite set exactly once
set builder notation
a set is defined by specifying that the set includes all elements in a larger set that also satisfy certain conditions. Ex. A = { x ∈ S : P(x) }
theorem
a statement that can be proven to be true
principle of inclusion-exclusion
a technique for determining the cardinality of the union of sets that uses the cardinality of each individual set as well as the cardinality of their intersections Let A, B and C be three finite sets, then: |A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |B ∩ C| - |A ∩ C| + |A ∩ B ∩ C|
path
a trail in which no vertex occurs more than once
Hasse diagram
a tree where comparable elements are linked, with elements that are larger than and also linked with an element being in the level above it in the diagram
truth value
a value indicating whether the proposition is actually true or false
closed walk
a walk in which the first and last vertices are the same
identity function
always maps a set onto itself and maps every element onto itself The identity function on A, denoted IA: A → A, is defined as IA(a) = a, for all a ∈ A.
trail
an open walk in which no edge occurs more than once
ordered n-tuple
an ordered list of n items
P(n, r)
application of the generalized product rule, where: n = the choices for the first item p = number of items in the option Ex. P(8,5) = 8*7*6*5*4
x mod y
find the div for the mod, then multiply the div by y and subtract from x if x is positive, and add to x if x is negative
partition
for an equivalence function, a set of sets that have no common elements, and each set is comprised of elements that are comparable in the function
increasing
for every two consecutive indices, k and k + 1, in the domain, a_k < a_(k+1)
decreasing
for every two consecutive indices, k and k + 1, in the domain, a_k > a_(k+1)
non-decreasing
for every two consecutive indices, k and k + 1, in the domain, a_k ≤ a_k+1
non-increasing
for every two consecutive indices, k and k + 1, in the domain, a_k ≥ a_(k+1)
reflexive
for every x ∈ A, xRx
edges
line segments in a tree
particular element
may have properties that are not shared by all the elements of the domain
projection
takes a subset of the attributes and deletes all the other attributes in each of the n-tuples and removes duplicates
if-statement
tests a condition, and executes one or more instructions if the condition evaluates to true If ( condition ) Step 1 Step 2 . . . Step n End-if
domain
the X in (f: X → Y)
arrow diagram
the elements of A are listed on the left, the elements of B are listed on the right, and there is an arrow from a ∈ A to b ∈ B if aRb
arrow diagram
the elements of the domain X are listed on the left and the elements of the target Y are listed on the right. There is an arrow from x ∈ X to y ∈ Y if and only if (x, y) ∈ f
root
the first vertex in the tree that has no predecessors
direct proof
the hypothesis p is assumed to be true and the conclusion c is proven as a direct result of the assumption
If a function f from A to B has an inverse, then f composed with its inverse is ___
the identity function. If f(a) = b, then f-1(b) = a, and (f^-1 ο f)(a) = f^-1(f(a)) = f-1(b) = a
integer division
the input and output values must always be integers
in-degree of a vertex
the number of edges pointing into it
out-degree of a vertex
the number of edges pointing out of it
The use of parentheses ( ) for an ordered pair indicates ___
the order of entries is significant
The use of parentheses { } for an ordered pair indicates ___
the order of entries isn't significant
complement
the set of all elements in U that are not elements of A > denoted Ā
union
the set of all elements that are elements of A or B > denoted A ∪ B
symmetric difference
the set of elements that are a member of exactly one of A and B, but not both > denoted A ⊕ B
difference
the set of elements that are in A but not in B > denoted A - B
for a collection of mutually disjoint sets, the cardinality of the union of the sets is just equal to
the sum of the cardinality of each of the individual sets: |A1 ∪ A2 ∪ ... ∪ An| = |A1| + |A2| + ... + |An|
empty string
the unique string whose length is 0 and is usually denoted by the symbol λ
disjunction
using a logical operator such as 'or' (inclusive) to create a compound proposition from individual propositions > true when either proposition is true > denoted with v
well-defined
when f maps each of the elements of the domain to at least one element and each element is only mapped to one element
assignment
where a variable is given a value x := y
cardinality is denoted by ___
|A|
nested quantifiers
A logical expression with more than one quantifier that bind different variables in the same predicate Ex. (∀x ∃y Q(x, y))
quantified statement
A logical statement that includes a universal or existential quantifier > The quantifiers ∀ and ∃ are applied before the logical operations (∧, ∨, →, and ↔) used for propositions
predicate
A logical statement whose truth value is a function of one or more variables > P(5) is a proposition, but P(x) is a predicate
query
A query to a database is a request for a particular set of data
partial order
A relation R on a set A is a partial order if it is reflexive, transitive, and anti-symmetric > the notation a ⪯ b is used to express aRb
recurrence relation
A rule that defines a term a_n as a function of previous terms in the sequence
string
A sequence of characters
infinite sequence
A sequence with an infinite domain
self-loop
An element that is related to itself is indicated by an arrow called a self-loop >A self-loop leaves the element and then turns around to point to itself again > If the head and the tail of an edge are the same vertex
Common functions in algorithmic complexity
>>Least<< Θ(1) = Constant Θ(log log n) = Log log Θ(log n) = Logarithmic Θ(n) = Linear Θ(n log n) = n log n Θ(n2) = Quadratic Θ(n3) = Cubic Θ(cn) where c > 1 = Exponential Θ(n!) = Factorial >>Most<<
conditional proposition
A compound proposition that uses a conditional operation > "If there is a traffic jam today, then I will be late for work."
function
A function f that maps elements of a set X to elements of a set Y, is a subset of X × Y such that for every x ∈ X, there is exactly one y ∈ Y for which (x, y) ∈ f.
equivalence class
If A is the domain of an equivalence relation and a ∈ A, then [a] is defined to be the set of all x ∈ A such that a~x. The set [a] is called an equivalence class
proper subset
If A ⊆ B and there is an element of B that is not an element of A (i.e., A ≠ B), then A is a proper subset of B > denoted as A ⊂ B
subset
If every element in A is also an element of B, then A is a subset of B > denoted as A ⊆ B
concatenation
If s and t are two strings, then the concatenation of s and t (denoted st) is a longer string obtained by putting s and t together
clause
In conjunctive normal form, each term in the product that is a sum of literals
constant factors
In the expressions 7n^3 and 5n^2, the 7 and the 5 are called constant factors because the values of 7 and 5 do not depend on the variable n
inductive hypothesis
In the statement "S(k) implies S(k+1)" of the inductive step, the supposition that S(k) is true is called the inductive hypothesis
proposition
a statement that is either true or false
algorithm
a step-by-step method for solving a problem
binary string
a string whose alphabet is {0, 1}
form of an argument
is expressed in English and is obtained by replacing each individual proposition with a variable
an argument is denoted as
p1 p2 .... pn ----- ∴ c > p1 ... pn are the hypotheses > c is the conclusion > The symbol ∴ reads "therefore"
gates
receives some number of Boolean input values and produces an output based on the values of the inputs > a gate implements a simple Boolean function
if-else-statement
tests a condition, executes one or more instructions if the condition evaluates to true, and executes a different set of instructions if the condition evaluates to false If ( condition ) One or more steps Else One or more steps End-if
target
the Y in (f: X → Y)
space complexity
the amount of memory used
An argument is valid if ___ otherwise the argument is invalid
the conclusion is true whenever the hypotheses are all true
least common multiple (lcm)
the largest positive integer that is a factor of both x and y (highest exponent)
combinatorial circuit
the output of the circuit depends only on the present combination of input values and not on the state of a circuit > can not store information over time > used to store a single bit of information
onto (surjective)
the range of f is equal to the target Y
asymptotic time complexity
the rate of asymptotic growth of the algorithm's time complexity function f(n)
R+ and Z+ are:
the set of all positive values in their respective sets
domain
the set of all possible values for the variable > all values, both true and false
N
the set of natural numbers, which includes all integers greater than or equal to 0.
Q
the set of rational numbers, which includes all real numbers that can be expressed as a/b, where a and b are integers and b ≠ 0.
recursive definition
the value of the function is defined in terms of the output value of the function on smaller input values
Summation notation
used to express the sum of terms in a numerical sequence
inverse
CHECK if a function f: X → Y is a bijection(onto/one-to-one), then the inverse of f is obtained by exchanging the first and second entries in each pair in f. The inverse of f is denoted by f^-1
elements
The objects in a set
proof by exhaustion
proving that a statement by checking each element individually
ordered pair
(x, y)
recursive algorithm
an algorithm that calls itself
vertices
circles/points in a tree
factorial
n! = n * (n-1) * 1
addition mod m
The operation defined by adding two numbers and applying mod m to the result
A description of an algorithm usually includes:
> A name for the algorithm > A brief description of the task performed by the algorithm > A description of the input > A description of the output > A sequence of steps to follow
steps to substitute parts of the formula with a variable:
1. Plug lower limit into the segment that is being replaced to find the new lower limit 2. Plug upper limit into the segment that is being replaced to find the new upper limit 3. replace old limits with the new ones and perform the substitution on the function
to reduce a complex compound proposition:
1. Use DM's laws to distribute negations 2. Look through the laws to see which can apply to the proposition 3. Try to look forward with each possible option to see if any of the results are recognizable as being closer to the desired result 4. If simplifying alone doesn't help, try expanding (use the laws backwards) 5. Repeat steps 1-3, trying to get the expanded form reduced into the desired result
to simplify an arithmetic expression mod m:
1. take mod m of all the terms in the arithmetic expression 2. calculate exponents 3. combine terms to get a number 4. take mod m of that again to get the answer
order of operations:
1. ¬ (not) 2. ∧ (and) 3. ∨ (or)
Venn diagrams
> A rectangle is used to denote the universal set U, and oval shapes are used to denote sets within U. > Venn diagrams can indicate which specific elements are inside and outside the set. > An element is drawn inside the oval if it is in the set represented by the oval.
Rules of inference
> Modus ponens > Modus tollens > Addition > Simplification > Conjunction > Hypothetical syllogism > Disjunctive syllogism > Resolution
empty set (null set)
> The set with no elements > denoted by the symbol ∅
ring
> a closed mathematical system with m elements > the m is the mod that you take of each product of two of the items of {0, 1, 2, ... m-1} > denoted with Zm
universal set
> a set that contains all elements mentioned in a particular context > denoted by the variable U
ordered triple
> denoted (x, y, z) > An ordered list of three items
n-bit string
A string of length n
multiplication mod m
The operation defined by multiplying two numbers and applying mod m to the result
non-decreasing sequence
a sequence in which each number is equal to or greater than the one that came before
walk
a sequence of alternating vertices and edges that starts and ends with a vertex
pseudocode
a language in between written English and a computer language
database
a large collection of data records that is searched and manipulated by a computer
nested loop
a loop that appears within another loop, has an inner and an outer loop
argument
a sequence of propositions, called hypotheses, followed by a final proposition, called the conclusion
r-permutation
a sequence of r items with no repetitions, all taken from the same set
inductive step
The inductive step in a proof by strong induction assumes that S(j) is true for all values of j in the range from a through some integer k ≥ b and then proves that theorem holds for k+1
Asymptotic growth of logarithm functions with different bases
Let a and b be two constants greater than 1, then log base a of n = Θ( log base b of n )
multiplicity
The multiplicity of a prime factor p in a prime factorization is the number of times p appears in the product of primes
closed form
a mathematical expression that expresses the value of the sum without summation notation > only works when the summation notation has an upper limit of n-1 and a lower limit of 0, if they don't then change them and perform math operations to compensate for the adjustment
for-loop
a block of instructions is executed a fixed number of times as specified in the first line of the for-loop defines an index, a starting value for the index, and a final value for the index For i = s to t Step 1 Step 2 . . . Step n End-for
pigeonhole principle
a mathematical tool used to establish that repetitions are guaranteed to occur in certain sets and sequences Ex. if n+1 pigeons are placed in n boxes, then there must be at least one box with more than one pigeon
prime
a number p is prime if it is an integer greater than 1 and its only factors are 1 and p
rational number
a number that can be expressed as the ratio of two integers in which the denominator is non-zero
prime factorization
a positive integer greater than one that is expressed as a product of primes
composite
a positive integer is composite if it has a factor other than 1 or itself
minterm
a product of literals that must contain every literal in the function
existentially quantified statement
a proposition that uses the existential quantifier (∃) to claim that "There exists an x, such that P(x)" which asserts that P(x) is true for at least one possible value for x in its domain > ∃x P(x)
universally quantified statement
a proposition that uses the universal quantifier (∀) to claim that "for all x, P(x)" which asserts that P(x) is true for every possible value for x in its domain > ∀x P(x)
irrational number
a real number that is not rational
matrix representation
a rectangular array of numbers with |A| rows and |B| columns. > Each row corresponds to an element of A and each column corresponds to an element of B. > For a ∈ A and b ∈ B, there is a 1 in row a, column b, if aRb. Otherwise, there is a 0.
expanded form
a summation but written out instead of being compressed into summation notation
dynamical system
a system that changes over time
Counting by complement
a technique for counting the number of elements in a set S that have a property by counting the total number of elements in S and subtracting the number of elements in S that do not have the property
bound variable
a variable that is bound to a quantifier > ∀x P(x)
free variable
a variable that is free to take on any value in the domain > variable x in the predicate P(x)
open walk
a walk in which the first and last vertices are not the same
set identity
an equation involving sets that is true regardless of the contents of the sets in the expression
the representation of a boolean function as a sum of minterms includes:
all minterms which result in 1 when plugged into the function the terms in the minterm are multiplied together then all the minterms are added together to represent the function
edge (u, v) ∈ E
an arrow going from the vertex labeled u to the vertex labeled v > The vertex u is the tail of the edge (u, v) and vertex v is the head
counterexample
an assignment of values to variables that shows that a universal statement is false
key
an attribute or set of attributes that uniquely identifies each n-tuple in the database
counterexample
an element in the domain for which the predicate is false > A single counterexample is sufficient to show that a universally quantified statement is false
principle of strong induction
assumes that the fact to be proven holds for all values less than or equal to k and proves that the fact holds for k+1
proof by contradiction
assuming that the theorem is false and then shows that some logical inconsistency arises as a result of this assumption
base case for a proof by strong induction
establishes that S(n) holds for n = a through b, where a and b are constants
base case
establishes that the theorem is true for the first value in the sequence
Average-case analysis
evaluates the time complexity of an algorithm by determining the average running time of the algorithm on a random input
worst-case analysis
evaluates the time complexity of the algorithm on the input of a particular size that takes the longest time
Comments
begin with "//", explain the purpose of certain steps and are not part of the algorithm itself
exclusive or
evaluates to true when p is true and q is false or when q is true and p is false > denoted with ⊕
Two functions, f and g, are equal if ___
f and g have the same domain and target, and f(x) = g(x) for every element x in the domain
Universal generalization
c is an arbitrary element P(c) ----------- ∴ ∀x P(x)
Existential generalization
c is an element (arbitrary or particular) P(c) ----------- ∴ ∃x P(x)
Universal instantiation
c is an element (arbitrary or particular) ∀x P(x) ----------- ∴ P(c)
Boolean expressions
can be built up by applying Boolean operations to Boolean variables or the constants 1 or 0.
odd integer
can be expressed as 2k + 1 for some integer k
even integer
can be expressed as 2k for some integer k
selection operation
chooses n-tuples from a relational database that satisfy particular conditions on their attributes
logical operation
combines propositions using a particular composition rule
OR gate
computes Boolean addition
AND gate
computes Boolean multiplication
inverter
computes the complement
directed graph (digraph)
consists of a pair (V, E) > V is a set of vertices, and E, a set of directed edges, is a subset of V × V. An individual element of V is called a vertex.
Fibonacci sequence
defined the sequence in an attempt to mathematically describe the population growth of rabbits. The colony starts with one pair of newborn rabbits. The rabbits must be at least one month old before they can reproduce. Every pair of reproducing rabbits gives birth to a new pair of rabbits, one male and one female over the course of a month.
worst-case
defined to be the maximum number of atomic operations the algorithm requires, where the maximum is taken over all inputs of size n
roster notation
definition of a set is a list of the elements enclosed in curly braces with the individual elements separated by commas Ex. A = { 2, 4, 6, 10 }
reordering the hypotheses ___ change whether an argument is valid or not
does not > two arguments are considered to be the same even if the hypotheses appear in a different order
one-to-one (injective)
f maps different elements in X to different elements in Y
anti-symmetric
for every x,y ∈ A, xRy and yRx imply that x = y
symmetric
for every x,y ∈ A, xRy implies that yRx
transitive
for every x,y, z ∈ A, xRy and yRz imply that xRz
finite set
has a finite number of elements
infinite set
has an infinite number of elements
arbitrary element
has no special properties other than those shared by all the elements of the domain
truth table
have a row for every possible combination of truth assignments for the statement's variables > If there are n variables, there are 2^n rows
non-negative
if x ≥ 0
comparable
if x ⪯ y or y ⪯ x
product rule
if you're making a selection from a set of sequences, the number of options when picking one from each sequence is the cardinality of each sequence multiplied together Ex. D = {coffee, orange juice} M = {pancakes, eggs} S = {bacon, sausage, hash browns} 2 * 2 * 3 = 12 options
bijective
if a function(bijection or one-to-one correspondence) is both one-to-one and onto
well-defined function
if every element in Y is mapped to exactly one element in X
pairwise disjoint
if every pair of distinct sets in the sequence is disjoint
polynomial
if f(n) is Θ(n^k) for some constant k ≥ 1
contradiction
if the proposition is always false, regardless of the truth value of the individual propositions that occur in it
tautology
if the proposition is always true, regardless of the truth value of the individual propositions that occur in it
maximal
if there is no x ≠ y such that x ⪯ y x has no predecessors in the Hasse Diagram
minimal
if there is no x ≠ y such that y ⪯ x x is has no descendants in the Hasse Diagram
logically equivalent
if two compound propositions have the same truth value regardless of the truth values of their individual propositions > notated by (s ≡ r) > Propositions s and r are logically equivalent if and only if the proposition s ↔ r is a tautology
I will share my cookie with you only if you share your soda with me. (p → q or q → p)?
p → q > p only if q.
intersection
is the set of all elements that are elements of both A and B > denoted A ∩ B
while-loop
iterates an unknown number of times, ending when a certain condition becomes false While ( condition ) Step 1 Step 2 . . . Step n End-while
De Morgan's laws
logical equivalences that show how to correctly distribute a negation operation inside a parenthesized expression >The two versions of De Morgan's laws are: >> ¬(p ∨ q) ≡ (¬p ∧ ¬q) >> ¬(p ∧ q) ≡ (¬p ∨ ¬q)
f = Θ(g)
means that the function f(n) is equal to g(n), if constant factors are omitted and small values for n are ignored
f = Ω(g)
means that the function f(n) is greater than or equal to g(n), if constant factors are omitted and small values for n are ignored
f = O(g)
means that the function f(n) is less than or equal to g(n), if constant factors are omitted and small values for n are ignored
biconditional operation
p if and only if q > The proposition p ↔ q is true when p and q have the same truth value and is false when p and q have different truth values. > denoted p ↔ q
proof by contrapositive
proves a conditional theorem of the form p → c by showing that the contrapositive ¬c → ¬p is true > ¬c is assumed to be true and ¬p is proven as a result of ¬c
existential/universal instantiation
replace a quantified variable with an element of the domain
existential/universal generalization
replace an element of the domain with a quantified variable
negation
reverses the truth value of a proposition > denoted with -
ceiling function
rounds a real number to the nearest integer in the upward direction
well-ordering principle
says that any non-empty subset of the non-negative integers has a smallest element
explicit formula
showing how the value of term a_k depends on k a_k = 2^k for k ≥ 1
input/output table
shows the output value of the function for every possible combination of input values
to find inverse of a function:
solve for y and isolate x
return
specifies the output of an algorithm
f ο g
stands for f of g of x >>or<< f(g(x))
axioms
statements assumed to be true
principle of mathematical induction
states that if the base case (for n = 1) is true and inductive step is true, then the theorem holds for all positive integers
Division Algorithm
states that the result of the division (the quotient) and the remainder are unique
relational database model
stores data records as relations
restrictions
when a choice in a product rule option is restricted, the sequence for that choice should be reduced to only that choice Ex. restricting the first number to 0 in a binary string takes the choices from {0, 1} to {0} and the cardinality follows
generalized product rule
when choosing an item in a sequence removes it from consideration for future choices, then the item is removed from the sequence and the sequence's cardinality is decreased
sum rule
when there are multiple sequences to choose from for a choice, but only one item can be chosen, add the cardinalities of each sequence in the choice together to get the options for that choice Ex. Screen size = {14in, 15in, 17in} Processor speed = {2.0 GHz, 2.7 GHz} Storage = {SSD choices: {128G, 256G, 512G} HDD choices: {256G, 512G}} 3 * 2 * (3+2) = 30 options
x and y are equivalent if and only if ___
x mod m = y mod m
Consider again the set {John, Paul, George, Ringo}. These four would like to sit on a bench together, but Paul and John would like to sit next to each other. How many possible seatings are there?
{George, Ringo, (John+Paul)} 3 * 2 * 1 * 2 = 12 options
De Morgan's law for quantified statements
¬∀x P(x) ≡ ∃x ¬P(x) ¬∃x P(x) ≡ ∀x ¬P(x)
in logical expressions, "no one" means:
¬∃x
De Morgan's laws for nested quantified statements:
¬∃x ∀y P(x, y) ≡ ∀x ∃y ¬P(x, y) ¬∃x ∀y (P(x) ∨ ¬Q(y)) ≡ ∀x ∃y ¬(P(x) ∨ ¬Q(y))