Upload
tudor-girba
View
993
Download
0
Tags:
Embed Size (px)
DESCRIPTION
I used this set of slides for the lecture on Sets I gave at the University of Zurich for the 1st year students following the course of Formale Grundlagen der Informatik.
Citation preview
What exactly is logic?
What exactly is logic?the study of the principles of correct reasoning
Wax on … wax off … these are the basics
http://www.youtube.com/watch?v=3PycZtfns_U
computerinformation information
computation
SetA set is a group of objects.
SetA set is a group of objects.
{10, 23, 32}
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
Z = {… , -2, -1, 0, 1, 2, … }
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
Z = {… , -2, -1, 0, 1, 2, … }
Ø empty set
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
Z = {… , -2, -1, 0, 1, 2, … }
Ø
U
empty set
universe
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
Z = {… , -2, -1, 0, 1, 2, … }
Ø
U
empty set
universe
Membershipa is a member of set A
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
Z = {… , -2, -1, 0, 1, 2, … }
10 ∈ {10, 23, 32}
Ø
U
empty set
universe
Membershipa is a member of set A
SetA set is a group of objects.
{10, 23, 32}
N = {0, 1, 2, … }
Z = {… , -2, -1, 0, 1, 2, … }
10 ∈ {10, 23, 32}
-1 ∉ N
Ø
U
empty set
universe
Membershipa is a member of set A
Subset A⊆BEvery member of A is also an element of B.
Subset A⊆B
∀x:: x∈A ⇒ x∈B
Every member of A is also an element of B.
Subset A⊆B
∀x:: x∈A ⇒ x∈B
∅ ⊆ A.A ⊆ A.A = B ⇔ A ⊆ B ∧ B ⊆ A.
Every member of A is also an element of B.
Subset A⊆B
∀x:: x∈A ⇒ x∈B
∅ ⊆ A.A ⊆ A.A = B ⇔ A ⊆ B ∧ B ⊆ A.
Proper subset A⊂BA is a subset of B and not equal to B.
Every member of A is also an element of B.
Subset A⊆B
∀x:: x∈A ⇒ x∈B
∅ ⊆ A.A ⊆ A.A = B ⇔ A ⊆ B ∧ B ⊆ A.
Proper subset A⊂B
∀x:: A⊆B ∧ A≠B
A is a subset of B and not equal to B.
Every member of A is also an element of B.
Union A∪B
∀x:: x∈A ∨ x∈BA∪B={ x | x∈A or x∈B }
Union A∪B
∀x:: x∈A ∨ x∈BA∪B={ x | x∈A or x∈B }
Union A∪B
∀x:: x∈A ∨ x∈BA∪B={ x | x∈A or x∈B }
A ∪ B = B ∪ A.A ∪ (B ∪ C) = (A ∪ B) ∪ C.A ⊆ (A ∪ B).A ∪ A = A.A ∪ ∅ = A.A ⊆ B ⇔ A ∪ B = B.
Intersection A∩B
∀x:: x∈A ∧ x∈BA∩B={ x | x∈A and x∈B }
Intersection A∩B
∀x:: x∈A ∧ x∈BA∩B={ x | x∈A and x∈B }
Intersection A∩B
∀x:: x∈A ∧ x∈BA∩B={ x | x∈A and x∈B }
A ∩ B = B ∩ A.A ∩ (B ∩ C) = (A ∩ B) ∩ C.A ∩ B ⊆ A.A ∩ A = A.A ∩ ∅ = ∅.A ⊆ B ⇔ A ∩ B = A.
Complements A\B, A’
∀x:: x∈A ∧ x∉BA\B={ x | x∈A and x∉B }
Complements A\B, A’
∀x:: x∈A ∧ x∉BA\B={ x | x∈A and x∉B }
A \ B ≠ B \ A.A ∪ A′ = U.A ∩ A′ = ∅.(A′)′ = A.A \ A = ∅.U′ = ∅.∅′ = U.A \ B = A ∩ B′.
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ A = AA ∪ A = A
Idempotence
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ A = AA ∪ A = A
Idempotence
A ∪ B = B ∪ AA ∩ B = B ∩ A
Commutativity
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ A = AA ∪ A = A
Idempotence
A ∪ B = B ∪ AA ∩ B = B ∩ A
Commutativity
A ∩ (B ∩ C) = (A ∩ B) ∩ CA ∪ (B ∪ C) = (A ∪ B) ∪ C
Associativity
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ A = AA ∪ A = A
Idempotence
A ∪ B = B ∪ AA ∩ B = B ∩ A
Commutativity
A ∩ (B ∩ C) = (A ∩ B) ∩ CA ∪ (B ∪ C) = (A ∪ B) ∪ C
Associativity
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
Distributivity
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ A = AA ∪ A = A
Idempotence
A ∩ A’ = ∅
A ∪ A’ = U
Complement
A ∪ B = B ∪ AA ∩ B = B ∩ A
Commutativity
A ∩ (B ∩ C) = (A ∩ B) ∩ CA ∪ (B ∪ C) = (A ∪ B) ∪ C
Associativity
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
Distributivity
Similar to boolean algebra
a ∧ 1 = aa ∨ 0 = a
Neutral elements
a ∧ 0 = 0a ∨ 1 = 1
Zero elements
a ∧ a = aa ∨ a = a
Idempotence
a ∧ ¬ a = 0a ∨ ¬ a = 1
Negation
a ∨ b = b ∨ aa ∧ b = b ∧ a
Commutativity
a ∧ (b ∧ c) = (a ∧ b) ∧ ca ∨ (b ∨ c) = (a ∨ b) ∨ c
Associativity
a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c)a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c)
Distributivity
A ∩ U = AA ∪ ∅ = A
Neutral elements
A ∩ ∅ = ∅
A ∪ U = U
Zero elements
A ∩ A = AA ∪ A = A
Idempotence
A ∩ A’ = ∅
A ∪ A’ = U
Complement
A ∪ B = B ∪ AA ∩ B = B ∩ A
Commutativity
A ∩ (B ∩ C) = (A ∩ B) ∩ CA ∪ (B ∪ C) = (A ∪ B) ∪ C
Associativity
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
Distributivity
A ∩ U = A A ∪ B = B ∪ AA ∪ ∅ = A
A ∩ ∅ = ∅
A ∪ U = U
A ∩ A = AA ∪ A = A
A ∩ A’ = ∅
A ∪ A’ = U
Neutral elements
Zero elements
Idempotence
Complement
A ∩ (B ∩ C) = (A ∩ B) ∩ C
A ∩ B = B ∩ A
A ∪ (B ∪ C) = (A ∪ B) ∪ C
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
(A ∩ B)’ = (A’) ∪ (B’)(A ∪ B)’ = (A’) ∩ (B’)
Commutativity
Associativity
Distributivity
DeMorgan’s
A ⊆ A.
A ⊆ B ∧ B ⊆ A ⇔ A = B.
A ⊆ B ∧ B ⊆ C ⇔ A ⊆ C
Reflexivity
Anti-symmetry
Transitivity
Scissors
Paper
Stone
Scissors
Paper
Stone
beats
beats
beats
Scissors
Paper
Stone
beats
beats
beats
Scissors
Paper
Stone
beats
beats
beats
beats Scissors Paper StoneScissors FALSE TRUE FALSEPaper FALSE FALSE TRUEStone TRUE FALSE FALSE
Scissors
Paper
Stone
beats
beats
beats
beats Scissors Paper StoneScissors FALSE TRUE FALSEPaper FALSE FALSE TRUEStone TRUE FALSE FALSE
Scissors
Paper
Stone
beats
beats
beats
beats Scissors Paper StoneScissors FALSE TRUE FALSEPaper FALSE FALSE TRUEStone TRUE FALSE FALSE
Scissors
Paper
Stone
beats
beats
beats
beats Scissors Paper StoneScissors FALSE TRUE FALSEPaper FALSE FALSE TRUEStone TRUE FALSE FALSE
beats Scissors Paper StoneScissors FALSE TRUE FALSEPaper FALSE FALSE TRUEStone TRUE FALSE FALSE
beats = {(Scissors, Paper), (Paper, Stone), (Stone, Scissors)}
beats Scissors Paper StoneScissors FALSE TRUE FALSEPaper FALSE FALSE TRUEStone TRUE FALSE FALSE
beats = {(Scissors, Paper), (Paper, Stone), (Stone, Scissors)}
beats ⊆ {Scissor, Paper, Stone} x {Scissor, Paper, Stone}
Cartesian product AxB
AxB={ (a,b) | a∈A and b∈B }
Cartesian product AxB
AxB={ (a,b) | a∈A and b∈B }
A × ∅ = ∅.A × (B ∪ C) = (A × B) ∪ (A × C).(A ∪ B) × C = (A × C) ∪ (B × C).
N-ary Relation
A1, A2, ..., AnR ⊆ A1 x A2 x...x An
N-ary Relation
A1, A2, ..., AnR ⊆ A1 x A2 x...x An
Binary Relation
N-ary Relation
A1, A2, ..., AnR ⊆ A1 x A2 x...x An
Binary Relation
A1, A2R ⊆ A1 x A2
(a,b) ∈ RaRb
N-ary Relation
A1, A2, ..., AnR ⊆ A1 x A2 x...x An
Binary Relation
A1, A2R ⊆ A1 x A2
(a,b) ∈ RaRb
Tudor Gîrbawww.tudorgirba.com
creativecommons.org/licenses/by/3.0/