Provide unoptimized-optimized prefix using recursive rule

Assignment Help Programming Languages
Reference no: EM1371227

Fibonacci strings are defined as follows:

F1 = "b", F2 = "a", and Fn = Fn-1Fn-2, (n > 2)

where the recursive rule uses concatenation of strings, so F2 is "ab", F3 is "aba". Note that the length of Fn is the nth Fibonacci number.

(a Prove that in any Fibonacci string there are no two b's adjacent and no three a's.
(b) Give the unoptimized and optimized ‘prefix' (fail) function for F7.
(c) Prove that, in searching for a Fibonacci string of length m using unoptimized KMP, it may shift up to phi(log m) times, where phi = (1+p5)/2, is the golden ratio. (Hint: Another way of saying the above is that we are given the string Fn and we may have to shift n times. Find an example text T that gives this number of shifts).
(d) What happens here when you use the optimized prefix function? Explain.

Reference no: EM1371227

Questions Cloud

Determining marketing mix : Marketing mix is controllable set of activities that the firm employs to respond to the wants of its target markets. Make a report on the marketing mix and keep the following questions in mind:
Information and opposition to fair disclosure rule : securities professionals argue that individual investors aren't really capable of interpreting much of the information now available to them. Explain why one would agree or disagree with these opinions.
Sinking fund for outstanding preferred stock issue : Acme make a decision to establish a sinking fund for its outstanding preferred stock issue. $975318642 represents the value of the issue that will be retired in 26 years
Automobile that made a difference in mobility : There have been adventurous people traveling since the country was founded without which there would not have been the westward expansion.
Provide unoptimized-optimized prefix using recursive rule : Where the recursive rule uses concatenation of strings, so F2 is "ab", F3 is "aba". Note that the length of Fn is the nth Fibonacci number. Provide unoptimized and optimized ‘prefix' (fail) function for F7.
University pricing strategy : What market structure best characterizes the market in which universities compete? How does this structure influence the university's pricing strategy?
Explain making a short-term pricing decision where surplus : Explain What additional costs must be taken into account when making a short-term pricing decision where surplus capacity is not available
Media explosion allows information sharing : The art and literature of these cultures need to be shared with anyone who wants to learn about them. Explain
Question about cost drivers : Firm A produces three products. Firm A uses labor costs as a cost driver for support costs. Direct labor is estimated at $20 per hour.

Reviews

Write a Review

Programming Languages Questions & Answers

  Sketch program flowchart for program to compute average

Sketch a program flowchart for a program that will compute the average of five grades. Input five grades and output the aveage.

  Design implement application displays button-label on screen

Design an implement an application that displays a button and a label on a screen. Every time the button is pushed, the label will display a random number.

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Write a program to print average grade of student

Write a program that read the grades.txt file and then prints the average grade of male and female students and the number of passed students by using the functions.

  Create program which asks for number of fat grams

Create a program which asks for number of fat grams and calories in a food item. Validate input as follows: Make sure number of fat grams and calories are not less than 0.

  Program that uses for loop prompt user to input two integers

Write a program that uses for loop to preform the following steps: Prompt the user to input two integers: firstnum and secondnum.

  Write ipo steps and detailed pseudo code for program

Write IPO steps and detailed pseudo code for program which will ask user to enter restaurant meal cost. The program should then compute the tax, tip on the restaurant bill,

  Create a function that takes a one dimentional array

Create a function that takes a one dimentional array us a argument the function should return only these members from the array which are divisible by 4.

  Write a full program to convert seconds into hours

Write a full program (starting from #include) that takes as input the number of seconds after midnight and displays the time in hours.

  Program display meal cost and tax amount

The program should then display the meal cost,taxAmt, and total bill respectively and use named constants Tax and tip to initialize the tax and the tip values.

  Two-level memory cache hierarchy

Explain how you would pipeline the four following pairs of statements.

  Program calculate average number of days employee are absent

Write a program that calculates the average number of days a company's employees are absent. The program should have the following functions: a function called main that asks the user for the number of employees.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd