Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

please do 3b (python). information and question are shown. 

You will write a program that inputs the number of buttons nhuttons and a word sequence u (given as a vector
of length nword Consisting of integers in [0, nbuttons – 1]) and uses Markov chains to output the expected amount
of time until the word sequence u appears. Before you write the program, do the following:
• a) A naive way to model this as a Markov chain would be to use the sequence of the last nword letters that
appear in the monkey's text (e.g. the state space is the set of ALL possible nword letter words). Explain why
using this as the Markov chain would be difficult for the computer to handle.
• b) Instead of the naive way above, come up with a Markov chain for the problem which the size of the state
space does not depend on nbuttons that can be used to solve this problem. Be sure to clearly indicate the
states of the Markov chain!
c) Analyze the simple case of nguttons = 6 by hand (This corresponds to the situation where the monkey's
typing is the same as rolls of fair 6 sided dice)
Draw out the directed graph of the Markov chain corresponding to the word sequence "0, 0"
Draw out the directed graph of the Markov chain corresponding the word sequence "0, 1"
Using the graphs, do you think the expected amount of time for the monkey to type these two word
sequences is same? Give an intuitive explanation why or why not.
expand button
Transcribed Image Text:You will write a program that inputs the number of buttons nhuttons and a word sequence u (given as a vector of length nword Consisting of integers in [0, nbuttons – 1]) and uses Markov chains to output the expected amount of time until the word sequence u appears. Before you write the program, do the following: • a) A naive way to model this as a Markov chain would be to use the sequence of the last nword letters that appear in the monkey's text (e.g. the state space is the set of ALL possible nword letter words). Explain why using this as the Markov chain would be difficult for the computer to handle. • b) Instead of the naive way above, come up with a Markov chain for the problem which the size of the state space does not depend on nbuttons that can be used to solve this problem. Be sure to clearly indicate the states of the Markov chain! c) Analyze the simple case of nguttons = 6 by hand (This corresponds to the situation where the monkey's typing is the same as rolls of fair 6 sided dice) Draw out the directed graph of the Markov chain corresponding to the word sequence "0, 0" Draw out the directed graph of the Markov chain corresponding the word sequence "0, 1" Using the graphs, do you think the expected amount of time for the monkey to type these two word sequences is same? Give an intuitive explanation why or why not.
0.3 Problem 3 - Monkey at a typewriter (also known as the “ABRACADABRA"
problem)
A monkey is typing on a typewriter and generates a long string of random letters. For example, the first 14
characters might look like the monkey might type the string:
Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 8 |9 10 | 11 | 12 | 13 | 14 || 14
Letter | B| C | D | B | A | B | R | A | C | A | D | A | B | R | A
We are interested in investigating how long it takes for interesting words to appear in the monkey's text. For
example, in the above example, the words “ABRACADABRA" fully appears in the text after 14 letters have been
typed.
We model this situation as follows:
1
Assume there are nbuttons possible buttons on the typewritter the monkey can press which are ordered
bo, b1,... bn-1. Any word can be represented by a finite sequence of integers. For example, if bo ="A", bị =
"B", b2 = "C" ,b3 ="D",...bıs = "R" then the word "ABRACADABRA" is the sequence 0, 1, 18, 1, 2,0, 3, 0, 1, 18, 0.
On a computer we represent this as a vector of length nword. Each element of the vector is an integer in
[0, word – 1])
Assume all buttons are equally likely.
• Assume the button pressed is independently at random, independent of all the other button presses that have
ever been pressed.
expand button
Transcribed Image Text:0.3 Problem 3 - Monkey at a typewriter (also known as the “ABRACADABRA" problem) A monkey is typing on a typewriter and generates a long string of random letters. For example, the first 14 characters might look like the monkey might type the string: Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 8 |9 10 | 11 | 12 | 13 | 14 || 14 Letter | B| C | D | B | A | B | R | A | C | A | D | A | B | R | A We are interested in investigating how long it takes for interesting words to appear in the monkey's text. For example, in the above example, the words “ABRACADABRA" fully appears in the text after 14 letters have been typed. We model this situation as follows: 1 Assume there are nbuttons possible buttons on the typewritter the monkey can press which are ordered bo, b1,... bn-1. Any word can be represented by a finite sequence of integers. For example, if bo ="A", bị = "B", b2 = "C" ,b3 ="D",...bıs = "R" then the word "ABRACADABRA" is the sequence 0, 1, 18, 1, 2,0, 3, 0, 1, 18, 0. On a computer we represent this as a vector of length nword. Each element of the vector is an integer in [0, word – 1]) Assume all buttons are equally likely. • Assume the button pressed is independently at random, independent of all the other button presses that have ever been pressed.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY