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
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?  
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}
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 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 +...
1. Let x = [−1,2,4,5]T, and let y = [2,1,−5,4]T. (a) Are x and y orthogonal?...
1. Let x = [−1,2,4,5]T, and let y = [2,1,−5,4]T. (a) Are x and y orthogonal? How can you tell? (b) Calculate x ̄ and y ̄. (c) Calculate the sample variance of y. (d) Calculate (sum){n, i=1, [(xi − x ̄) (yi − y ̄)].
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 X, Y be random variables. Also let X|Y = y ~ Poisson(y) and Y ~...
let X, Y be random variables. Also let X|Y = y ~ Poisson(y) and Y ~ gamma(a,b) is the prior distribution for Y. a and b are also known. 1. Find the posterior distribution of Y|X=x where X=(X1, X2, ... , Xn) and x is an observed sample of size n from the distribution of X. 2. Suppose the number of people who visit a nursing home on a day is Poisson random variable and the parameter of the Poisson...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT