Shawn Zhong

Shawn Zhong

钟万祥
  • Tutorials
  • Mathematics
    • Math 240
    • Math 375
    • Math 431
    • Math 514
    • Math 521
    • Math 541
    • Math 632
    • Abstract Algebra
    • Linear Algebra
    • Category Theory
  • Computer Sciences
    • CS/ECE 252
    • CS/ECE 352
    • Learn Haskell
  • AP Notes
    • AP Microecon
    • AP Macroecon
    • AP Statistics
    • AP Chemistry
    • AP Physics E&M
    • AP Physics Mech
    • CLEP Psycho

Shawn Zhong

钟万祥
  • Tutorials
  • Mathematics
    • Math 240
    • Math 375
    • Math 431
    • Math 514
    • Math 521
    • Math 541
    • Math 632
    • Abstract Algebra
    • Linear Algebra
    • Category Theory
  • Computer Sciences
    • CS/ECE 252
    • CS/ECE 352
    • Learn Haskell
  • AP Notes
    • AP Microecon
    • AP Macroecon
    • AP Statistics
    • AP Chemistry
    • AP Physics E&M
    • AP Physics Mech
    • CLEP Psycho

Mathematics

Home / Notes / Mathematics / Page 34

1.2 Applications of Propositional Logic

  • Jan 30, 2018
  • Shawn
  • Math 240
  • No comments yet
Translating English Sentences • Steps to convert an English sentence to a statement in propositional logic ○ Identify atomic propositions and represent using propositional variables. ○ Determine appropriate logical connectives • Example: “If I go to Harry’s or to the country, I will not go shopping.” ○ p: "I go to Harry’s." ○ q: "I go to the country." ○ r: "I will go shopping." ○ p∨q→¬r • Example: “You can get an extra piece of pie if you have completed your homework or if you are extremely hungry” ○ p: You have completed your homework ○ q: You are extremely hungry ○ r: You can get an extra piece of pie ○ p∨q→r System Specifications • System and Software engineers take requirements in English and express them in a precise specification language based on logic. • Example: “The automated reply cannot be sent when the file system is full” ○ p: “The automated reply can be sent” ○ q: “The file system is full.” ○ q→¬ p Logic Puzzles • An island has two kinds of inhabitants, knights, who always tell the truth, and knaves, who always lie. • You go to the island and meet A and B. ○ A says “B is a knight.” ○ B says “The two of us are of opposite types.” • What are the types of A and B? ○ Let p and q be the statements that A is a knight and B is a knight, respectively. ○ So, then Øp represents the proposition that A is a knave and Øq that B is a knave. ○ If A is a knight, then p is true. Since knights tell the truth, q must also be true. Then (p ∧Øq)∨(Øp∧q) would have to be true, but it is not. So, A is not a knight and therefore Øp must be true. ○ If A is a knave, then B must not be a knight since knaves always lie. So, then both Øp and Øq hold since both are knaves. Logic Circuits • Electronic circuits; each input/output signal can be viewed as a 0 or 1. ○ 0 represents False ○ 1 represents True • Complicated circuits are constructed from three basic circuits called gates. ○ The inverter (NOT gate) takes an input bit and produces the negation of that bit. ○ The OR gate takes two input bits and produces the value equivalent to the disjunction of the two bits. ○ The AND gate takes two input bits and produces the value equivalent to the conjunction of the two bits. • More complicated digital circuits can be constructed by combining these basic circuits to produce the desired output given the input signals by building a circuit for each piece of the output expression and then combining them.
Read More >>

1.1 Propositional Logic

  • Jan 30, 2018
  • Shawn
  • Math 240
  • No comments yet
