SlideShare una empresa de Scribd logo
1 de 47
Quick Overview
 Discrete Math is essentially that branch of
    mathematics that does not depend on
    limits; in this sense, it is the anti-
    thesis of Calculus. As computers are
    discrete object operating one jumpy,
    discontinuous step at a time, Discrete
    Math is the right framework for
    describing precisely Computer Science
    concepts.
Lecture 1                                 1
Quick Overview
 The conceptual center of computer
  science is the ALGORITHM.




Lecture 1                            2
Quick Overview
Discrete Math helps provide…
       …the  machinery necessary
       for creating sophisticated
       algorithms
       …the   tools for analyzing their
       efficiency
       …the means of proving their validity

Lecture 1                                     3
Quick Overview
 Although the point of 3203 is to provide
   the tools for creating and analyzing
   sophisticated algorithms, we won’t
   focus on the algorithmic aspect, with
   some exceptions. To see the
   algorithmic applications take almost any
   4000-level CS course or 3137/9 (Data
   Structures).

Lecture 1                                4
Quick Overview - Topics
            Logic and Sets
             Make notions you’re already used to from
              programming a little more rigorous (operators)
             Fundamental to all mathematical disciplines
             Useful for digital circuits, hardware design
            Elementary Number Theory
             Get to rediscover the old reliable number and
              find out some surprising facts
             Very useful in crypto-systems

Lecture 1                                                      5
Quick Overview - Topics
            Proofs (especially induction)
             If you want to debug a program beyond a
              doubt, prove that it’s bug-free
             Proof-theory has recently also been shown to be
              useful in discovering bugs in pre-production
              hardware
            Counting and Combinatorics
             Compute your odds of winning lottery
             Important for predicting how long certain
              computer program will take to finish
             Useful in designing algorithms
Lecture 1                                                  6
Quick Overview - Topics
            Graph Theory
             Many clever data-structures for organizing
              information and making programs highly
              efficient are based on graph theory
             Very useful in describing problems in
                Databases
                Operating Systems
                Networks
                EVERY CS DISCIPLINE!!!!



Lecture 1                                                  7
Section 1.1: Logic
 Axiomatic concepts in math:
  Equals
  Opposite
  Truth and falsehood
  Statement
  Objects
  Collections
Lecture 1                        8
Section 1.1: Logic
 We intuitively know that Truth and Falsehood
   are opposites. That statements describe the
   world and can be true/false. That the world
   is made up of objects and that objects can be
   organized to form collections.
 The foundations of logic mimic our intuitions by
   setting down constructs that behave
   analogously.


Lecture 1                                      9
False, True, Statements
 Axiom: False is the opposite to Truth.
 A statement is a description of something.
 Examples of statements:
           I’m 31 years old.
           I have 17 children.
           I always tell the truth.
           I’m lying to you.
 Q’s: Which statements are True? False? Both?
   Neither?

Lecture 1                                       10
False, True, Statements
 True: I’m 31 years old.
 False: I have 17 children.
        I always tell the truth.
 Both: IMPOSSIBLE, by our Axiom.




Lecture 1                             11
False, True, Statements
Neither: I’m lying to you. (If viewed on its own)
HUH? Well suppose that
              S = “I’m lying to you.”
were true. In particular, I am actually lying, so
  S is false. So it’s both true and false,
  impossible by the Axiom.
Okay, so I guess S must be false. But then I
  must not be lying to you. So the statement is
  true. Again it’s both true and false.
In both cases we get the opposite of our
  assumption, so S is neither true nor false.
Lecture 1                                       12
Propositions
To avoid painful head-aches, we ban such
 silly non-sense and avoid the most
 general type of statements limiting
 ourselves to statements with valid
 truth-values instead:
DEF: A proposition is a statement that
 is true or false.



Lecture 1                              13
Propositions
Propositional Logic is a static discipline of
   statements which lack semantic content.
E.G. p = “Clinton was the president.”
       q = “The list of U.S. presidents includes
                    Clinton.”
       r = “Lions like to sleep.”
All p and q are no more closely related than q
   and r are, in propositional calculus. They are
   both equally related as all three statements
   are true. Semantically, however, p and q are
   the same!
Lecture 1                                       14
Propositions
So why waste time on such matters?
Propositional logic is the study of how simple
  propositions can come together to make
  more complicated propositions. If the simple
  propositions were endowed with some
  meaning –and they will be very soon– then
  the complicated proposition would have
  meaning as well, and then finding out the
  truth value is actually important!


Lecture 1                                        15
Compound Propositions
 In Propositional Logic, we assume a
   collection of atomic propositions are
   given: p, q, r, s, t, ….
 Then we form compound propositions by
   using logical connectives (logical
   operators) to form propositional
   “molecules”.


Lecture 1                              16
Logical Connectives
Operator        Symbol Usage           Java
Negation                 not            !
Conjunction             and            &&
Disjunction              or            ||
Exclusive or             xor     (p||q)&&(!p||!q)

Conditional            if,then      p?q:true
Biconditional            iff     (p&&q)||(!p&&!q)

Lecture 1                                      17
Compound Propositions:
             Examples
 p = “Cruise ships only go on big rivers.”
 q = “Cruise ships go on the Hudson.”
 r = “The Hudson is a big river.”
     r = “The Hudson is not a big river.”
 p q = “Cruise ships only go on big rivers and
      go on the Hudson.”
 p q        r = “If cruise ships only go on big rivers
      and go on the Hudson, then the Hudson is a
      big river.”
Lecture 1                                           18
Negation
 This just turns a false proposition to true
   and the opposite for a true proposition.
 EG: p = “23 = 15 +7”
 p happens to be false, so p is true.
 In Java, “!” plays the same role:
              !(23 == 15+7)
 has the boolean value true whenever
   evaluated.
Lecture 1                                 19
Negation – truth table
 Logical operators are defined by truth
   tables –tables which give the output of
   the operator in the right-most column.
 Here is the truth table for negation:

                    p    p
                    F   T
                    T   F

Lecture 1                               20
Conjunction
 Conjunction is a binary operator in that it
  operates on two propositions when
  creating compound proposition. On the
  other hand, negation is a unary
  operator (the only non-trivial one
  possible).



Lecture 1                                 21
Conjunction
 Conjunction is supposed to encapsulate
  what happens when we use the word
  “and” in English. I.e., for “p and q ” to
  be true, it must be the case that BOTH
  p is true, as well as q. If one of these
  is false, than the compound statement
  is false as well.


Lecture 1                                22
Conjunction
 EG. p = “Clinton was the president.”
     q = “Monica was the president.”
     r = “The meaning of is is important.”
 Assuming p and r are true, while q false.
 Out of p q, p r, q r
                              only p r is true.
 Java: x==3 && x!=3
       Evaluates to false for any possible value of x.

Lecture 1                                                23
Conjunction – truth table

            p     q     p q
            T     T      T
            T     F      F
            F     T      F
            F     F      F



Lecture 1                          24
Disjunction – truth table
 Conversely, disjunction is true when at
  least one of the components is true:

                p      q     p q
                T      T      T
                T      F      T
                F      T      T
                F      F      F
Lecture 1                                  25
Disjunction – caveat
 Note: English version of disjunction “or”
  does not always satisfy the assumption
  that one of p/q being true implies that
  “p or q ” is true.
 Q: Can someone come up with an
  example?



Lecture 1                                26
Disjunction – caveat
 A: The entrée is served with
                             soup or salad.
 Most restaurants definitely don’t allow
   you to get both soup and salad so that
   the statement is false when both soup
   and salad is served. To address this
   situation, exclusive-or is introduced
   next.

Lecture 1                                 27
Exclusive-Or – truth table
            p       q       p       q
            T       T           F
            T       F           T
            F       T           T
            F       F           F

  Note: in this course any usage of “or”
  will connote the logical operator
  as opposed to the exclusive-or.
Lecture 1                                  28
Conditional (Implication)
 This one is probably the least intuitive.
   It’s only partly akin to the English usage
   of “if,then” or “implies”.
 DEF: p      q is true if q is true, or if p is
   false. In the final case (p is true while
   q is false) p    q is false.
 Semantics: “p implies q ” is true if one
   can mathematically derive q from p.

Lecture 1                                    29
Conditional -- truth table
            p      q     p       q
            T      T         T
            T      F         F
            F      T         T
            F      F         T




Lecture 1                            30
Conditional

Q: Does this makes sense? Let’s try
   examples for each row of truth table:
1. If pigs like mud then pigs like mud.
2. If pigs like mud then pigs can fly.
3. If pigs can fly then pigs like mud.
4. If pigs can fly then pigs can fly.


Lecture 1                                  31
Conditional
A:
1. If pigs like mud then pigs like mud.
     True: nothing about this statement is false.
2. If pigs like mud then pigs can fly.
     False: seems to assert falsehood
3. If pigs can fly then pigs like mud.
     True: argument for –only care about end-result.
        Argument against –counters common English
        hyperbole.
4. If pigs can fly then pigs can fly.
     True. WAIT! By first reasoning in 3, when “if” part
        is false, should only care about “then” part!!!!!
        On other hand, standard English hyperbole.
Lecture 1                                                   32
Conditional: why F F is True
 Remember, all of these are mathematical
   constructs, not attempts to mimic English.
   Mathematically, p should imply q whenever it
   is possible to derive q by from p by using
   valid arguments. For example consider the
   mathematical analog of no. 4:
                If 0 = 1 then 3 = 9.
 Q: Is this true mathematically?


Lecture 1                                    33
Conditional: why F F is True
 A: YES mathematically and YES by the
    truth table.
 Here’s a mathematical proof:
            1. 0 = 1 (assumption)




Lecture 1                               34
Conditional: why F F is True
 A: YES mathematically and YES by the
    truth table.
 Here’s a mathematical proof:
            1. 0 = 1 (assumption)
            2. 1 = 2 (added 1 to both sides)




Lecture 1                                      35
Conditional: why F F is True
 A: YES mathematically and YES by the
    truth table.
 Here’s a mathematical proof:
            1. 0 = 1 (assumption)
            2. 1 = 2 (added 1 to both sides)
            3. 3 = 6 (multiplied both sides by 3)




Lecture 1                                           36
Conditional: why F F is True
 A: YES mathematically and YES by the
    truth table.
 Here’s a mathematical proof:
            1. 0 = 1 (assumption)
            2. 1 = 2 (added 1 to both sides)
            3. 3 = 6 (multiplied both sides by 3)
            4. 0 = 3 (multiplied no. 1 by 3)



Lecture 1                                           37
Conditional: why F F is True
 A: YES mathematically and YES by the
    truth table.
 Here’s a mathematical proof:
            1. 0 = 1 (assumption)
            2. 1 = 2 (added 1 to both sides)
            3. 3 = 6 (multiplied both sides by 3)
            4. 0 = 3 (multiplied no. 1 by 3)
            5. 3 = 9 (added no. 3 and no. 4)        QED


Lecture 1                                                 38
Conditional: why F F is True
 As we want the conditional to make sense
    in the semantic context of
    mathematics, we better define it as
    we have!
 Other questionable rows of the truth table
    can also be justified in a similar
    manner.


Lecture 1                                39
Conditional: synonyms
There are many ways to express the conditional
   statement p   q:
     If p then q. p implies q. If p, q.
     p only if q. p is sufficient for q.
Some of the ways reverse the order of p and q
   but have the same connotation:
     q if p. q whenever p. q is necessary for p.
To aid in remembering these, I suggest
    inserting “is true” after every variable:
EG: “p is true only if q is true”

Lecture 1                                          40
Bi-Conditional -- truth table
 For p    q to be true, p and q must have
 the same truth value. Else, p   q is false:
            p        q       p       q
            T        T           T
            T        F           F
            F        T           F
            F        F           T
  Q : Which operator is    the opposite of?
Lecture 1                                      41
Bi-Conditional
A:          has exactly the opposite truth table
      as .
This means that we could have defined the
bi-conditional in terms of other previously
defined symbols, so it is redundant. In fact,
only really need negation and disjunction to
define everything else.
Extra operators are for convenience.
Q: Could we define all other logical operations
      using only negation and exclusive or?
Lecture 1                                          42
Bi-Conditional
 A: No. Notice that negation and
   exclusive-or each maintain parity
   between truth and false: No matter
   what combination of these symbols,
   impossible to get a truth table with four
   output rows consisting of 3 T’s and 1 F
   (such as implication and disjuction).


Lecture 1                                 43
Bit Strings
Electronic computers achieve their calculations
  inside semiconducting materials. For
  reliability, only two stable voltage states are
  used and so the most fundamental operations
  are carried out by switching voltages between
  these two stable states.
In logic, only two truth values are allowed.
  Thus propositional logic is ideal for modeling
  computers. High voltage values are modeled
  by True, which for brevity we call the number
  1, while low voltage values are modeled by
  False or 0.
Lecture 1                                      44
Bit Strings
 Thus voltage memory stored in a computer can
   be represented by a sequence of 0’s and 1’s
   such as
               01 1011 0010 1001
 Another portion of the memory might look like
               10 0010 1111 1001
 Each of the number in the sequence is called a
   bit, and the whole sequence of bits is called
   a bit string.

Lecture 1                                     45
Bit Strings
 It turns out that the analogs of the logical
    operations can be carried out quite easily
    inside the computer, one bit at a time. This
    can then be transferred to whole bit strings.
    For example, the exclusive-or of the previous
    bit strings is:
               01 1011 0010 1001
            10 0010 1111 1001
            11 1001 1101 0000

Lecture 1                                      46
Blackboard Exercises for 1.1
Worked out on the black-board.
1.1.6.c, 1.1.22.d, 1.1.39:
1. q = “You miss the final exam.”
      r = “You pass the course.”
      Express q  r in English.
2. Construct a truth table for p     q.
3. Can one determine relative salaries of F
       (Fannie), J (Janice) and M (Maggie) from
       the following?
     1.     If F is not highest paid, then J is.
     2.     If J is not lowest paid, then M is highest paid.
Lecture 1                                                      47

Más contenido relacionado

La actualidad más candente

Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2blaircomp2003
 
Unit I discrete mathematics lecture notes
Unit I  discrete mathematics lecture notesUnit I  discrete mathematics lecture notes
Unit I discrete mathematics lecture notesGIRIM8
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statementsguestd166eb5
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDr. Khaled Bakro
 
CPSC 125 Ch 1 sec 2
CPSC 125 Ch 1 sec 2CPSC 125 Ch 1 sec 2
CPSC 125 Ch 1 sec 2David Wood
 
#3 formal methods – propositional logic
#3 formal methods – propositional logic#3 formal methods – propositional logic
#3 formal methods – propositional logicSharif Omar Salem
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculusRajendran
 
Logic
LogicLogic
LogicH K
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicUniversity of Potsdam
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicManjula V
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 

La actualidad más candente (18)

Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2
 
The logic
The logicThe logic
The logic
 
Unit I discrete mathematics lecture notes
Unit I  discrete mathematics lecture notesUnit I  discrete mathematics lecture notes
Unit I discrete mathematics lecture notes
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statements
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
CPSC 125 Ch 1 sec 2
CPSC 125 Ch 1 sec 2CPSC 125 Ch 1 sec 2
CPSC 125 Ch 1 sec 2
 
#3 formal methods – propositional logic
#3 formal methods – propositional logic#3 formal methods – propositional logic
#3 formal methods – propositional logic
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Logic
LogicLogic
Logic
 
Logic
LogicLogic
Logic
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional Logic
 
3 fol examples v2
3 fol examples v23 fol examples v2
3 fol examples v2
 
Per3 logika&pembuktian
Per3 logika&pembuktianPer3 logika&pembuktian
Per3 logika&pembuktian
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 

Similar a Quick overview of discrete math topics

S2 1
S2 1S2 1
S2 1IIUM
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptNandiniSR2
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicTaymoor Nazmy
 
desmath(1).ppt
desmath(1).pptdesmath(1).ppt
desmath(1).pptMemMem25
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Sabu Francis
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdfsmarwaneid
 
Notes discrete math
Notes discrete mathNotes discrete math
Notes discrete mathliyana31
 
Lecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematicsLecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematicssaiful26baiust
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptxRavind8
 
Contradiction
ContradictionContradiction
ContradictionUsman Rj
 
Contradiction
ContradictionContradiction
ContradictionUsman Rj
 

Similar a Quick overview of discrete math topics (20)

S2 1
S2 1S2 1
S2 1
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 
Logic
LogicLogic
Logic
 
desmath(1).ppt
desmath(1).pptdesmath(1).ppt
desmath(1).ppt
 
Logic
LogicLogic
Logic
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
 
AppTheories_L3
AppTheories_L3AppTheories_L3
AppTheories_L3
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
 
Notes discrete math
Notes discrete mathNotes discrete math
Notes discrete math
 
Lecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematicsLecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematics
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
 
Lecture 01.ppt
Lecture 01.pptLecture 01.ppt
Lecture 01.ppt
 
CSE680-17NP-Complete.pptx
CSE680-17NP-Complete.pptxCSE680-17NP-Complete.pptx
CSE680-17NP-Complete.pptx
 
Contradiction
ContradictionContradiction
Contradiction
 
Contradiction
ContradictionContradiction
Contradiction
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
4535092.ppt
4535092.ppt4535092.ppt
4535092.ppt
 
Course notes1
Course notes1Course notes1
Course notes1
 

Último

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Último (20)

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Quick overview of discrete math topics

  • 1. Quick Overview Discrete Math is essentially that branch of mathematics that does not depend on limits; in this sense, it is the anti- thesis of Calculus. As computers are discrete object operating one jumpy, discontinuous step at a time, Discrete Math is the right framework for describing precisely Computer Science concepts. Lecture 1 1
  • 2. Quick Overview The conceptual center of computer science is the ALGORITHM. Lecture 1 2
  • 3. Quick Overview Discrete Math helps provide… …the machinery necessary for creating sophisticated algorithms …the tools for analyzing their efficiency …the means of proving their validity Lecture 1 3
  • 4. Quick Overview Although the point of 3203 is to provide the tools for creating and analyzing sophisticated algorithms, we won’t focus on the algorithmic aspect, with some exceptions. To see the algorithmic applications take almost any 4000-level CS course or 3137/9 (Data Structures). Lecture 1 4
  • 5. Quick Overview - Topics Logic and Sets  Make notions you’re already used to from programming a little more rigorous (operators)  Fundamental to all mathematical disciplines  Useful for digital circuits, hardware design Elementary Number Theory  Get to rediscover the old reliable number and find out some surprising facts  Very useful in crypto-systems Lecture 1 5
  • 6. Quick Overview - Topics Proofs (especially induction)  If you want to debug a program beyond a doubt, prove that it’s bug-free  Proof-theory has recently also been shown to be useful in discovering bugs in pre-production hardware Counting and Combinatorics  Compute your odds of winning lottery  Important for predicting how long certain computer program will take to finish  Useful in designing algorithms Lecture 1 6
  • 7. Quick Overview - Topics Graph Theory  Many clever data-structures for organizing information and making programs highly efficient are based on graph theory  Very useful in describing problems in  Databases  Operating Systems  Networks  EVERY CS DISCIPLINE!!!! Lecture 1 7
  • 8. Section 1.1: Logic Axiomatic concepts in math: Equals Opposite Truth and falsehood Statement Objects Collections Lecture 1 8
  • 9. Section 1.1: Logic We intuitively know that Truth and Falsehood are opposites. That statements describe the world and can be true/false. That the world is made up of objects and that objects can be organized to form collections. The foundations of logic mimic our intuitions by setting down constructs that behave analogously. Lecture 1 9
  • 10. False, True, Statements Axiom: False is the opposite to Truth. A statement is a description of something. Examples of statements:  I’m 31 years old.  I have 17 children.  I always tell the truth.  I’m lying to you. Q’s: Which statements are True? False? Both? Neither? Lecture 1 10
  • 11. False, True, Statements True: I’m 31 years old. False: I have 17 children. I always tell the truth. Both: IMPOSSIBLE, by our Axiom. Lecture 1 11
  • 12. False, True, Statements Neither: I’m lying to you. (If viewed on its own) HUH? Well suppose that S = “I’m lying to you.” were true. In particular, I am actually lying, so S is false. So it’s both true and false, impossible by the Axiom. Okay, so I guess S must be false. But then I must not be lying to you. So the statement is true. Again it’s both true and false. In both cases we get the opposite of our assumption, so S is neither true nor false. Lecture 1 12
  • 13. Propositions To avoid painful head-aches, we ban such silly non-sense and avoid the most general type of statements limiting ourselves to statements with valid truth-values instead: DEF: A proposition is a statement that is true or false. Lecture 1 13
  • 14. Propositions Propositional Logic is a static discipline of statements which lack semantic content. E.G. p = “Clinton was the president.” q = “The list of U.S. presidents includes Clinton.” r = “Lions like to sleep.” All p and q are no more closely related than q and r are, in propositional calculus. They are both equally related as all three statements are true. Semantically, however, p and q are the same! Lecture 1 14
  • 15. Propositions So why waste time on such matters? Propositional logic is the study of how simple propositions can come together to make more complicated propositions. If the simple propositions were endowed with some meaning –and they will be very soon– then the complicated proposition would have meaning as well, and then finding out the truth value is actually important! Lecture 1 15
  • 16. Compound Propositions In Propositional Logic, we assume a collection of atomic propositions are given: p, q, r, s, t, …. Then we form compound propositions by using logical connectives (logical operators) to form propositional “molecules”. Lecture 1 16
  • 17. Logical Connectives Operator Symbol Usage Java Negation not ! Conjunction and && Disjunction or || Exclusive or xor (p||q)&&(!p||!q) Conditional if,then p?q:true Biconditional iff (p&&q)||(!p&&!q) Lecture 1 17
  • 18. Compound Propositions: Examples p = “Cruise ships only go on big rivers.” q = “Cruise ships go on the Hudson.” r = “The Hudson is a big river.” r = “The Hudson is not a big river.” p q = “Cruise ships only go on big rivers and go on the Hudson.” p q r = “If cruise ships only go on big rivers and go on the Hudson, then the Hudson is a big river.” Lecture 1 18
  • 19. Negation This just turns a false proposition to true and the opposite for a true proposition. EG: p = “23 = 15 +7” p happens to be false, so p is true. In Java, “!” plays the same role: !(23 == 15+7) has the boolean value true whenever evaluated. Lecture 1 19
  • 20. Negation – truth table Logical operators are defined by truth tables –tables which give the output of the operator in the right-most column. Here is the truth table for negation: p p F T T F Lecture 1 20
  • 21. Conjunction Conjunction is a binary operator in that it operates on two propositions when creating compound proposition. On the other hand, negation is a unary operator (the only non-trivial one possible). Lecture 1 21
  • 22. Conjunction Conjunction is supposed to encapsulate what happens when we use the word “and” in English. I.e., for “p and q ” to be true, it must be the case that BOTH p is true, as well as q. If one of these is false, than the compound statement is false as well. Lecture 1 22
  • 23. Conjunction EG. p = “Clinton was the president.” q = “Monica was the president.” r = “The meaning of is is important.” Assuming p and r are true, while q false. Out of p q, p r, q r only p r is true. Java: x==3 && x!=3 Evaluates to false for any possible value of x. Lecture 1 23
  • 24. Conjunction – truth table p q p q T T T T F F F T F F F F Lecture 1 24
  • 25. Disjunction – truth table Conversely, disjunction is true when at least one of the components is true: p q p q T T T T F T F T T F F F Lecture 1 25
  • 26. Disjunction – caveat Note: English version of disjunction “or” does not always satisfy the assumption that one of p/q being true implies that “p or q ” is true. Q: Can someone come up with an example? Lecture 1 26
  • 27. Disjunction – caveat A: The entrée is served with soup or salad. Most restaurants definitely don’t allow you to get both soup and salad so that the statement is false when both soup and salad is served. To address this situation, exclusive-or is introduced next. Lecture 1 27
  • 28. Exclusive-Or – truth table p q p q T T F T F T F T T F F F Note: in this course any usage of “or” will connote the logical operator as opposed to the exclusive-or. Lecture 1 28
  • 29. Conditional (Implication) This one is probably the least intuitive. It’s only partly akin to the English usage of “if,then” or “implies”. DEF: p q is true if q is true, or if p is false. In the final case (p is true while q is false) p q is false. Semantics: “p implies q ” is true if one can mathematically derive q from p. Lecture 1 29
  • 30. Conditional -- truth table p q p q T T T T F F F T T F F T Lecture 1 30
  • 31. Conditional Q: Does this makes sense? Let’s try examples for each row of truth table: 1. If pigs like mud then pigs like mud. 2. If pigs like mud then pigs can fly. 3. If pigs can fly then pigs like mud. 4. If pigs can fly then pigs can fly. Lecture 1 31
  • 32. Conditional A: 1. If pigs like mud then pigs like mud. True: nothing about this statement is false. 2. If pigs like mud then pigs can fly. False: seems to assert falsehood 3. If pigs can fly then pigs like mud. True: argument for –only care about end-result. Argument against –counters common English hyperbole. 4. If pigs can fly then pigs can fly. True. WAIT! By first reasoning in 3, when “if” part is false, should only care about “then” part!!!!! On other hand, standard English hyperbole. Lecture 1 32
  • 33. Conditional: why F F is True Remember, all of these are mathematical constructs, not attempts to mimic English. Mathematically, p should imply q whenever it is possible to derive q by from p by using valid arguments. For example consider the mathematical analog of no. 4: If 0 = 1 then 3 = 9. Q: Is this true mathematically? Lecture 1 33
  • 34. Conditional: why F F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) Lecture 1 34
  • 35. Conditional: why F F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) Lecture 1 35
  • 36. Conditional: why F F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) 3. 3 = 6 (multiplied both sides by 3) Lecture 1 36
  • 37. Conditional: why F F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) 3. 3 = 6 (multiplied both sides by 3) 4. 0 = 3 (multiplied no. 1 by 3) Lecture 1 37
  • 38. Conditional: why F F is True A: YES mathematically and YES by the truth table. Here’s a mathematical proof: 1. 0 = 1 (assumption) 2. 1 = 2 (added 1 to both sides) 3. 3 = 6 (multiplied both sides by 3) 4. 0 = 3 (multiplied no. 1 by 3) 5. 3 = 9 (added no. 3 and no. 4) QED Lecture 1 38
  • 39. Conditional: why F F is True As we want the conditional to make sense in the semantic context of mathematics, we better define it as we have! Other questionable rows of the truth table can also be justified in a similar manner. Lecture 1 39
  • 40. Conditional: synonyms There are many ways to express the conditional statement p q: If p then q. p implies q. If p, q. p only if q. p is sufficient for q. Some of the ways reverse the order of p and q but have the same connotation: q if p. q whenever p. q is necessary for p. To aid in remembering these, I suggest inserting “is true” after every variable: EG: “p is true only if q is true” Lecture 1 40
  • 41. Bi-Conditional -- truth table For p q to be true, p and q must have the same truth value. Else, p q is false: p q p q T T T T F F F T F F F T Q : Which operator is the opposite of? Lecture 1 41
  • 42. Bi-Conditional A: has exactly the opposite truth table as . This means that we could have defined the bi-conditional in terms of other previously defined symbols, so it is redundant. In fact, only really need negation and disjunction to define everything else. Extra operators are for convenience. Q: Could we define all other logical operations using only negation and exclusive or? Lecture 1 42
  • 43. Bi-Conditional A: No. Notice that negation and exclusive-or each maintain parity between truth and false: No matter what combination of these symbols, impossible to get a truth table with four output rows consisting of 3 T’s and 1 F (such as implication and disjuction). Lecture 1 43
  • 44. Bit Strings Electronic computers achieve their calculations inside semiconducting materials. For reliability, only two stable voltage states are used and so the most fundamental operations are carried out by switching voltages between these two stable states. In logic, only two truth values are allowed. Thus propositional logic is ideal for modeling computers. High voltage values are modeled by True, which for brevity we call the number 1, while low voltage values are modeled by False or 0. Lecture 1 44
  • 45. Bit Strings Thus voltage memory stored in a computer can be represented by a sequence of 0’s and 1’s such as 01 1011 0010 1001 Another portion of the memory might look like 10 0010 1111 1001 Each of the number in the sequence is called a bit, and the whole sequence of bits is called a bit string. Lecture 1 45
  • 46. Bit Strings It turns out that the analogs of the logical operations can be carried out quite easily inside the computer, one bit at a time. This can then be transferred to whole bit strings. For example, the exclusive-or of the previous bit strings is: 01 1011 0010 1001 10 0010 1111 1001 11 1001 1101 0000 Lecture 1 46
  • 47. Blackboard Exercises for 1.1 Worked out on the black-board. 1.1.6.c, 1.1.22.d, 1.1.39: 1. q = “You miss the final exam.” r = “You pass the course.” Express q  r in English. 2. Construct a truth table for p q. 3. Can one determine relative salaries of F (Fannie), J (Janice) and M (Maggie) from the following? 1. If F is not highest paid, then J is. 2. If J is not lowest paid, then M is highest paid. Lecture 1 47