Slide 1

Slide 1 text

cs2102: Discrete Mathematics Class 1: What makes computers go? David Evans University of Virginia

Slide 2

Slide 2 text

What makes it go?

Slide 3

Slide 3 text

For example, there was a book that started out with four pictures: first there was a windup toy; then there was an automobile; then there was a boy riding a bicycle; then there was something else. And underneath each picture it said, “What makes it go?” From Richard Feynman, Surely You’re Joking, Mr. Feynman!

Slide 4

Slide 4 text

I thought, “I know what it is: They’re going to talk about mechanics, how the springs work inside the toy; …” It was the kind of thing my father would have talked about: “What makes it go? Everything goes because the sun is shining.” … “No, the toy goes because the spring is wound up,” I would say. “How did the spring get wound up?" … “I wound it up." “And how did you get moving?" “From eating." “And food grows only because the sun is shining. So it’s because the sun is shining that all these things are moving.”… From Richard Feynman, Surely You’re Joking, Mr. Feynman!

Slide 5

Slide 5 text

What makes it go?

Slide 6

Slide 6 text

Sun shines Plankton thrives Fossilizes

Slide 7

Slide 7 text

Electricity Transistors, Memory

Slide 8

Slide 8 text

What makes it go?

Slide 9

Slide 9 text

Transistors, Memory Programs Mathematics Algorithms

Slide 10

Slide 10 text

Focus of cs2102 This course is about the underlying mathematics that makes computers work. cs2102 cs3102 cs4102 Theory of Computation: What Can and Cannot Be Computed Algorithms: Designing and Analyzing Information Processes

Slide 11

Slide 11 text

Developing Mathematical Skills Precise Tools for Thinking: Definitions Proofs Before Friday (questions on Survey): “Habits of highly mathematical people”

Slide 12

Slide 12 text

Developing Mathematical Skills Precise Tools for Thinking: Definitions Proofs Mathematical objects used in Computing:

Slide 13

Slide 13 text

Developing Mathematical Skills Precise Tools for Thinking: Definitions Proofs Mathematical objects used in Computing: Numbers, Sets, Graphs

Slide 14

Slide 14 text

Join the course slack group: csmath.slack.com/signup Some of you received an invitation with a link if you are enrolled/waiting for class. Please accept the invitation now (and then I’ll invite the rest of the class).

Slide 15

Slide 15 text

Join the course slack group: csmath.slack.com/signup Post any questions/comments you have so far in #general Answer in #inclass: why does computer science mostly use discrete math?

Slide 16

Slide 16 text

Why Discrete Math?

Slide 17

Slide 17 text

Continuous Discrete

Slide 18

Slide 18 text

Continuous Discrete There is something between any two numbers There is nothing between adjacent numbers Real numbers Integers

Slide 19

Slide 19 text

Represents a 1 Represents a 0 Digital Abstraction 0 V 5 V 2 V 3 V This is wasteful - infinitely many values used to represent only two! But useful: tolerate noise and get exact results with confidence.

Slide 20

Slide 20 text

Finite Storage Discrete math is often infinite, but also often done over finite domains.

Slide 21

Slide 21 text

Finite Storage Can continuous math be finite?

Slide 22

Slide 22 text

“Hard” Problems y2 = x3 + 7 What does y2 = x3 + 7 look like in finite field?

Slide 23

Slide 23 text

“Hard” Problems y2 = x3 + 7 mod G (G = 629) Why do we want “hard” problems?

Slide 24

Slide 24 text

y2 = x3 + 7 mod G (G = 2256-232-977) Bitcoin Market Value Depends on it being hard to find points on this (discrete) curve.

Slide 25

Slide 25 text

All* Discreet Communications depend on Discrete Math * Except for whispering and passing notes. Me mod n YA =aXA mod q Diffie-Hellman Merkle Key Agreement: Discrete log problem is hard RSA Public-Key Encryption: Factoring problem is hard

Slide 26

Slide 26 text

Definitions

Slide 27

Slide 27 text

What makes a good definition?

Slide 28

Slide 28 text

Proposition A proposition is a statement that is either true or false.

Slide 29

Slide 29 text

Proposition A proposition is a statement that is either true or false. The cs2102 TAs are awesome. 2 + 2 = 5. Today is Tuesday. If today is Tuesday and it is during the semester, there is cs2102 class.

Slide 30

Slide 30 text

Axioms An axiom is a proposition that is accepted to be true. Axioms are assumed, not proven.

Slide 31

Slide 31 text

Euclid’s Axioms 1. A straight line may be drawn between any two points. 2. A piece of straight line may be extended indefinitely. 3. A circle may be drawn with any given radius and an arbitrary center. 4. All right angles are equal. 5. If a straight line crossing two straight lines makes the interior angles on the same side less than two right angles, the two straight lines, if extended indefinitely, meet on that side on which are the angles less than the two right angles.

Slide 32

Slide 32 text

Mathematical Proof Axioms P Chain of steps using inference rules, starting from set of axioms, resulting in P.

Slide 33

Slide 33 text

Inference Rule: Modus Ponens

Slide 34

Slide 34 text

Inference Rule: Modus Ponens antecedents conclusion Variables: P, Q

Slide 35

Slide 35 text

Soundness An inference rule is sound, if it can only be used to conclude true things. antecedents conclusion

Slide 36

Slide 36 text

Soundness An inference rule is unsound, if there is a way to make its antecedents all true, and its conclusion false. antecedents conclusion

Slide 37

Slide 37 text

Is it sound? P Q

Slide 38

Slide 38 text

Is it sound? P, P implies Q false

Slide 39

Slide 39 text

Is it sound? P, NOT(P) false

Slide 40

Slide 40 text

Is it sound? NOT(P) implies NOT(Q) Q implies P

Slide 41

Slide 41 text

Implies

Slide 42

Slide 42 text

Precise Meaning of Implies P implies Q means: if P is true, Q must be true. Variables are propositions: either true or false.

Slide 43

Slide 43 text

Raising Hands (Conventional) HandRaised implies WantToSpeak What does NOT(HandRaised) mean?

Slide 44

Slide 44 text

Raising Hands (Muller’s Rule) NOT(WantToSpeak) implies HandRaised What does NOT(HandRaised) mean?

Slide 45

Slide 45 text

Precise Meaning of Implies P implies Q means: if P is true, Q must be true. P Q P implies Q true true true true false false false true true false false true

Slide 46

Slide 46 text

Is it sound? NOT(P) implies NOT(Q) Q implies P

Slide 47

Slide 47 text

Is it sound? NOT(P) implies NOT(Q) Q implies P P Q NOT(P) implies NOT(Q) Q implies P true true true false false true false false

Slide 48

Slide 48 text

Is it sound? NOT(P) implies NOT(Q) Q implies P P Q NOT(P) implies NOT(Q) Q implies P true true true true true false true true false true false false false false true true

Slide 49

Slide 49 text

Contrapositive Rule NOT(P) implies NOT(Q) Q implies P P Q NOT(P) implies NOT(Q) Q implies P true true true true true false true true false true false false false false true true

Slide 50

Slide 50 text

Inference Rule: Modus Tollens NOT(Q), P implies Q NOT(P) P Q P implies Q true true true true false false false true true false false true

Slide 51

Slide 51 text

Proposition If the product of x and y is even, at least one of x or y must be even.

Slide 52

Slide 52 text

Charge • Before Thursday’s class: read MCS chapter 1, course syllabus; post questions on slack • Before Friday (6:29pm): course pledge, registration survey (read “Habits of Highly Mathematical People”) • I’ll have office hours now (until 4pm) and tomorrow (Wednesday), 3-4pm [Rice 507] • TA’s office hours will start next week (schedule to be posted on course site)