Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 13: State Machines

David Evans
October 11, 2017

Class 13: State Machines

cs2102: Discrete Mathematics
University of Virginia, Fall 2017

See course site for notes:
https://uvacs2102.github.io

David Evans

October 11, 2017
Tweet

More Decks by David Evans

Other Decks in Science

Transcript

  1. Class 13: State Machines cs2102: Discrete Mathematics | F17 uvacs2102.github.io

    David Evans | University of Virginia Return Exam 1 Today No problem set due this week! PS6 will be posted soon and due Friday, Oct 20.
  2. M =

  3. State Machine M = (, : × , ) ∈

    ) What does it mean if is total?
  4. State Machine M = (, : × , ) ∈

    ) What does it mean if is not a function?
  5. State Machine Executions The execution of a state machine, =

    (, ⊆ ×, ) ∈ ) is a (possibly infinite) sequence of states, () , 3 , … , 5 ) that:
  6. Reachable States A state is reachable if it appears in

    some execution. The execution of a state machine, = (, ⊆ ×, ) ∈ ) is a (possibly infinite) sequence of states, () , 3 , … , 5 ) that: 1. ) = ) (it begins with the start state) 2. ∀ ∈ 0, 1, … , − 1 . > → >?3 ∈ (if and are consecutive states in the sequence, there is an edge → ∈ .
  7. = , ∈ ℤ, ∈ {, }} = , →

    + 1, ∈ ℤ} ∪ , → − 2, ∈ ℤ} ) = (0, ) What states are reachable?
  8. = , ∈ ℤ, ∈ {, }} = , →

    + 1, ∈ ℤ} ∪ , → − 2, ∈ ℤ} ) = (0, )
  9. Results by Question 0 (Name) 1 (Inference Rules) 2 (Satisfiability)

    3 (Logical Equivalence) 4 (Well Ordering) 5 (Relations) 6 (Proofs) 7 (Induction) Average 30.0 9.374 9.887 9.947 8.632 8.726 8.252 8.792 Median 30 10 10 10 8 10 9 10
  10. Proofs • To prove by induction, need to state a

    predicate with an induction variable • Need to write proofs to convince: showing the structure of your argument is more important than showing a bunch of algebra ∷= whatever is here must use n (and that is what you are doing induction on)
  11. Returning Exam 1 Group 1 Group 2 Group 3 Group

    4 aa8dp (Akanksha) ea6dc (Elmo) kai4vb (Kelsey) qed4wg (Quinn) aap7sc (Alex) eae4bf (Eliza) kc4au (Kunal) rac4ad (Raina) … … … … dz7as (Daniel) jyy3gx (Josh) pw2hm (Peter) zpg9js (Zach) Front of Classroom
  12. Returning Exam 1 Group 1 Group 2 Group 3 Group

    4 aa8dp (Akanksha) ea6dc (Elmo) kai4vb (Kelsey) qed4wg (Quinn) aap7sc (Alex) eae4bf (Eliza) kc4au (Kunal) rac4ad (Raina) … … … … dz7as (Daniel) jyy3gx (Josh) pw2hm (Peter) zpg9js (Zach) How can we efficiently sort ~80 people by UVA id? Front of Classroom
  13. Returning Exam 1 Group 1 Group 2 Group 3 Group

    4 aa8dp (Akanksha) ea6dc (Elmo) kai4vb (Kelsey) qed4wg (Quinn) aap7sc (Alex) eae4bf (Eliza) kc4au (Kunal) rac4ad (Raina) … … … … dz7as (Daniel) jyy3gx (Josh) pw2hm (Peter) zpg9js (Zach) Front of Classroom