A safe is locked by a combination of of four binary digits (that is, 0 or 1), but the
owner has forgotten the combination. The safe is designed in such a way that no
matter how many digits have been pressed, if the correct combination of three digits
is pressed at any point, then the safe automatically opens (there is no ”enter” key).
Our goal is to find the minimum number of digits that one needs to key in in order to
guarantee that the safe opens. In other words, we wish to find the smallest possible
length of a binary sequence containing every four-digit sequence in it.
(a) Create a digraph whose vertex set consists of three-digit binary sequences. From
each vertex labelled xyz, there is one outgoing edge (labelled 0) leading to vertex
yz0, and another outgoing edge (labelled 1) leading to vertex yz1.
(b) Explain why every edge represents a four digit sequence and why an Eulerian
tour of this graph represents the desired sequence of keystrokes.
(c) Find the minimum number of digits that one needs to key in to guarantee that
the safe opens.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- A typical roulette wheel used in a casino has 38 slots that are numbered 1,2,3,....,36,0,00, respectively. Half of the remaining slots are red and half are black. Also, half of the integers between 1 and 36 inclusive are odd, half are even, and 0 and 00 are defined to be neither odd nor even. A ball is rolled around the wheel and ends up in one of the slots; we assume each slot has equal probability of 1/38, and we are interested in the number of the slot into which the ball falls. (a)Define the Sample space S. (b)Let A = {0,00}. Give the value of P(A). (c) Let B = {14,15,17 18}. Give the value of P(B). (d) Let D = {x:x is odd}. Give the value of P(D).arrow_forwardIn Python, Solve the locker riddle which reads as follows:Imagine 100 lockers numbered 1 to 100 with 100 students lined up in front of those 100lockers:The first student opens every locker.The second student closes every 2nd locker.The 3rd student changes every 3rd locker; if it’s closed, she opens it; if it’s open, she closes it.The 4th student changes every fourth locker (e.g., 4th, 8th, etc.).The 5th student changes every 5th locker (e.g., 5th, 10th, etc.).That same pattern continues for all 100 students. Which lockers are left open after all 100 students have walked the rowof lockers?arrow_forwardWe have n glasses which can hold a varying amount of liquid. We will say that glass1 is size q1 quarts and glass2 is size q2 quarts, etc. We now give you a size, say x quarts. You must give me a glass of exactly x quarts. You are allowed to fill any glass to exactly its size and to pour any liquid from one glass into another. When you pour, you either have to empty the glass you are pouring from or fill the glass you are pouring into. Can you do it?More concrete example: G1 has size 10 quarts. G2 has size 4 quarts. G3 has size 1 quart. You can get a 5 quart drink by filling G1, pouring 4 quarts from it into G2 and 1 quart of it into G1. After that, G1 has exactly 5 quarts. In the same problem, we could get 8 quarts by filling G2 twice and emptying it into G1 twice. Given This: Write an algorithm to do this and determine its complexity.arrow_forward
- 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