blem 2. If not would downvote. Getting wrong code.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Problem 2.

If not would downvote. Getting wrong code. 

 

(b) What are all the outcomes where the first three digits of the ATM PINS are equal to 0? Use the
list all atmpins you created in the previous part to create a new list three_zeros. Print all the
outcomes.
[ ### edTest(test first zeros) ###
#Code for part (b)
#three zeros = []
(c) What are all the outcomes where the first three digits of the ATM PINS are equal? Put
outcomes in a list called three_equal. Print all the outcomes.
[] ### edTest(test_first three) ###
#Code for part (c)
#three equal []
(d) What are all the outcomes where at least three digits are equal? Create a set (in Python) called
eq3 set containing all these outcomes. Print the cardinality and all the outcomes of this set.
[] ### edTest(test three_equal) ###
#Code for part (d)
(e) Suppose you generate an ATM PIN as follows: for each of the four digits, pick a number at
random between 0 and 9 (endpoints included). We are interested in the probability that the sum
of the digits of the ATM PIN is equal to 18. Compute (and print) in a variable named equals18 an
approximation to this probability by generating 10000 ATM PINS and computing the proportion
(relative frequency) of times you observe a sum of 18. [Hint: For this recall that
random.randint (1,n) generates an integer at random between 1 and n (endpoints included).]
[] ### edTest(test_sum) ###
#Code for part (e)
Transcribed Image Text:(b) What are all the outcomes where the first three digits of the ATM PINS are equal to 0? Use the list all atmpins you created in the previous part to create a new list three_zeros. Print all the outcomes. [ ### edTest(test first zeros) ### #Code for part (b) #three zeros = [] (c) What are all the outcomes where the first three digits of the ATM PINS are equal? Put outcomes in a list called three_equal. Print all the outcomes. [] ### edTest(test_first three) ### #Code for part (c) #three equal [] (d) What are all the outcomes where at least three digits are equal? Create a set (in Python) called eq3 set containing all these outcomes. Print the cardinality and all the outcomes of this set. [] ### edTest(test three_equal) ### #Code for part (d) (e) Suppose you generate an ATM PIN as follows: for each of the four digits, pick a number at random between 0 and 9 (endpoints included). We are interested in the probability that the sum of the digits of the ATM PIN is equal to 18. Compute (and print) in a variable named equals18 an approximation to this probability by generating 10000 ATM PINS and computing the proportion (relative frequency) of times you observe a sum of 18. [Hint: For this recall that random.randint (1,n) generates an integer at random between 1 and n (endpoints included).] [] ### edTest(test_sum) ### #Code for part (e)
Problem 1: ATM PINS
(a) ATM PINS are four digit integer codes. For example 1234, 3183, 0000 and 9999 are some
ATM PINS. Write Python code to create a list of all possible ATM PINS. The list name should be
all_atmpins. Each PIN should be a string of four characters. Print the length of all_atmpins
and evaluate the value of all_atmpins at indices 0, 999, 1000 and 1101.
[] ### edTest(test list) ###
#Write your code for part (a) in this cell
#...
#all atmpins = []
Transcribed Image Text:Problem 1: ATM PINS (a) ATM PINS are four digit integer codes. For example 1234, 3183, 0000 and 9999 are some ATM PINS. Write Python code to create a list of all possible ATM PINS. The list name should be all_atmpins. Each PIN should be a string of four characters. Print the length of all_atmpins and evaluate the value of all_atmpins at indices 0, 999, 1000 and 1101. [] ### edTest(test list) ### #Write your code for part (a) in this cell #... #all atmpins = []
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY