Slide 1

Slide 1 text

Class  26:  Wrap-­‐up cs2102:  Discrete  Mathematics  |  F16 uvacs2102.github.io   David  Evans   University  of  Virginia 0

Slide 2

Slide 2 text

Plan Today: Wrapping  up  the  Course! 1 Final  Exam  is  Saturday,  9am-­‐noon  (December  10) Please  verify  your  grades   are  recorded  correctly  in   collab;  any  mistakes  need   to  be  corrected  by  Friday My  office  hours  tomorrow   (Wednesday),  4-­‐5pm  (not   1-­‐2pm) Final  PS⍵ submissions:   due  11:59pm  tonight

Slide 3

Slide 3 text

2 Milan  Bharadwaj https://www.youtube.com/watch?v=PNpBamrpgic

Slide 4

Slide 4 text

3

Slide 5

Slide 5 text

4 From  Course  Registration  Survey:

Slide 6

Slide 6 text

Types  of  Definitions  in  cs2102 5

Slide 7

Slide 7 text

Declarative  (Natural  Language)  Definitions 6 Definition. A  proposition  is  a  statement  that  is  either  true   or  false.  (Class  1) Definition. A  set  is  well-­‐ordered with  respect  to  an   ordering  function  (e.g.,  <),  if  any  of  its  non-­‐empty  subsets   has  a  minimum element.  (Class  3) Definition.  A  formula  is  valid if  there  is  no   way  to  make  it  false.  (Class  4)

Slide 8

Slide 8 text

Declarative  (Formal)  Definitions 7 Definition.  An  integer,  ,  is  even if  there  exists  an  integer   such  that     =  2.  (Class  2)

Slide 9

Slide 9 text

Declarative  (Formal)  Definitions 8 The  power  set  of  a  set   is  the  set  of  all  subsets  of  . ∈ ⟺ ⊆ Class  19:

Slide 10

Slide 10 text

Descriptive  Definitions 9   =  (, ⊆  ×  , 5 ∈ )

Slide 11

Slide 11 text

Descriptive  Definitions 10   =  (, ⊆  ×  , 5 ∈ ) The  execution  of  a  state  machine, = (, ⊆  ×, 5 ∈ ) is  a  (possibly  infinite)  sequence  of  states,  (5 , 8 , … , : ) that: 1.  5 = 5 (it  begins  with  the  start  state) 2.  ∀ ∈ 0, 1, … , − 1  .   B  → BD8 ∈ (if   and   are   consecutive  states  in  the  sequence,  there  is  an  edge   → ∈ .

Slide 12

Slide 12 text

Constructive Definitions 11 Definition.  A  list is  an  ordered  sequence  of  objects.     A  list  is  either  the  empty  list  (),  or  the  result  of   prepend(, ) for  some  object   and  list  .

Slide 13

Slide 13 text

Set  Cardinality  Definitions 12 If   is  a  finite  set,  the  cardinality of  ,   written  ||,  is  the  number  of  elements  in  . The  cardinality of  the  set P =       ∈ ℕ ∧ <  } is  .    If  there  is  a  bijection between  two   sets,  they  have  the  same  cardinality.

Slide 14

Slide 14 text

Desirable  Definitions Why  do  we  have  so  many  kinds  of  definitions? 13

Slide 15

Slide 15 text

14 Baseball  Game  State  Machine By  Mason  Au,  Bobby  Stephens,  and  Kevin  Warshaw Link

Slide 16

Slide 16 text

Counterexamples 15

Slide 17

Slide 17 text

Counter  Examples 16

Slide 18

Slide 18 text

Counter  Examples 17 Diagonalization  Arguments Set  of  all  languages  of  bitstrings is  uncountable

Slide 19

Slide 19 text

Ask  Anything! 18 Helen  Simecek's Logical  Operators

Slide 20

Slide 20 text

19

Slide 21

Slide 21 text

20

Slide 22

Slide 22 text

21

Slide 23

Slide 23 text

22

Slide 24

Slide 24 text

23 Part  of  the  big  struggle  of  mathematics  is  synthesizing  all  of  the   information  in  all  of  these  ladder  rungs  into  a  coherent  world-­‐view   that  you  can  personally  scale  up  and  down  at  will.

Slide 25

Slide 25 text

Scaling  the   Ladder  of  Abstraction 24

Slide 26

Slide 26 text

Abstractions 25 ℤ int (C,  Java),  int (Python)   Mathematical  Abstraction Concrete  Program  Representation ℝ float  (Java,  Python),  double,  etc.   set set,  frozenset (Python) function function,  procedure,  method

Slide 27

Slide 27 text

Abstracting  Programs 26 Program State  Machine

Slide 28

Slide 28 text

Abstracting  Computers 27 = (, ⊆  ×  Γ →  ×  Γ  ×  ,  5 ∈ , Z[[\]^ ⊆ ) is  a  finite  set,   Γ is  finite  set  of  symbols, = {L,  R,  Halt} The  execution  of  a  Turing  Machine, = (, ⊆  ×  Γ →  ×  Γ  ×  ,  5 ∈ , Z[[\]^ ⊆ )  is  a   (possibly  infinite)  sequence  of  configurations,   5 , 8 , …, :  where   ∈ Tsil  ×    ×  List,  such  that: 1.  5 = (5 = , 5 , 5 = ) 2.  ∀ ∈ 0, 1, …, − 1  .    (B = B , B , B → BD8 = (BD8 , BD8 , BD8 )) ∈ where  transitions  are  defined  …

Slide 29

Slide 29 text

Abstractions  Abstract 28 ℒAliG ≔  ×   =    , ∈ 9 ∗, = }}

Slide 30

Slide 30 text

29 Physical  Computers Model  Computers Physics Transistors Circuits Machine  Code Assembly  Code High-­‐Level  Program Algorithm Compiler Low-­‐Level  Program Interpreter Assembler Loader Python C ZFC  Axioms Sets Relations State  Machines Turing  Machines Algorithm Numbers

Slide 31

Slide 31 text

30 Physical  Computers Model  Computers Physics Transistors Circuits Machine  Code Assembly  Code High-­‐Level  Program Algorithm Compiler Low-­‐Level  Program Interpreter Assembler Loader Python C ZFC  Axioms Sets Relations State  Machines Turing  Machines Algorithm Numbers Boolean  Logic

Slide 32

Slide 32 text

Minimizing   Magic 31 Its  all  magic! Physics Four  Years  Studying   Computing  at  an  Elite   Public  University Its  all   understandable! (and  I  can  do  magical  things!) Cool  Computing  Stuff

Slide 33

Slide 33 text

Course  Goal  Reminder:  Minimizing  Magic 32 Its  all  magic! Physics Cool  Computing  Stuff cs1110 cs2110 cs2150 cs2150 cs2330 cs3330 cs3102 cs4414 cs4610 cs4414 cs4414 electives From  cs4414  (Operating  Systems  rust-­‐class.org):

Slide 34

Slide 34 text

Computer  Scientist’s    Goal:  Minimize  Magic 33 Its  all  magic! Physics Cool  Computing  Stuff cs11XX cs2330 cs3330 cs3102 cs4414 cs2102 cs4414 cs4414 Mathematics cs4102 cs3102 cs2150 cs2150 cs2110 cs2102

Slide 35

Slide 35 text

Charge 34 Thank  you!

Slide 36

Slide 36 text

Charge 35 Thank  you! Final  Exam  is  Saturday,  9am-­‐noon  (December  10) Please  verify  your  grades   are  recorded  correctly  in   collab;  any  mistakes  need   to  be  corrected  by  Friday My  office  hours  tomorrow   (Wednesday),  4-­‐5pm  (not   1-­‐2pm) Final  PS⍵ submissions:   due  11:59pm  tonight