
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
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.](https://content.bartleby.com/qna-images/question/059f8a44-0099-41c0-92e3-ad75d014ebad/4db39b14-a1e0-47d2-bb2d-7e50b76a47ee/xss2y5r_thumbnail.png)
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.](https://content.bartleby.com/qna-images/question/059f8a44-0099-41c0-92e3-ad75d014ebad/4db39b14-a1e0-47d2-bb2d-7e50b76a47ee/x5o52_thumbnail.png)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Similar questions
- hi i want you to do me a python program using online gdb please use Variables.• Python Operators.• Different data types.• Using Multiline string.• Python type conversion.• Python DateTime.• Sets and at least two sets of functions to be used in the project.• If condition.arrow_forwardH Step 6: Descriptive Statistics: Points Scored By Your Time in Home Games The management of your team wants you to run descriptive statistics on the points scored by your team in the games played at your team's venue i 2015. Calculate descriptive statistics including the mean, median, variance, and standard deviation for points scored by your team played at Home. following edits to the code block below: 1. Replace ??MEAN_FUNCTION?? with the name of Python function that calculates the mean. 2. Replace ??MEDIAN_FUNCTION?? with the name of Python function that calculates the median. 3. Replace ??VAR_FUNCTION?? with the name of Python function that calculates the variance. 4. Replace ??STD_FUNCTION?? with the name of Python function that calculates the standard deviation. After you are done with your edits, click the block of code below and hit the Run button above. print("Points Scored by Your Team in Home Games (2013 to 2015)") print(" ") your_team_home_df =…arrow_forwardWhat precisely does it mean when you use the delete operator?arrow_forward
- Write a stored procedure named displayCountryMessage(). The displayCountryMessage () should receive one input argument for the country name and then based on that input argument, display a short message and the name of the country. Otherwise, if the country does not exist in the country table, then the procedure should display an appropriate message. For example, if I call the displayCountryMessage() procedure and pass it “France”, then it will display the message “France exists in the Country table”. If I call the displayCountryMessage()procedure and pas it “AAAAA”, then it will display the message “AAAAA does NOT exist in the Country table”.arrow_forwardNEED HELP WITH PYTHON CODE. ALSO, PLEASE PROVIDE DETAILS SEPARATELY ON HOW AND WHAT DID U USE TO GET UR CODE DONE.arrow_forwarde) Search for instances of the string password (all cases) using cat and grep. $ f) Search for the number of instances of the string password (all cases) using cat, grep and wc. $ From your above commands, can you determine if there are case-sensitive instances of the string password in the wordlist-probable.txt file? How do you know?arrow_forward
- Hi Team, Can you please help me in solving this query asap. Question- Use the python. to write a program.. The first problem has three requirements. First, write a program that will find the 450th prime number. After every 50 prime numbers in the search for the 450th, print the number of prime numbers found up to that point to the console. Include an explanation of what the iteration means (i.e., 150 prime numbers found so far). When you have identified the 450th prime number, print a statement to the console that indicates what this program was looking for and the solution. All prime numbers are odd, other than the number two. This eliminates a lot of candidates. The first step is to create an array of odd numbers, then test whether they are prime or not. Do this while you identify the remaining 449 prime numbers. You could use the modulo to test the values. How many divisors need to be checked before ruling a number out? You can review this list of prime numbers to ensure that you…arrow_forwardPlease answer in python with showing the code. (this is a 1 ques in 3 part please answer the ques) i. Create a python dictionary to organize the following info: a) The capital of the USA is Washington. The capital of France is Paris. The capital of India is New Delhi. b) Print the dictionary. ii. Create the dictionary to organize the following info: a) Our 2 students are Dembe and Kate. Dembe’s major is History. Kate’s major is Anthropology. Dembe’s hobbies are chess, judo, and drawing. Kate’s hobbies are bird-watching, stained-glass, poetry, and skating. b) Print the dictionaries. iii. Create a list of dictionaries to organize the following state info: a) Alaska’s capital is Juneau. Alaska’s population is 731,545. Its size is 665,000 square miles b) Hawaii’s capital is Honolulu. Hawaii’s population is 1,415,872. Its size is 10,931 square miles. c)Print the listarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY