Question

How many comparisons (both successful and unsuccessful) will be made by the brute-force algorithm in searching...

How many comparisons (both successful and unsuccessful) will be made by the brute-force algorithm in searching for each of the following patterns in the binary text of one thousand zeros?

a.00001     b.10000     c.01010

Homework Answers

Answer #1

Here is the answer for your question....

a)00001

Answer:- There are total 4980 comparisons will occur,including both successful and unsuccessful comparisons.

   Given Search Pattern 00001 is of length 5. so there will be 1000 -5 + 1 = 996 iterations will occur. In that , the first 4 comparisons would be successful and the last comparison will be unsuccessful. so 996*4 = 3,984 will be consider as successful comparisons and rest 996*1 = 996 will be treated as unsuccessful comparisons. hence Total comparisons are = 3984 + 96 = 4980

b)10000

Answer:- There are total 996 comparisons will occur,including both successful and unsuccessful comparisons.

we already know that there are 996 iterations. In that, the first comparison would itself be unsuccessful. so there is no successful comparison.only we have 996*1 = 996 unsuccessful comparisons.Hence Total comparisons are = 996.

c)01010

Answer:- There are total 1992 comparisons will occur,including bot successful and unsuccessful comparisons.

we already know that there are 996 iterations. In that, the first comparison would be successful and the second comparison would be unsuccessful. so there are 996*1 = 996 successful comparisons and rest will be 996*1 = 996 unsuccessful comparisons. hence total comparisons are 1992.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider a brute force attempt to crack keys for the following scenario. You have in your...
Consider a brute force attempt to crack keys for the following scenario. You have in your possession a wireless emulator the size of a 6” cube (i.e., 6” x 6” x 6”) with a weight of less than 5 pounds which you can take to a parking lot containing 1,000 new cars. Each car has a four-digit wireless door key (between “0000” and “9999” using wireless symbols) as well as a three-digit engine key (between “000” and “999” including the...
Can you plzz do part D . Transform and Conquer Design a reasonably efficient algorithm for...
Can you plzz do part D . Transform and Conquer Design a reasonably efficient algorithm for solving each of the following problems and determine its efficiency class. a. You are given n telephone bills and m checks sent to pay the bills (n ≥ m). Assuming that telephone numbers are written on the checks, find out who failed to pay. (For simplicity, you may also assume that only one check is written for a particular bill and that it covers...
1. How many ATP are made in the citric acid for each Acetyl COA? 2. What...
1. How many ATP are made in the citric acid for each Acetyl COA? 2. What happens to glucose at the end of oxidation in the Citric Acid Cycle? 3. If a mutation deletes a mRNA what is the result? 4. When an enzyme accelerates a reaction rate, what does the enzyme do, thermodynamically (energy-wise)? 5. What is the location on an enzyme where the reactants bind called? 6. When an enzyme runs a reaction, what happens to the enzyme...
NWS620S Tutorial 1: Symmetric Encryption - DES Encryption is the translation of data into a secret...
NWS620S Tutorial 1: Symmetric Encryption - DES Encryption is the translation of data into a secret code so that only authorised entities can read it. Encrypting data is considered a very effective way of achieving data security. To access encrypted data, you must have access to a secret key that enables you to decrypt it. Unencrypted data is called plain text; encrypted data is referred to as cipher text. There are two types of encryption: • Symmetric encryption • Asymmetric...
Pandora is the Internet’s most successful subscription radio service. As of June 2013, it had over...
Pandora is the Internet’s most successful subscription radio service. As of June 2013, it had over 200 million registered users (140 million of which access the service via a mobile device) and over 70 million active listeners. Pandora now accounts for more than 70% of all Internet radio listening hours and a 7% share of total U.S. radio listening (both traditional and Internet). At Pandora, users select a genre of music based on a favorite musician, and a computer algorithm...
MATHEMATICS 1. The measure of location which is the most likely to be influenced by extreme...
MATHEMATICS 1. The measure of location which is the most likely to be influenced by extreme values in the data set is the a. range b. median c. mode d. mean 2. If two events are independent, then a. they must be mutually exclusive b. the sum of their probabilities must be equal to one c. their intersection must be zero d. None of these alternatives is correct. any value between 0 to 1 3. Two events, A and B,...
1. Vim commands: a. How do you auto indent your program? b. Explain what the following...
1. Vim commands: a. How do you auto indent your program? b. Explain what the following commands do: dd, y3, p, :set cindent (1 pt) VIM exercises These exercises on the computer need to be repeated by each student in the pair. This is to ensure that both students understand how to get around in Linux!!! For this part of the lab, you will create a .vimrc file that will help you develop your C++ programs using VIM. First, we...
After reading the following article, how would you summarize it? What conclusions can be made about...
After reading the following article, how would you summarize it? What conclusions can be made about Amazon? Case 12: Amazon.com Inc.: Retailing Giant to High-Tech Player? (Internet Companies) Overview Founded by Jeff Bezos, online giant Amazon.com, Inc. (Amazon), was incorporated in the state of Washington in July 1994, and sold its first book in July 1995. In May 1997, Amazon (AMZN) completed its initial public offering and its common stock was listed on the NASDAQ Global Select Market. Amazon quickly...
1) Describe an example of each of the following that may be found of your kitchen:...
1) Describe an example of each of the following that may be found of your kitchen: Explain how your choice falls into this category, and if there is a chemical name or symbol for it, provide that as well. Provide a photo of your example with your ID card in it. a) a compound b) a heterogeneous mixture c) an element (symbol) Moving to the Caves… Lechuguilla Caves specifically. Check out this picture of crystals of gypsum left behind in...
3/ which of the following stellar properties is the most fundamental to a star’s main-sequence and...
3/ which of the following stellar properties is the most fundamental to a star’s main-sequence and post-main sequence life? A/ temperature B/ mass C/ luminosity D/ radius 4/ Stars Moppit and Boppit orbit each other as members of a binary star system. Their period of rotation about their combined centre of mass is 10 years. The semi-major axis of Boppit’s orbit around the centre of mass is 15.25 AU. What is the combined mass of Moppit and Boppit? A/ Mmoppit...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT