Sets and Logic in 30 minutes Alex Karassev

  • Slides: 16
Download presentation
Sets and Logic … in 30 minutes Alex Karassev

Sets and Logic … in 30 minutes Alex Karassev

Elements of a set ¡ a ∊ A means that element a is in

Elements of a set ¡ a ∊ A means that element a is in the set A ¡ Example: A = the set of all odd integers bigger than 2 but less than or equal to 11 l 3∊A l 4∉A l 15 ∉ A

Set builder notation ¡ Example: A = the set of all odd integers bigger

Set builder notation ¡ Example: A = the set of all odd integers bigger than 2 but less than or equal to 11 l A = {3, 5, 7, 9, 11} ¡ Example: A = the set of all irrational numbers between 1 and 2 l A = {x| x is irrational and 1<x<2} l Reads as A is the set of all x such that x is irrational and 1<x<2

Interval notations Closed interval: [a, b] is the set of all numbers not smaller

Interval notations Closed interval: [a, b] is the set of all numbers not smaller than a and not bigger than b [a, b] = {x | a≤x≤b} ¡ Example: [-1, 3] x -1 3 ¡

Interval notations Open intervals: (a, b) is the set of all numbers bigger than

Interval notations Open intervals: (a, b) is the set of all numbers bigger than a and smaller than b (a, b) = {x | a<x<b} ¡ Example: (-1, 3) x -1 3 ¡

Interval notations Half-Open (half-closed) intervals: (a, b] is the set of all numbers bigger

Interval notations Half-Open (half-closed) intervals: (a, b] is the set of all numbers bigger than a and smaller than or equal to b (a, b] = {x | a<x≤b} ¡ Example: (-1, 3] x -1 3 ¡ ¡ The interval [a, b) is defined similarly

Infinite intervals a a ¡ [a, ∞) = {x | a≤x} ¡ (a, ∞)

Infinite intervals a a ¡ [a, ∞) = {x | a≤x} ¡ (a, ∞) = {x | a<x} ¡ (-∞, a] = {x | x≤a} a ¡ (-∞, a) = {x | x<a} a ¡ The whole real line R = (-∞, ∞) Note: ∞ is not a number!

Subsets Set B is called a subset of the set A if any element

Subsets Set B is called a subset of the set A if any element of B is also an element of A A B ¡ B⊂A ¡ Example ¡ l l If A = [0, 10] and B={1, 3, 5} then B⊂A If A = [0, 10] and C = [-1, 3), C is not a subset of A

Union ¡ The union of two sets A and B is the set of

Union ¡ The union of two sets A and B is the set of all elements x such that x is in A OR x is in B A∪B ¡ Notation: A ∪ B = { x | x ∊ A or x ∊ B}

Union ¡ Examples l l If A = (-1, 1) and B=[0, 2] then

Union ¡ Examples l l If A = (-1, 1) and B=[0, 2] then A ∪ B = (-1, 2] -1 0 -1 1 If A = (- ∞, 1] and B= (1, ∞) then A ∪ B = (- ∞, ∞) = R 1 2 2

Intersection ¡ The intersection of two sets A and B is the set of

Intersection ¡ The intersection of two sets A and B is the set of all elements x such that x is in A AND x is in B B A A∩B ¡ Notation: A ∩ B = { x | x ∊ A and x ∊ B}

Intersection ¡ Examples If A = (-1, 1) ∪ [2, 4] and B=(0, 3]

Intersection ¡ Examples If A = (-1, 1) ∪ [2, 4] and B=(0, 3] then A ∩ B = (0, 1) ∪ [2, 3] -1 0 1 2 l l If A = (- ∞, 1] and B= (1, ∞) then A ∩ B = empty set = ∅ 3 4

Logic: implications ¡ P⇒ Q l l reads: “P implies Q” or if “P

Logic: implications ¡ P⇒ Q l l reads: “P implies Q” or if “P then Q” Example: a (true) statement “All cats need food” can be stated as x is a cat P ¡ ¡ ⇒ x needs food Q Implications can be true or false. For example, x 2 = x ⇒ x = 1 is false “⇒” is not the same as “=” !

Logic: converse ¡ ¡ A converse of P⇒ Q is Q ⇒ P Warning:

Logic: converse ¡ ¡ A converse of P⇒ Q is Q ⇒ P Warning: if a statement is true it does not mean that its converse is true i. e. if P⇒ Q is true it does not mean that Q Example: l ⇒ P is true “All cats need food” is true, so ⇒ l x needs food ⇒ x is a cat x needs food is true x is a cat (if x needs food then x is a cat) is false!

Logic: equivalence ¡ Two statements P and Q are called equivalent if both implications

Logic: equivalence ¡ Two statements P and Q are called equivalent if both implications P⇒ Q and Q ⇒ P hold ¡ Notation: Q ⇔ P (reads “Q is equivalent to P” or “Q if and only if P”) Examples ¡ ⇔ l x 2 = 4 l a 2 + b 2 = 0 l A triangle is equilateral x = 2 or x = -2 ⇔ a=b=0 ⇔ All its angles are equal

Logic: negation ¡ Notation: NOT P, also �P and P Negation and implication ¡

Logic: negation ¡ Notation: NOT P, also �P and P Negation and implication ¡ P ⇒ Q is true if and only if NOT Q ⇒ NOT P is true! Example: ¡ ⇒ l x is a cat x needs food l NOT (x needs food) ⇒ NOT (x is a cat) x does not need food ⇒ x is not a cat