Propositions • Definition ○ A proposition is a declarative sentence that is either true or false. • Examples of propositions ○ The Moon is made of green cheese. ○ Paris is the capital of Europe. ○ Toronto is the capital of Canada. ○ 1 + 0 = 1 ○ 0 + 0 = 2 • Examples that are not propositions ○ Sit down! ○ What time is it? ○ x+1=2 ○ x+y=z Constructing Propositions • Propositional Variables: p, q, r, s, … • The proposition that is always true is denoted by T • The proposition that is always false is denoted by F. Compound Propositions • Definition ○ Propositions constructed from logical connectives and other propositions • Negation ¬ ○ The negation of a proposition p is denoted by ¬p ○ Truth table p ¬p T F F T ○ Example § If p denotes “The earth is round.” § Then ¬p denotes “It is not the case that the earth is round,” § Or more simply “The earth is not round.” • Conjunction ∧ ○ The conjunction of propositions p and q is denoted by p∧q ○ Truth Table p q p∧q T T T T F F F T F F F F ○ Example § If p denotes “I am at home.” and q denotes “It is raining.” § Then p∧q denotes “I am at home and it is raining.” • Disjunction ∨ ○ The disjunction of propositions p and q is denoted by p∨q ○ Truth Table p q p∨q T T T T F T F T T F F F ○ Example § If p denotes “I am at home.” and q denotes “It is raining.” § Then p∨q denotes “I am at home or it is raining.” • Inclusive Or vs Exclusive Or ○ “Inclusive Or” § In the sentence “Students who have taken CS202 or Math120 may take this class,” we assume that students need to have taken one of the prerequisites, but may have taken both. § This is the meaning of disjunction. § For p ∨ q to be true, either one or both of p and q must be true. ○ “Exclusive Or” § When reading the sentence “Soup or salad comes with this entrée,” we do not expect to be able to get both soup and salad. § This is the meaning of Exclusive Or (XOR). § In p⊕q , one of p and q must be true, but not both. § The truth table for ⊕ is: p q p⊕q T T F T F T F T T F F F • Implication → ○ If p and q are propositions, then p→q is a conditional statement or implication which is read as “if p, then q ” ○ Truth Table p q p→q T T T T F F F T T F F T ○ Example § If p denotes “I am at home.” and q denotes “It is raining.” § Then p→q denotes “If I am at home then it is raining.” ○ In p→q, p is the hypothesis (antecedent or premise) and q is the conclusion (or consequence). • Biconditional ↔ ○ If p and q are propositions, then we can form the biconditional proposition p↔q , read as “p if and only if q.” ○ Truth Table p q p↔q T T T T F F F T F F F T ○ If p denotes “I am at home.” and q denotes “It is raining.” then p↔q denotes “I am at home if and only if it is raining.” • Example p q (¬p)∧(¬q) (¬p)∨(¬q) T T F F T F F T F T F T F F T T Converse, Contrapositive, and Inverse • From p→q we can form new conditional statements . ○ q→p is the converse of p→q ○ ¬q→¬p is the contrapositive of p→q ○ ¬p→¬q is the inverse of p→q • Example ○ "If it is raining, then I will not go to town." ○ p: "It is raining" ○ q: "I am going to town" ○ Sufficient Condition § It raining is a sufficient condition for my not going to town. ○ Necessary Condition § My not going to town is a necessary condition for it raining. ○ Converse § If I do not go to town, then it is raining. ○ Inverse § If it is not raining, then I will go to town. ○ Contrapositive § If I go to town, then it is not raining. • Truth Table p q p→q q→p ¬q→¬p ¬p→¬q ¬(p→q) T T T T T T F T F F T F T T F T T F T F F F F T T T T F Truth Table for Compound Propositions • Construction of a truth table: ○ Rows § Need a row for every possible combination of values for the atomic propositions. ○ Columns § Need a column for the compound proposition (usually at far right) § Need a column for the truth value of each expression that occurs in the compound proposition as it is built up. § This includes the atomic propositions • Precedence of Logical Operators Operator Precedence ¬ 1 ∧ 2 ∨ 3 → 4 ↔ 5 • Example: p∨q→¬r p q r p∨q ¬r p∨q→¬r T T T T F F T F T T F F F T T T F F F F T F F T T T F T T T T F F T T T F T F T T T F F F F T T
Read More >>

0. Introductory Lecture

  • Jan 30, 2018
  • Shawn
  • Math 240
  • No comments yet
What is Discrete Mathematics? • Study of discrete (as opposed to continuous) objects • Calculus is continuous • Example of discrete objects ○ Integers ○ Steps taken by a computer program ○ Distinct paths to travel from point A to point B on a map along a road network ○ Ways to pick a wining set of numbers in a lottery Kinds of Problems Solved Using Discrete Mathematics • Number of valid passwords • Number of valid websites • Probability of winning a lottery • Link between two computers in a network • Identify spam e-mails • Shortest path • Prove there are infinitely many prime numbers • Numbers of steps need to do a sorting • Prove the correctness of algorithms Goals of a Course in Discrete Mathematics • Mathematical Reasoning • Combinatorial Analysis • Discrete Structures
Read More >>

Math 541 – 1/29

  • Jan 30, 2018
  • Shawn
  • Math 541
  • No comments yet
Proposition 2: The Division Algorithm • Statement ○ Let a,b∈Z, where b 0 ○ Then ∃!q,r∈Z s.t. a=qb+r, and 0≤r b • Proof (Existence) ○ Let S≔{a−bq│q∈Za−bq≥0}⊆Z(≥0) ○ S is not empty § Let q∈Z s.t. q≤a/b § Then bq≤a § ⇒0≤a−bq § i.e. a−bq∈S ○ Thus S contains a unique minumum elemtent: call it r ○ Choose q∈Z s.t. § a−bq=r § ⇒a=bq+r ○ We still need to show 0≤r b § We know 0≤r, since r∈S, so we just need to show r b § If r≥b, then a−b(q+1)=a−bq−b=r−b≥0 § But a−b(q+1)∈S, and it is less than r § This is impossible, since r is minimum element of S § Thus, r b ○ Therefore we ve proven the existence of q and r • Proof (Uniqueness) ○ Suppose ∃q,q^′,r,r^′∈Z s.t. § a=bq+r, where 0≤r b § a=bq^′+r^′, where 0≤r^′ b ○ We must show q=q′ and r=r^′ ○ Suppose r≠r^′ § Without loss of generality, assume r^′ r § Then 0 r^′−r=(a−bq^′ )−(a−bq)=b(q−q^′ ) § Thus, ├ b┤|├ (r^′−r)┤, but 0 r^′−r≤r^′ b. § This is impossible, thus r=r^′ ○ We have bq+r=bq^′+r⇒q=q^′ ○ Therefore we ve proven the uniqueness of q and r • Note we can prove the following stronger statement ○ If a,b∈Z, and b≠0, then ∃!q,r∈Z ○ s.t. a=bq+r, and 0≤r |b| • Proof (Existence) ○ Assume b 0 ○ Choose q,r∈Z s.t. a=(−b)q+r, and 0≤r −b ○ Then a=b(−q)+r, and 0≤r |b| ○ This proves existence • Proof (Uniqueness) ○ Assume b 0 ○ Suppose ∃q,q^′,r,r^′∈Z s.t. § a=bq+r, where 0≤r b § a=bq^′+r^′, where 0≤r^′ b ○ Then § a=(−b)(−q)+r, where 0≤r |b|=−b § a=(−b)(−q′)+r^′, where 0≤r^′ |b|=−b ○ Since −b 0, our previous result implies −q=−q^′ ○ ⇒q=q′ and r=r^′ Greatest Common Divisor • If a,b∈Z, where either a≠0 or b≠0 • A greatest common divisor of a and b is a positive integer d s.t. ○ d|a and d|b ○ If e∈Z s.t. e|a and e|b then e|d • We write the g.c.d. of a and b, if it exists, as (a,b) • As a convention (0,0)≔0 Proposition 3: Uniqueness of Greatest Common Divisor • Statement ○ Let a,b∈Z, where either a≠0 or b≠0 ○ Suppose ∃d,d^′∈Z( 0) s.t. (1) d and d′ both divide a and b (2) If e∈Z s.t. e|a and e|b, then e|d and e|d^′ ○ Then d=d^′ • Proof ○ Combining properties (1) and (2), we have d|d′ and d^′ |d ○ Choose q,q^′∈Z s.t. dq=d′ and d^′ q^′=d ○ By substitution, we get dqq^′=d ○ Then qq^′=1⇒q=q^′=±1 ○ If q=q^′=−1, then d=−d^′ 0. ○ This is impossible since d and d′ are both positive ○ Therefore q=q^′=1 and d=d^′ Proposition 4 • Statement ○ Suppose a,b∈Z, where b≠0 ○ Choose q,r∈Z s.t. a=qb+r, and 0≤r |b| ○ If (b,r) exists, then (a,b) exists and (a,b)=(b,r) • Proof ○ Set d≔(b,r) ○ d|a and d|b § Choose q_1,q_2∈Z s.t. dq_1=b and dq_2=r § Then a=qb+r=qq_1 d+q_2 d=d(qq_1+q_2 ), so d|a § And we already know d|b ○ If e∈Z s.t. e|a and e|b, then e|d § Let e∈Z s.t. e|a and e|b § Choose q_3,q_4∈Z s.t. eq_3=a and eq_4=b § a=qb+r § ⇒a−qb=r § ⇒eq_3−qeq_4=r § ⇒e(q_3−qq_4 )=r § Thus e|r § Since e|b and d=(b,r) § We can conclude that e|d ○ By Proposition 3, (a,b)=(b,r) Proposition 5 • Statement ○ (a,0)=|a|,∀a∈Z • Proof ○ If a=0 § This is true by our convention ○ If a≠0 § Certainly ├ |a|┤|├ a┤, and ├ |a|┤|├ 0┤ § If e∈Z s.t. e|a and ├ e┤|├ 0┤, then ├ e┤|├ |a|┤ § Therefore (a,0)=|a|
Read More >>

