1.2 - Predicate Logic Flashcards

predicates, quantifiers, rules, proofs, applications (18 cards)

1
Q

predicate

A

a sentence template with variables; functions that return T/F. After choosing the domain(s) for variables and plugging in values, the predicate becomes a proposition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

unary vs binary predicate

A

unary involves 1 variable, while binary involves 2 variables, possibly from different domains

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

the need for quantifiers

A

predicates need a way to discuss some or all values in the domain. Propositional logic is built to handle finite amounts of statements, but quantifiers can generalize infinite cases into one statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

3 types of quantifiers

A
  1. universal (∀xP(x)): holds for every x
  2. existential (∃xP(x)): holds for at least one x
  3. unique existential (∃!xP(x)): holds for exactly one x
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

formal definition of unique existential quantifier

A

∃x[P(x) ∧ ∀y(P(y) → y = x)]

there exists an x that satisfies P (existence), and if there is a y that satisfies P, then y must be none other than x (uniqueness)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

when does order of quantifiers matter, and when does it not

A

matters when different quantifiers are involved: ∀x∃y (for every x there exists a y such that…) ≠ ∃y∀x (there exists a y such that for every x…)

does not matter when all quantifiers are of the same type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

de morgan’s laws for quantifiers (how to push negation through quantifiers)

A

¬(∀x P(x)) = ∃x ¬P(x)
“no x satisfies P(x)” = “there is an x that doesn’t satisfy P(x)”

¬(∃x P(x)) = ∀x ¬P(x)
“there isn’t an x that satisfies P(x)” = “every x doesn’t satisfy P(x)”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

quantifiers over finite domains/universes, such as {a1, a2, .., an} for universal and existential

A

∀xP(x) = P(1) ∧ P(2) ∧ … ∧ P(n)
∃xP(x) = P(1) v P(2) v … v P(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to prove/disprove a universal statement

A

prove over finite: check all for true
prove over infinite: show for arbitrary
disprove: give a counterexample

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how to prove/disprove an existential statement

A

prove: give a witness
disprove: check all for false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what happens if a universal quantifier is restricted

A

an implication is made, for protection from counterexamples

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what happens if an existential quantifier is restricted

A

a conjunction is made, for witnesses that satisfy both the restriction and the predicate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

is this valid: ∀x(P(x) ∧ Q(x)) = ∀x(P(x)) ∧ ∀x(Q(x))

A

yes, ∀ distributes over AND

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

is this valid: ∀x(P(x) v Q(x)) = ∀x(P(x)) v ∀x(Q(x))

A

no, ∀ distributes over AND, not OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

is this valid: ∃x(P(x) v Q(x)) = ∃x(P(x)) v ∃x(Q(x))

A

yes, ∃ distributes over OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

is this valid: ∃x(P(x) ∧ Q(x)) = ∃x(P(x)) ∧ ∃x(Q(x))

A

no, ∃ distributes over OR, not AND

17
Q

divisibility definition (no remainders)

A

∀a ∈ Z{0}, ∀b ∈ Z : a|b ↔ ∃k ∈ Z (b=ak)

“for all non-zero ints a and ints b, a divides b if and only if there is an int k such that b = ak.”

a: divisor, b: dividend, k: whole quotient

18
Q

euclidean division (division algorithm/theorem, includes remainders)

A

∀a ∈ Z, ∀b ∈ Z{0}, ∃!q, r ∈ Z such that a = bq + r and 0 ≤ r < |b|

“for all ints a and non-zero ints b, there exist unique ints q, r such that a = bq + r and 0 ≤ r < |b|.”

a: dividend, b: divisor, q: quotient, r: remainder