discrete structures final exam

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/55

flashcard set

Earn XP

Description and Tags

OU cs 3000

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

56 Terms

1
New cards

conjunction (and, ^)

P = its raining

Q = its cold

both statements must be true

P ^ Q = its raining and its cold

2
New cards

disjunction (or, V)

P = it is sunny

Q = it is windy

at least one statement must be true

P V Q = it is sunny or it is windy

3
New cards

exclusive or (xor)

p = light is on

q = fan is on

one statement must be true, but not both

p xor q = one is on but not both

4
New cards

conditional (if-then)

p = its raining

q = the ground is wet

if the first part is true, then the second part must also be true

if it rains, then the ground is wet

5
New cards

converse

q → p

p = its raining

q = ground is wet

flip the if and then

if the ground is wet then it is raining

6
New cards

inverse

~p → ~q

p = its raining

q = ground is wet

negate both hypothesis and conclusion

if it is not raining then the ground is not wet

7
New cards

contrapositive

~q → ~p

p = its a dog

q = its a mammal

negate and flip hypothesis and conclusion

if it is not a mammal then it is not a dog

8
New cards

negation

~p

p = its sunny

opposite (ex: not p)

it is not sunny

9
New cards

biconditional (if and only if)

p q

both sides must be both true or both false

ex: you can only drive if you have a license

10
New cards

modus ponens

if p → q and p is true, then q must be true

11
New cards

modus tollens

if p → q and q is false then p must be false

12
New cards

direct proof

prove is n is even then n² is even

prove a statement directly

let n = 2k

n² = 4k² = 2(2k²) which is even

13
New cards

indirect proof

assume the opposite to derive a contradiction

14
New cards

universal quantifier

upside down A, for all elements in a set

15
New cards

existential quantifier

backwards E, there exists at least one element in a set

16
New cards

negation of quantifiers

A becomes E and vice versa

17
New cards

math definition of even numbers

2k

18
New cards

math definition of odd numbers

2k + 1

19
New cards

rational numbers

numbers that can be written as a fraction of integers, p/q, where they are both real numbers and q ≠ 0

20
New cards

divisibility

int a divides b if there is an int c such that b = a * c

a | b if b = a * c

21
New cards

prime factorization

ex: 60

expressing a number as a product of primes

60 = 2² * 3 * 5

22
New cards

quotient-remainder theorem

any integer n can be written as

n = dq + r where 0 <= r < d

r = remainder, q = quotient, d = divisor

23
New cards

finding a formula

ex: 2, 4, 6, 8 …

an = 2n

look for patterns that get you from one number to the next

24
New cards

summation (∑)

∑ₖ₌₁ⁿ k = 1 + 2 + 3 + ... + n = n(n+1)/2

sum of terms in a sequence (with lower and upper limit)

25
New cards

product notation (∏)

∏ₖ₌₁ⁿ k = 1 2 3 ... n = n!

product of terms in a sequence

26
New cards

inductive proof

step 1: base case, prove true for smallest value

step 2: inductive hypothesis, set n = k and replace

step 3: prove true for n = k + 1

27
New cards

set membership

x ∈ A means x is in set A.

28
New cards

subset

A ⊆ B means every element of A is in B.

29
New cards

union

A ∪ B = { x | x ∈ A or x ∈ B }.

30
New cards

intersection

A ∩ B = { x | x ∈ A and x ∈ B }.

31
New cards

difference

A - B = elements in A but not in B

32
New cards

disjoint sets

A ∩ B = ∅

33
New cards

partition

A set split into disjoint, non-empty subsets

34
New cards

cartesian product

A × B = { (a, b) | a ∈ A, b ∈ B }

35
New cards

power set

All subsets of A, including the empty set

36
New cards

well defined function

every input has exactly one output

37
New cards

one-to-one functions

f(a) = f(b) implies a = b

each element in the domain maps to one element in the codomain

38
New cards

onto functions

Every y ∈ codomain has at least one x ∈ domain.

39
New cards

inverse function

f⁻¹(f(x)) = x.

reverses original function (swap y and x)

40
New cards

cardinality

number of elements in a set

41
New cards

reflexive

a is related to a (itself)

42
New cards

symmetric

if a is related to b then b is related to a

43
New cards

transitive

if a is related to b and b is related to c then a is related to c

44
New cards

congruence modulo (mod) n

a ≡ b mod n n | (a - b).

two numbers are congruent mod n if their remainders when divided by n are the same

45
New cards

relatively prime

gcd(a, b) = 1

relatively prime if the greatest common denominator is 1

46
New cards

RSA encryption

  1. choose primes p, q

  2. compute n = pq

  3. choose e such that gcd(e, n) = 1

  4. find d as inverse of e mod n

  5. encryption c = me mod n

  6. decryption m = cd mod n

47
New cards

probability- multiplication rule

for independent events: P(A ∩ B) = P(A) * P(B).

48
New cards

probability- addition rule (disjoint)

P(A ∪ B) = P(A) + P(B).

49
New cards

probability- difference rule

P(A \ B) = P(A) - P(A ∩ B).

50
New cards

probability- permutations

n! / (n - r)!

number of ways to arrage a set of items

51
New cards

probability- combinations

n C r = n!/ (r!(n-r)!)

number of ways to select a subset of items from a set

52
New cards

pascal’s triangle

triangle giving binomial coefficients

<p>triangle giving binomial coefficients</p>
53
New cards

binomial theorem

(a+b)^n = ∑k=0, n ​(k n​)a^(n−k) b^k.

54
New cards

big-o

describes upper bound (worst-case) of an algorithms run-time

ex: f(n) = 3n2 + 5n is O(n2)

55
New cards

big-omega

f(n) = Ω(n²) if it grows at least as fast as n2

lower bound (best case scenario)

56
New cards

big-theta

exact bound (both upper and lower).
Example: f(n) = Θ(n²).