0% found this document useful (0 votes)
17 views7 pages

Mod1-DM

Discrete Math

Uploaded by

Jelle Fuerte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Mod1-DM

Discrete Math

Uploaded by

Jelle Fuerte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
What does Discrete mean? The standard dtinton “separate andasencr”. The . ‘oppesite woukd be “continuous”. Discrete things can Bender's often be characterized by integers, whereas continuous COMPUTER things generally require the real numbers. DATING What is Discrete Mathematics? Service DISCREET AND Dis There are numerous branches of mathematics. In general, you want to use the type that fits your task. If you are modeling a cannonbal’s fight, that might be ° calculus. if you are modeling vision, that might be linear algebra. What mathematics should a €5/CE know and use? Well, igure Bonde neing us remember Dieret = much of what we do involves discrete numbers. Infact {as computers slowly take over the world, things that were formally continuous are now discrete, Discrete Records > CDs/MP35; _fllm > digital photos; VHS > DVDs. Computation and a discrete worldview go hand-in-hand. Computer data is discrete (all stored as bits no matter what the datais). Time on a computer occurs in discrete steps (clock ticks), etc. Because we work almost solely with discrete values, it makes since that we'd need to know discrete mathematics. Discrete mathematics is actually @ collection ofa large number of different types of mathematics all used when working with discrete data. Some things we are going to cover in this class include: * Logic (propositional logic, precicate logic, quantified formulae, logical deductions) ‘Architecture (logic gates) € My area! ‘Software engineering (specification and verification) Programming languages (semantics, logic programming) Databases (relational algebra anc SQL) ‘Actificial intelligence (autornatic theorem proving) ‘Algorithms (complexity and expressiveness) ‘Theory of computation (general notions of computability) ‘© Proofs (inclucing the analysis of algorithms) ©. Software engineering (verification of correctness) © Algorithm analysis (showing a task will complete within some time bound (“on time”)) © Parallel systems (provinga protocol will function correctly in all cases) ‘+ Asymptotic notation (“Big Oh” and its friends) © Algorithm design and choice (allows us to reasonable compare algorithms rather than implementations} Counting and discrete probability © Architecture (how caches behave, how branch predictors behave) €Still my areal © Modeling feilure in software and hardware 0000000 Propositions (1.1) \We «pend a lot time proving things in this course. What isa proof? ‘A formal proof of« proposition isa chain of logical deductions leading to the proposition from a base set of axioms. ‘An axiom is a proposition we assume to be true. Propositional logic What is a proposition? A proposition is a declarative statement that is either true or false. ‘Statement True? | Proposition? “Two non-parallel lines in the plane have exactly one point in common. ‘Ann Arbor is the capital of Michigan. ‘Te11=3 Goblue! x#5#10 This statement is false. “There is life on Mars Things to watch for: © There Is a difference between not having enough information (such as the x5 case) and not knowing the answer (such as the Mars case). It just has to havea truth value to be a proposition, you don't need to know the truth value. © Paradoxes are coo! (and useful) but don’t have a truth value so aren't propositions. Logical operators ‘Say we lve in the rather black and white world where we are dealing with propositions. So if is “Mark is going to the Store” and Cis “Mark likes Computer games” then we'll assume that each phrase is either true or false (as opposed only sort of liking computer games). We can then use connectives to combine the variables. Mark is going to the store AND Mark likes computer games. ‘The above statement Is only true if both phrases are true. Let that sentence be X. We can now draw the “truth table” for X (we'll use the other tables in a minute). When is X true? F T al=]= 1° a[>[al=f[e a[-Per a[=[al=[e al=[>=]=/° a[>[al=[o Representation of logical operators. Using AND, OR, NOT and XOR gets old. So symbols have been used to represent these notions for quite while, We'll hit three different representations today: ‘Math/Philosophy Electrical/Computer Gate Engineering pAND q poORq NOT p pXORq ‘Compound Proposition | EXPression in English “Itis not the case that p” “Both p and q” “porq(or both)” “por gq (but not both)” “ifptheng” “pimplies q” “pif and only if q” Truth tables English is often too ambiguous. (It doesn’t clearly distinguish between pvq and p@q, for instance.) A truth table is an unambiguous way to show the meaning of a compound proposition. We will use them a lot. Fill in the following table! Implication Many people have trouble with p-oq. in English, saying “p implies q” p>4 suggests that there is a causal connection between p and q. In logic, p->q means the truth table on the right. Thus, O=1.—> Brehob is POTUS has truth value T! Ittakes practice to get the right intuitions about pg. One useful ayn) ya] ° alaln[a]2 ajay nia perspective: + Ifpis true, poq says something about g. + Ifpis false, pq says nothing about q Another one: The only way for pq to be false, is for p to be true, and q tobe false. + Write pq using only 4 v and =. Examples #1: Let's How can we express these compound propositions in terms of p, 4.1.5? English ‘Compound proposition Fit rains, Vl watch a movie and eat popcorn. Wl don’t eat popcom, "leat chocolate, Twon'’t eat both chocolate and popcorn unless it ivllrain”_w watch amovie” p= “Til eat popcorn” wa: Letp 4 andr bethe propositions | Enalish Céripeuund papain) y warnesel You get an Ain the class, But you P+ Yougetan Aon the final exam. | do not do every exercise in the q : You do every exercise in the book. | book. 1: You get an Ain this class (Getting an A on the final exam and doing every exercise in the book is sufficient for getting an A inthis cass. A bit on logic gates. (1.2) Its trational in digital opi to use “I” for “T” and “0” for “F Write a truth table for the following word problem: + Consider a device with three inputs: A, 8 and S as well as one output M. M should be equal to Aif $0, else M should be equal to 8. ‘Now, can you draw gates for this? Mint: can be done with 4 gates (2 AND, 1.08, NON). ‘This device is called a multiplexor (MUX) PPE ss] ee elele|=/elolo elePfelelemlefe Here is an example of an industry supplied logic: uit that can be simplified. d= SHS Se eas | SH wort fl ~) There are a number of ways to simplify this circuit, but one way is using propositional logic ‘equivalencies. After doing so, you can get this: app outo aD 2 D— rp “3B pVPe More on digital logic and its applications Consider the number 123 123 Each place has a value. We normally work in base 10, so each place is 10 times bigger than the last. In binary we work in base 2. Consider the number 10010, (the subscript indicates the base). 10010 Recall that in digital logic, we treat “T” as “1” and “F” as “0”. Consider a device that adds two one-digit binary numbers and outputs a 2 digit binary number. Let the inputs be A and Band the output be R[1:0] (where R[1:0] means Ri concatenated with RO). A + B RiRo Write the truth table for this adder. R1 isto be the most significant digit (farthest to the left in the 2's piace in this exemple) while RO is to be the least significant digit (farthest to the right, in the 1’s place). ‘Then draw the logic gates. ‘The point is that we can use basic logic to do arithmetic. You may say “great, | can add two one-bit fumbers”. But it turns out we can use this basic idea of using logic states to represent numbers to do all kinds of math. Amodern computer can easily do 5-10 billion additions of 64-bit numbers in a second! All based on this basic idea. In fact, all computers are built around this simple idea that we can use logic to do arithmetic.’

You might also like