HM3-Chapters5-6-Answers

HM3-Chapters5-6-Answers - CS 341 Homework 3 Answers Chapter...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 341 Homework 3 Answers Chapter 5 2) Show a DFSM to accept each of the following languages: b) { w { a , b }* : w does not end in ba }. a 2 1 b 3 4 b c) { w { 0 , 1 }* : w corresponds to the binary encoding, without leading 0’s, of natural numbers that are evenly divisible by 4}. d) { w { 0 , 1 }* : w corresponds to the binary encoding, without leading 0’s, of natural numbers that are powers of 4}. 0 1 0 g) { w { 0 , 1 }* : w does not have 001 as a substring}. l) The set of binary strings with at most one pair of consecutive 0’s and at most one pair of consecutive 1’s.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3) Consider the children’s game Rock, Paper, Scissors h. We’ll say that the first player to win two rounds wins the game. Call the two players A and B . a) Define an alphabet Σ and describe a technique for encoding Rock, Paper, Scissors games as strings over Σ . (Hint: each symbol in Σ should correspond to an ordered pair that describes the simultaneous actions of A and B .) Let Σ have 9 characters. We’ll use the symbols a - i to correspond to the following events. Let the first element of each pair be A’s move. The second element of each pair will be B’s move. a b c d e f g h i R, R R, P R, S P, P P, R P, S S, S S, P S, R A Rock, Paper, Scissors game is a string of the symbols a - i . We’ll allow strings of arbitrary length, but once one player as won two turns, no further events affect the outcome of the match.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/03/2009 for the course CS 341 taught by Professor Rich during the Fall '08 term at University of Texas at Austin.

Page1 / 6

HM3-Chapters5-6-Answers - CS 341 Homework 3 Answers Chapter...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online