Math 541 – 1/26

  • Jan 30, 2018
  • Shawn
  • Math 541
  • No comments yet
Induction • Prove that ∑_(i=1)^n▒i=n(n+1)/2, ∀n≥1 • Base case, n=1 ○ ∑_(i=1)^i▒i=1=(1×2)/2 • Induction step ○ For n 1 ○ Assume ∀k s.t. 1≤kn, ∑_(i=1)^k▒i=k(k+1)/2 ○ Then∑_(i=1)^n▒i=(∑_(i=1)^(n−1)▒i)+n=(n−1)(n)/2+n=n(n+1)/2 Proposition 1: Well-ordering of Z • Statement ○ Every nonempty set S of Z(≥0) has a unique minimum element ○ That is, ∃!m∈S s.t. m≤s, ∀s∈S • Proof (Existence) ○ Assume S is finite § We will argue by induction on |S| § Base case: |S|=1 □ This is clear § Assume |S| 1 □ Choose x∈S, then |S∖{x}|=|S|−1 □ By induction S∖\{x} has a minimum value: call it m □ Case 1: xm, then x is a minimum value of S □ Case 2: mx, then m is a minimum value of S ○ Now we prove the general case § Choose x∈S § Let S^′≔{s∈S│s≤x} § Then |S^′ |≤x+1∞ § Choose a minimum element of S: call it m § Let s∈S □ If s∈S^′, then m≤s □ If s∉S′, then m≤xs § In either case, m≤s, so m is a minimum element of S ○ This proves existence • Proof (Uniqueness) ○ Suppose m and m′ are both minimum elements of S ○ m≤m′, and m^′≤m ○ Thus, m=m^′ ○ This proves uniqueness Proposition 2: The Division Algorithm • Statement ○ Let a,b∈Z, where b 0 ○ Then ∃!q,r∈Z s.t. a=qb+r, and 0≤rb • Proof (Existence) ○ Let S≔{a−bq│q∈Za−bq≥0}⊆Z(≥0) ○ S is not empty § Let q∈Z s.t. q≤a/b § Then bq≤a § ⇒0≤a−bq § i.e. a−bq∈S ○ Thus S contains a unique minumum elemtent: call it r ○ Choose q∈Z s.t. § a−bq=r § ⇒a=bq+r ○ We still need to show 0≤rb § We know 0≤r, since r∈S, so we just need to show rb § If r≥b, then a−b(q+1)=a−bq−b=r−b≥0 § But a−b(q+1)∈S, and it is less than r § This is impossible, since r is minimum element of S § Thus, rb ○ Therefore we ve proven the existence of q and r
Read More >>
  • 1
  • …
  • 32
  • 33
  • 34
  • 35
  • 36
  • …
  • 60

Search

  • Home Page
  • Tutorials
  • Mathematics
    • Math 240 – Discrete Math
    • Math 375 – Linear Algebra
    • Math 431 – Intro to Probability
    • Math 514 – Numerical Analysis
    • Math 521 – Analysis I
    • Math 541 – Abstract Algebra
    • Math 632 – Stochastic Processes
    • Abstract Algebra @ 万门大学
    • Linear Algebra @ 万门大学
    • Category Theory
  • Computer Sciences
    • CS/ECE 252 – Intro to Computer Engr.
    • CS/ECE 352 – Digital System Fund.
    • Learn Haskell
  • Course Notes
    • AP Macroeconomics
    • AP Microeconomics
    • AP Chemistry
    • AP Statistics
    • AP Physics C: E&M
    • AP Physics C: Mechanics
    • CLEP Psychology
  • 2048 Game
  • HiMCM 2016
  • 登峰杯 MCM

WeChat Account

Categories

  • Notes (418)
    • AP (115)
      • AP Macroeconomics (20)
      • AP Microeconomics (23)
      • AP Physics C E&M (25)
      • AP Physics C Mechanics (28)
      • AP Statistics (19)
    • Computer Sciences (2)
    • Mathematics (300)
      • Abstract Algebra (29)
      • Category Theory (7)
      • Linear Algebra (29)
      • Math 240 (42)
      • Math 375 (71)
      • Math 514 (18)
      • Math 521 (39)
      • Math 541 (39)
      • Math 632 (26)
  • Projects (2)
  • Tutorials (11)

Archives

  • October 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017

WeChat Account

Links

RobeZH's thoughts on Algorithms - Ziyi Zhang
Copyright © 2018.      
TOP