Question

Let x be a string of length n, and let y be a string of length...

Let x be a string of length n, and let y be a string of length nk, for

1 ≤ k < n.

We wish to line up the symbols in x with the symbols in y by adding k blanks to y.

Suppose that we add two separate blocks of blanks, one of size i and one of size

k − i,

for

1 ≤ i < k.

How many ways are there to do this?

Every solution I have found on Chegg Study says the answer is n-k+1 ways; but this answer is incorrect.

Homework Answers

Answer #1

We first determine the number of ways of creating the blocks of spaces. That only depends on the number of ways of choosing which is .

Now, we determine the number of ways of putting the two blocks of spaces in the string . The length of string is , hence the possible number of gaps is . Thus, the total number of ways of selecting gaps is and hence the total number of ways to do this is .

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
Let X ∼ N(0, 1), ∼ N(0, 1). Let Y = 1.75 + 2X + ....
Let X ∼ N(0, 1), ∼ N(0, 1). Let Y = 1.75 + 2X + . Generate 100 samples for (X, Y ). Use the generated data to fit a linear regression. (a) Report the fitted coefficients and intercept. (b) Draw a scatter plot of (X, Y ). Add the fitted line and the real line to the scatter plot with different color. Using R
n digit string of length n over alphabet {0,1, . . . ,9} a. How many...
n digit string of length n over alphabet {0,1, . . . ,9} a. How many n digit strings are there with at least one 1? b. many n digit are there with EXACTLY one 1? PLEASE ANSWER BOTH AND INCLUDE THE FACT THAT THE STRING IS OVER ALPHABET {0,1,2,3,4....9}
Let X denote the wing length in millimeters of a male gallinule and Y the wing...
Let X denote the wing length in millimeters of a male gallinule and Y the wing length in millimeters of a female gallinule. Assume that X is N(184.09,39.37) and Y is N(171.93, 48.88) and that X and Y are independent. If a male and a female gallinule are captured, what is the probability that X is greater than Y?  
Let T(n) be the runtime of the following isPalindrome() method which accepts a string of length...
Let T(n) be the runtime of the following isPalindrome() method which accepts a string of length n: public boolean isPalindrome(String str) { if (str.length() < 2) return true; if (str.charAt(0) != str.charAt(str.length()-1)) return false; return isPalindrome(str.substring(1, str.length()-1)); } Assuming each line of code (like each semicolon) counts as one instruction, choose the most appropriate recurrence that describes the runtime of isPalindrome(). Select one: a. T(n) = 3n + T(n-2), T(1) = 1, T(0) = 1 b. T(n) = 3n +...
Assume that X~N(0, 1), Y~N(0, 1) and X and Y are independent variables. Let Z =...
Assume that X~N(0, 1), Y~N(0, 1) and X and Y are independent variables. Let Z = X+Y, and joint density of Y and Z is expressed as f(y, z) = g(z|y)*h(y) g(z|y) is conditional distribution of Z given y, and h(y) is density of Y how can i get f(y, z)?
Let X ~ N (1, 2^2) and Y ~ N (2, 2^2). Suppose that X and...
Let X ~ N (1, 2^2) and Y ~ N (2, 2^2). Suppose that X and Y are independent. Let U = X + Y and V = X ̶Y. Show that U and V are independent normal random variables. Find the distribution of each of them.
1.) Let f(x,y) =x^2+y^3+sin(x^2+y^3). Determine the line integral of f(x,y) with respect to arc length over...
1.) Let f(x,y) =x^2+y^3+sin(x^2+y^3). Determine the line integral of f(x,y) with respect to arc length over the unit circle centered at the origin (0, 0). 2.) Let f ( x,y)=x^3+y+cos( x )+e^(x − y). Determine the line integral of f(x,y) with respect to arc length over the line segment from (-1, 0) to (1, -2)
A Bernoulli differential equation is one of the form dy/dx+P(x)y=Q(x)y^n (∗) Observe that, if n=0 or...
A Bernoulli differential equation is one of the form dy/dx+P(x)y=Q(x)y^n (∗) Observe that, if n=0 or 1, the Bernoulli equation is linear. For other values of n, the substitution u=y^(1−n) transforms the Bernoulli equation into the linear equation du/dx+(1−n)P(x)u=(1−n)Q(x). Consider the initial value problem xy′+y=−8xy^2, y(1)=−1. (a) This differential equation can be written in the form (∗) with P(x)=_____, Q(x)=_____, and n=_____. (b) The substitution u=_____ will transform it into the linear equation du/dx+______u=_____. (c) Using the substitution in part...
Let M be an n x n matrix with each entry equal to either 0 or...
Let M be an n x n matrix with each entry equal to either 0 or 1. Let mij denote the entry in row i and column j. A diagonal entry is one of the form mii for some i. Swapping rows i and j of the matrix M denotes the following action: we swap the values mik and mjk for k = 1,2, ... , n. Swapping two columns is defined analogously. We say that M is rearrangeable if...
Two waves are generated on a string of length 5.1 m to produce a three-loop standing...
Two waves are generated on a string of length 5.1 m to produce a three-loop standing wave with an amplitude of 5.0 cm. The wave speed is 119 m/s. Let the equation for one of the waves be of the form y(x, t) = ym sin (kx + ωt). In the equation for the other wave, what are (a) ym, (b) k, (c) ω, and (d) the sign in front of ω?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT