Docsity

Topics in COT 3100: Logic, Sets, Relations, Functions, Number Theory, Strings, Languages -, Study notes of Computer Science

Toggle sidebar
bg1
COT 3100 Topics Covered
Logic : Use of truth tables, logical connectives, implications,
logic and implication laws, use of quantifiers
Sets : Definition, Union, Intersection, Minus, Some Counting,
Set Laws, Set Table, Venn Diagrams, Inclusion/Exclusion
Principle
Relations & Functions: Definition of a relation, reflexive,
irreflexive, symmetric, anti-symmetric, transitive, injection,
surjection, and bijection.
Number Theory: Induction, Definition of divisibility, Use of
mod and mod rules, Euclidโ€™s Algorithm
Strings and Languages: Regular expressions, DFAs, languages
are sets of strings.
Relevant parts in the book:
Logic 2.1 โ€“ 2.4
Sets 3.1- 3.3
Number Theory 4.1 โ€“ 4.4
Relations & Functions 5.1,5.2,5.6,7.1,7.3,7.4
Strings & Languages: 6.1, remember 6.2-6.3 talks about FSMs,
but I have dealt only with DFAโ€™s.
Since we have not had an exam with induction, number theory
and strings and languages, that will be the stress of the exam.
No need to memorize the logic or set laws โ€“ I will attach the
necessary tables.
pf3
pf4
pf5

Partial preview of the text

Download Topics in COT 3100: Logic, Sets, Relations, Functions, Number Theory, Strings, Languages - and more Study notes Computer Science in PDF only on Docsity!

COT 3100 Topics Covered Logic : Use of truth tables, logical connectives, implications, logic and implication laws, use of quantifiers Sets : Definition, Union, Intersection, Minus, Some Counting, Set Laws, Set Table, Venn Diagrams, Inclusion/Exclusion Principle Relations & Functions: Definition of a relation, reflexive, irreflexive, symmetric, anti-symmetric, transitive, injection, surjection, and bijection. Number Theory: Induction, Definition of divisibility, Use of mod and mod rules, Euclidโ€™s Algorithm Strings and Languages: Regular expressions, DFAs, languages are sets of strings. Relevant parts in the book: Logic 2.1 โ€“ 2. Sets 3.1- 3. Number Theory 4.1 โ€“ 4. Relations & Functions 5.1,5.2,5.6,7.1,7.3,7. Strings & Languages: 6.1, remember 6.2-6.3 talks about FSMs, but I have dealt only with DFAโ€™s. Since we have not had an exam with induction, number theory and strings and languages, that will be the stress of the exam. No need to memorize the logic or set laws โ€“ I will attach the necessary tables.

Logic problem Show that the following is a tautology: ( (p ๏ƒš r) ๏ƒš ( (q ๏ƒ™ r) ๏ƒš p) ) ๏ƒš ๏ƒ˜ ( (๏ƒ˜(p ๏ƒ™ q) ) ๏ƒ™ p ). ( (p ๏ƒš r) ๏ƒš ( (q ๏ƒ™ r) ๏ƒš p) ) ๏ƒš ๏ƒ˜ ( (๏ƒ˜(p ๏ƒ™ q) ) ๏ƒ™ p ) ๏ƒ› ( (p ๏ƒš r) ๏ƒš ( (q ๏ƒ™ r) ๏ƒš p) ) ๏ƒš ๏ƒ˜๏ƒ˜( p ๏ƒ™ q) ๏ƒš ๏ƒ˜p ๏ƒ› (De Morgans) ( (p ๏ƒš r) ๏ƒš ( (q ๏ƒ™ r) ๏ƒš p) ) ๏ƒš ( p ๏ƒ™ q) ๏ƒš ๏ƒ˜p ๏ƒ› (Double Negation) (๏ƒ˜p ๏ƒš p) ๏ƒš ( (p ๏ƒš r) ๏ƒš (q ๏ƒ™ r) ๏ƒš (p ๏ƒ™ q)) ๏ƒ› (Com/Assoc. over or) T ๏ƒš ( (p ๏ƒš r) ๏ƒš (q ๏ƒ™ r) ๏ƒš (p ๏ƒ™ q)) ๏ƒ› (Inverse Law) T ๏ƒ› (Domination Law) Set Problem Prove or disprove: ((A ๏ƒŒ C) ๏ƒ™ (B ๏ƒŒ C)) ๏ƒž ((A ๏ƒˆ B) โ€“ C = ๏ƒ†) PROVE if ((A ๏ƒŒ C) ๏ƒ™ (B ๏ƒŒ C)), that means we can assume if x๏ƒŽA, then x๏ƒŽC, and if x๏ƒŽB then x๏ƒŽC. Now, we need to show that ((A ๏ƒˆ B) โ€“ C = ๏ƒ†). Consider to the contrary that there is an element x๏ƒŽ(A ๏ƒˆ B) โ€“ C, That would mean by definition of set difference, that x๏ƒŽ A ๏ƒˆ B , but x๏ƒC.

g(a) = z g(b) = z g(f(1)) = z Here we have that g๏‚ฐf is not only injective, but also bijective. But, g is not injective since g(a)=g(b). Induction Problem

Show that for all n ๏‚ณ 0 and x > 2, ๏ƒฅ

๏€ฝ n i i x 0 < x n+ . Use induction on n. Base case: n=0. LHS = x 0 = 1, RHS = x. With given information we find LHS < RHS as desired. Inductive hypothesis: Assume for an arbitrary value of n=k

that, ๏ƒฅ

๏€ฝ k i i x 0 < x k+ . Inductive Step: Under this assumption we must prove our

formula for n=k+1. That is, we must show ๏ƒฅ

๏€ซ ๏€ฝ 1 0 k i i x (^) < x(k+1)+1.

๏€ซ ๏€ฝ 1 0 k i x i

๏€ฝ k i x^ i 0

  • x k+ < x k+
  • x k+ , by the inductive hypothesis. = 2x k+ <(x)x k+ , using given information about x. = x (k+1)+ , proving the inductive step.

Thus, we can conclude that ๏ƒฅ

๏€ฝ n i x^ i 0 < x n+ , for all n ๏‚ณ 0 and x > 2. Number Theory Problem

Given that 5 | (2x + 5y), where x and y are integers, show that 5 | x. Using our given information, we find that 2x + 5y = 5c, for some integer c. 2x = 5c โ€“ 5y x = 5(c โ€“ y)/ We are given that x is an integer. Thus, we must have that 2 | (5(c โ€“ y)). But if c โ€“ y is odd, this will be false. So, we must have that 2 | (c โ€“ y). In this case we can let c โ€“ y = 2d, for some integer d. Substituting, we have x = 5(2d)/ x = 5d, so we can conclude that 5 | x. String/Language problem Let T, W, and X be languages over the alphabet {a,b}. Show that if T ๏ƒŒ W, then (T ๏ƒ‡ X)* ๏ƒŒ (W ๏ƒ‡ T). First we will show that (T ๏ƒ‡ X) ๏ƒŒ (W ๏ƒ‡ T). Let y ๏ƒŽT ๏ƒ‡ X. We must show that y ๏ƒŽ W ๏ƒ‡ T. If we have that y ๏ƒŽT ๏ƒ‡ X, we can conclude that y ๏ƒŽT and y ๏ƒŽX. But we also know that T ๏ƒŒ W. Thus, given that y ๏ƒŽ T, we also know that y๏ƒŽW. Since both of these are true, we have y ๏ƒŽ W ๏ƒ‡ T, as desired. Now that we have established that (T ๏ƒ‡ X) ๏ƒŒ (W ๏ƒ‡ T), we can โ€œstarโ€ both sides to yield (T ๏ƒ‡ X) ๏ƒŒ (W ๏ƒ‡ T)*.