You are participating in a competition related to security, each participant is given a bank card and is asked to secretly set a 4-digit pin number for that card. The cards are then exchanged between participants. Each participant is given a card reading machine, where you can input the pin and the machine will tell you if the pin was correct or not. Your task is to find the pin entered by the other participant. A) What Al method will you use to obtain the 4-digit pin number stored in the card? [] B) Write a program in python that simulates the entire competition where the secret 4-digit number is entered by the user as an input. Then, simulate the card reader functionality where if the correct 4-digit key is provided it results with true value and false otherwise. Finally write your program that attempts to find the inputted number by using the simulated card reader only. [] C) Generate 100 random pins by going to the website https://www.coolgenerator.com/pin-generator. Run your code to find all these 4 digit pins and report the average time it takes the computer to find a solution. [] D) Repeat part (C) using 6-digit pins instead of 4-digit pins. Compare the time between finding the 4-digit number and the 6-digit number. Explain the difference in the result. [] Hint: You can use the timeit function in python to get the time. A sample code for timeit is given below: import timeit def test (n) : return sum (range (n)) n = 1000 1oop = 10 result = timeit.timeit('test (n)', globals-globals (), number r = 10c ) print (result / loop)

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

You are participating in a competition related to security, each participant is given a bank card and is asked to secretly set a 4-digit pin number for that card. The cards are then exchanged between participants. Each participant is given a card reading machine, where you can input the pin and the machine will tell you if the pin was correct or not. Your task is to find the pin entered by the other participant.

A) What Al method will you use to obtain the 4-digit pin number stored in the card? []

B) Write a program in python that simulates the entire competition where the secret 4-digit number is entered by the user as an input. Then, simulate the card reader functionality where if the correct 4-digit key is provided it results with true value and false otherwise. Finally write your program that attempts to find the inputted number by using the simulated card reader only. []

C) Generate 100 random

pins by going

to

the website

https://www.coolgenerator.com/pin-generator. Run your code to find all these 4 digit pins and report the average time it takes the computer to find a solution. []

D) Repeat part (C) using 6-digit pins instead of 4-digit pins. Compare the time between finding the 4-digit number and the 6-digit number. Explain the difference in the result. []

Hint: You can use the timeit function in python to get the time. A sample code for timeit is given below:

import timeit

def test (n) : return sum (range (n))

n = 1000

1oop = 10

result = timeit.timeit('test (n)', globals-globals (), number r = 10c ) print (result / loop)

Expert Solution
steps

Step by step

Solved in 4 steps with 4 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