Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


eliminar archivos que cargué, Apuntes de Electromagnetismo

Basic concepts on sets A set contains elements a 2 S means element a is contained in set S Examples 2 2 N, 2 3 =2 Z, p 2 =2 Q, 5 2 A, 5 =2 B De ning sets A = f2; 3; 5; 6g B = f1; 3; 6; 8; 9g W = fMon;Tues;Wednes; Thus; Fri ; Sat; Sung E = fa 2 Zja = 2b for some bg E = fa 2 Z : a = 2b for some bg I = fx 2 R : a  x  bg I 0

Tipo: Apuntes

2019/2020

Subido el 18/01/2020

jmcb
jmcb 🇪🇸

1 documento

1 / 108

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
Logic and Discrete Mathematics
Data Science and Engineering
Marc Noy
Anna de Mier, Juanjo Ru´e
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Vista previa parcial del texto

¡Descarga eliminar archivos que cargué y más Apuntes en PDF de Electromagnetismo solo en Docsity!

Logic and Discrete Mathematics

Data Science and Engineering

Marc Noy Anna de Mier, Juanjo Ru´e

Contents of the course

  1. Sets and induction
  2. Logic I (^) Proposicional calculus I (^) First order logic (predicate calculus)
  3. Integers and polynomials I (^) Divisibility of integers I (^) Congruences I (^) Polynomials
  4. Combinatorics I (^) Basic counting I (^) Permutations and cycles I (^) Recurrences
  5. Graphs: theory and algorithms I (^) Graphs and digraphs I (^) Trees I (^) Minimum Spanning Tree and Travelling Salesman Problem I (^) Planar graphs and graph coloring

Basic concepts on sets

A set contains elements a ∈ S means element a is contained in set S Examples 2 ∈ N, 23 ∈/ Z,

2 ∈/ Q, 5 ∈ A, 5 ∈/ B

Defining sets A = { 2 , 3 , 5 , 6 } B = { 1 , 3 , 6 , 8 , 9 } W = {Mon, Tues, Wednes, Thus, Fri, Sat, Sun} E = {a ∈ Z|a = 2b for some b} E = {a ∈ Z : a = 2b for some b} I = {x ∈ R : a ≤ x ≤ b} I ′^ = {x ∈ R : a < x ≤ b}

The empty set ∅ contains no element A ⊆ B means A is a subset of B

Operations on sets

Union A ∪ B = {x : x ∈ A or x ∈ B} Intersection A ∩ B = {x : x ∈ A and x ∈ B} Complement A\B = A − B = {x : x ∈ A and x ∈/ B}

If all sets we consider are subsets of a fixed set U, define Ac^ = {x ∈ U : x ∈/ A} The following rules hold

  1. A ∪ B = B ∪ A, A ∪ (B ∪ C ) = (A ∪ B) ∪ C = A ∪ B ∪ C
  2. A ∩ B = B ∩ A, A ∩ (B ∩ C ) = (A ∩ B) ∩ C = A ∩ B ∩ C
  3. A ∩ (B ∪ C ) = (A ∩ B) ∪ (A ∩ C )
  4. A ∪ (B ∩ C ) = (A ∪ B) ∩ (A ∪ C )
  5. (A ∪ B)c^ = Ac^ ∩ Bc
  6. (A ∩ B)c^ = Ac^ ∪ Bc The product A × B is the set of all ordered pairs (a, b): A × B = {(a, b) : a ∈ A, b ∈ B}

Induction proofs

Example We want to prove the formula

E (n) 12 + 2^2 + 3^2 + · · · + n^2 = n(n + 1)(2n + 1) 6 We first check that it is true for n = 1 We then check that if it is true for n, then it is also true for n + 2 That is E (n) =⇒ E (n + 1) Assuming E (n) true, we need to prove

E (n+1) 12 +2^2 +3^2 +· · ·+n^2 +(n+1)^2 = (n + 1)(n + 2)(2n + 3) 6 By the induction hypothesis we have

12 + 2^2 + 3^2 + · · · + n^2 + (n + 1)^2 =

n(n + 1)(2n + 1) 6

  • (n + 1)^2 Now it is easy to check that the right-hand term is indeed equal to (n + 1)(n + 2)(2n + 3) 6 This concludes the proof

The induction principle

We want to prove a property P(n) for all integers n > 0 We must prove two things: I (^) P(1) is true I (^) For all n > 0, if P(n) is true then P(n + 1) is true The induction principle says that then P(n) is true for all n > 0 Induction can start at n = 0 or at any fixed positive integer. Examples I ∏ni=

1 − (^) i^12

= n 2 +1n. I (^) n! > 2 n^ for n ≥ 4. Here the induction starts at n = 4. I (^) For a real number x > −1, we have (1 + x)n^ ≥ 1 + nx for n ≥ 0. I (^) The Fibonacci numbers fn are defined by fn = fn− 1 + fn− 2 for n ≥ 2 , f 0 = 0, f 1 = 1. Then fn+1fn− 1 − f (^) n^2 = (−1)n, for n ≥ 1

1. LOGIC

1.1 Proposicional calculus

Atomic formulas are basic statements I (^) Today is Monday I (^) Anna has two children I (^) Wise people don’t smoke I (^) Robert is sick I (^) The party is tomorrow

We wish to combine these atomic statements to form ’formulas’

George Boole (1815–1864)

An Investigation of the Laws of Thought on Which are Founded the Mathematical Theories of Logic and Probabilities

Assigning truth values (also known as interpretations)

Assign to each atom a truth value

t : {Atoms} → { 0 , 1 }

1 means True and 0 means False To each formula F we evaluate its truth value as follows I (^) If F = p is an atom, its value is t(p) I (^) t(¬F ) = 1 − t(F ) (true if F is false) I (^) t(F ∨ G ) = max{t(F ), t(G )} (true if at least one is true) I (^) t(F ∧ G ) = min{t(F ), t(G )} (true if both are true)

F ¬F

F G F ∧ G F ∨ G

Logical equivalence

Two formulas are logically equivalent if they give the same evaluation on all truth values of their arguments I (^) (p → q) ≡ (¬p ∨ q) I (^) (p ↔ q) ≡ (p → q ∧ q → p) Further equivalences I (^) F ∨ G ≡ G ∨ F (commutative) I (^) F ∨ (G ∨ H) ≡ (F ∨ G ) ∨ H (associative) I (^) F ∧ G ≡ G ∧ F I (^) F ∧ (G ∧ H) ≡ (F ∧ G ) ∧ H I (^) ¬¬F ≡ F I (^) ¬(F ∧ G ) ≡ ¬F ∨ ¬G (De Morgan) I (^) ¬(F ∨ G ) ≡ ¬F ∧ ¬G I (^) F ∧ (G ∨ H) ≡ (F ∧ G ) ∨ (F ∧ H) (Distributive) I (^) F ∨ (G ∧ H) ≡ (F ∨ G ) ∧ (F ∨ H) I (^) F ⊕ G ≡ (F ∧ ¬G ) ∨ (¬F ∧ G )

F is a Tautology if it always evaluates to 1 F is a Contradiction if it always evaluate to 0

p ∨ ¬p is a tautology p ∧ ¬p is a contradiction

If T is a tautology and C is a contradiction then

I (^) A ∨ T ≡ T I (^) A ∧ T ≡ A I (^) A ∨ C ≡ A I (^) A ∧ C ≡ C

Distinction between ↔ (connector) and ≡ (logical equivalence)

Procedure for transforming a formula into CNF

I (^) Eliminate → using A → B ≡ ¬A ∨ B I (^) Push negations down using I (^) ¬¬A ≡ A I (^) ¬(A ∧ B) ≡ ¬A ∨ ¬B I (^) ¬(A ∨ B) ≡ ¬A ∧ ¬B I (^) Use A ∨ (B 1 ∧ · · · ∧ Br ) ≡ (A ∨ B 1 ) ∧ · · · ∧ (A ∨ Br )

Logical consequence

Formula B is a logical consequence of A if

For every truth assignment of the literals, whenever A evaluates to 1, B also evaluates to 1

We write A |= B B is a logical consequence of {A 1 ,... , Am} if

A 1 ∧ · · · ∧ Am |= B