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

  Use a two dimensional array to solve problem

Use a two dimensional array to solve the following problem. A company has four salespeople ( 1 to 4) who sell five different products ( 1 to 5).

  Program to determines and print all prime numbers

Use this function in program which determines and prints all prime numbers between 2 and 10,000. How many of these numbers do you actually have to test before being sure that you have found all primes?

  Write void function which reads game-s parameters from file

Write a void function which reads game's parameters from file. Function validates te parameters. If parameters are "bad" the function assigns default values to parameters.

  Creating class savingsaccount using static variable

Create class SavingsAccount. Use static variable annualInterestRate to store annual interest rate for all account holders.

  Creating code for method tostring

Fill in the code for method toString, which must return a string containing the name, account number, and balance for the account.

  Implement functions using x86 assembly

Implement a procedure that mimics a logic unit

  Write program that asks user to enter five test scores

Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score.

  Write program to open file for reading

Write the program to open file for reading which has twenty (20) rows and in each row there are three (3) columns. After reading each row call user-defined function to display each row.

  What are the contents of given register

Memory location 2000H has the word 5000H stored in it. What does each location contain after INC BYTE PTR[2000H]. Also after DEC WORD PTR[2000H]

  Explaining exception handling using program

Use exception handling appropriately. Use comments to illustrate the various concepts applied / utilized in the solution.

  Create a program to store assignment grades for student

The elementary school for which you are doing development work has asked you to create a program to store assignment grades for one student.

  Write if statement to display acceptance messag

Write an if statement that displays an acceptance message for an astronaut candidate if the person's weight is between the values of opt_min.

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