subject
Physics, 24.03.2021 18:10 cbogrett

Recall that a palindrome is any string that is exactly the same as its reversal, like I, or DEED, or RACECAR, or . For technical reasons, in this problem, we will only be interested in palindromes that are of length at least one, hence we will not treat the string as a palindrome. Any string can be decomposed into a sequence of palindrome substrings. For example, the string
BUBBASEESABANANA ("Bubba sees a banana.") can be broken into palindromes in the following ways (among many others):
BUB BASEESAB ANANA
B U B B A S E E S A B ANA N A
B U B B A S E E S A B A N A N A
Since any string w can always be decomposed to palindromes we may want to find a de- composition that optimizes some objective. Here are two example objectives. The first objective is to decompose w into the smallest number of palindromes. A second objective is to find a decomposition such that each palindrome in the decomposition has length at least k where k is some given input parameter. Both of these can be cast as special cases of an abstract problem Suppose we are given a function called cost) that takes a positive integer h as input and outputs an integer cost(h). Given a decomposition of w into u1,U2,...,ur (that is, w uUur) we can define the cost of the decomposition as Σί-i cost(w)
For example if we define cost(h) - 1 for all h 2 1 then finding a minimum cost palindromic decomposition of a given string w is the same as finding a decomposition of w with as few palindromes as possible. Suppose we define cost) as follows: cost(h) - 1 for h < k and cost(h)-0 for h 2 k. Then finding a minimum cost palindromic decomposition would enable us to decide whether there is a decomposition in which all palindromes are of length at least k; it is possible iff the minimum cost is 0.
Describe an efficient algorithm that given black box access to a function cost), and a string w outputs the value of a minimum cost palindromic decomposition of w.

ansver
Answers: 2

Other questions on the subject: Physics

image
Physics, 21.06.2019 21:00, aruhter9485
Apulley with a mechanical advantage of 5 will require you to pull times the amount of rope. a. 1/5 b. 5 c. 10 d. 15
Answers: 2
image
Physics, 22.06.2019 06:30, bradleydb222
5submission this assignment is worth 20 points total. you are required to submit the following by next lab: 1. (3 points) determine the equation for the output angular velocity ω2 = θ˙ 2 as a function of θ1, ω1 = θ˙ 1 and α. you must show all your work to receive credit. 2. (2 points) use the result of problem#1 to plot ω2 over 0 ≤ θ1 ≤ 360deg with ω1 = 360deg/sec. do this for α = {10,30}deg. show the results on the same plot and properly label the axes, title, legend. for this you can use matlab or ms excel. 3. (3 points) determine the equation for the output angular acceleration ω˙ 2 and create a plot similar to the one in problem#2. 4. (10 points) submit plots of the results (ω2 and ω˙ 2) obtained from creo/mechanism and compare them to results of problem#2 and problem#3. note that you should do these comparisons for the two cases with α = {10,30}deg. 5. (2 points) provide a brief explanation of the results. did they match? what are the implications as misalignment angle increases?
Answers: 3
image
Physics, 22.06.2019 20:30, cupcake3103670
Aball is thrown from the top of a building with an initial velocity of 21.9 m/s straight upward, at an initial height of 51.6 m above the ground. the ball just misses the edge of the roof on its way down, as shown in the figure. (a) determine the time needed for the ball to reach its maximum height. (b) determine the maximum height. (c) determine the time needed for the ball to return to the height from which it was thrown, and the velocity of the ball at that instant. (d) determine the time needed for the ball to reach the ground. (e) determine the velocity and position of the ball at t = 5.35 s.
Answers: 1
image
Physics, 23.06.2019 01:00, dbanks701
Nthe 19th century, women were expected to conform to a certain role that entailed a. gaining domestic skills and establishing a career b. going to college and getting married c. getting married and having children d. graduating from college and being a housewife
Answers: 1
You know the right answer?
Recall that a palindrome is any string that is exactly the same as its reversal, like I, or DEED, or...

Questions in other subjects: