Question

If s is a string, define its reverse s^R as follows.\begin{array}{|c|c|}\hline B. & \lambda^R = \lambda \\ \hline R. &

Discrete math
ANSWERED
asked 2021-05-16

If s is a string, define its reverse \(s^R\) as follows.
\(\begin{array}{|c|c|}\hline B. & \lambda^R = \lambda \\ \hline R. & \text{If s has one or more symbols, write} \\ & s = ra \\ & \text{where a is a symbol and r is a string (possibly empty). Then} \\ & s^R = (ra)^R = ar^R. \\ \hline \end{array}\)
Compute \((cubs)^R\). Justify each step using the definition.

Answers (1)

2021-05-17
Here, we need to compute the reverse of a stringusing the given definition of R and B. R is the recursive definition in which the last symbol is made the first symbol and R is applied on the rest of the string. The base case here that of the empty symbol i.e \(\lambda\) which is given in part B.
1. In the first step, R is applied on "cubs" which makes the symbol "s" to be the first symbol and then recursively R will be applied on "cub"
2. Similar to step 1, R is applied on "cub" and after "s", the next symbol will be "b" i.e. "sb" . R will now be applied on "cu"
3. Again, after applying R on "cu" , we get the next symbol to be "u" i.e "sbu". R will now be applied on "c".
4. Since, "c" is the last symbol, an empty string symbol is inserted before "c" so that R can be applied. This makes it "\(\lambda\)c". Now R will be applied on this.
5. After applying R, we get "c" to be the next symbol i.e. "sbuc". Now we are left with \(\lambda\).
6. Apply part B on \(\lambda\) which will give \(\lambda\) again.
7. Since \(\lambda\) is the empty string, it can be removed. Therefore, remove it. The reversed string becomes. "sbuc".
\(cubs^R\)
\(= s(cub)^R\)
\(= sb(cu)^R\)
\(= sbu(c)^R\)
\(= sbu(\lambda c)^R\)
\(= sbuc(\lambda)^R\)
\(= sbuc(\lambda\)
\(= sbuc\)
0
 
Best answer

expert advice

Need a better answer?

Relevant Questions

asked 2021-05-14
Consider the accompanying data on flexural strength (MPa) for concrete beams of a certain type.
\(\begin{array}{|c|c|}\hline 11.8 & 7.7 & 6.5 & 6 .8& 9.7 & 6.8 & 7.3 \\ \hline 7.9 & 9.7 & 8.7 & 8.1 & 8.5 & 6.3 & 7.0 \\ \hline 7.3 & 7.4 & 5.3 & 9.0 & 8.1 & 11.3 & 6.3 \\ \hline 7.2 & 7.7 & 7.8 & 11.6 & 10.7 & 7.0 \\ \hline \end{array}\)
a) Calculate a point estimate of the mean value of strength for the conceptual population of all beams manufactured in this fashion. \([Hint.\ ?x_{j}=219.5.]\) (Round your answer to three decimal places.)
MPa
State which estimator you used.
\(x\)
\(p?\)
\(\frac{s}{x}\)
\(s\)
\(\tilde{\chi}\)
b) Calculate a point estimate of the strength value that separates the weakest \(50\%\) of all such beams from the strongest \(50\%\).
MPa
State which estimator you used.
\(s\)
\(x\)
\(p?\)
\(\tilde{\chi}\)
\(\frac{s}{x}\)
c) Calculate a point estimate of the population standard deviation ?. \([Hint:\ ?x_{i}2 = 1859.53.]\) (Round your answer to three decimal places.)
MPa
Interpret this point estimate.
This estimate describes the linearity of the data.
This estimate describes the bias of the data.
This estimate describes the spread of the data.
This estimate describes the center of the data.
Which estimator did you use?
\(\tilde{\chi}\)
\(x\)
\(s\)
\(\frac{s}{x}\)
\(p?\)
d) Calculate a point estimate of the proportion of all such beams whose flexural strength exceeds 10 MPa. [Hint: Think of an observation as a "success" if it exceeds 10.] (Round your answer to three decimal places.)
e) Calculate a point estimate of the population coefficient of variation \(\frac{?}{?}\). (Round your answer to four decimal places.)
State which estimator you used.
\(p?\)
\(\tilde{\chi}\)
\(s\)
\(\frac{s}{x}\)
\(x\)
asked 2021-05-21
The pmf of the amount of memory X (GB) in a purchased flash drive is given as the following.
\(\begin{array}{|c|c|}\hline x & 1 & 2 & 4 & 8 & 16 \\ \hline p(x) & 0.05 & 0.10 & 0.30 & 0.45 & 0.10 \\ \hline \end{array} \)
a) Compute E(X). (Enter your answer to two decimal places.) GB
b) Compute V(X) directly from the definition. (Enter your answer to four decimal places.) \(GB^{2}\)
c) Compute the standard deviation of X. (Round your answer to three decimal places.) GB
d) Compute V(X) using the shortcut formula. (Enter your answer to four decimal places.) \(GB^{2}\)
asked 2021-06-13
1. Who seems to have more variability in their shoe sizes, men or women?
a) Men
b) Women
c) Neither group show variability
d) Flag this Question
2. In general, why use the estimate of \(n-1\) rather than n in the computation of the standard deviation and variance?
a) The estimate n-1 is better because it is used for calculating the population variance and standard deviation
b) The estimate n-1 is never used to calculate the sample variance and standard deviation
c) \(n-1\) provides an unbiased estimate of the population and allows more variability when using a sample and gives a better mathematical estimate of the population
d) The estimate n-1 is better because it is use for calculation of both the population and sample variance as well as standard deviation.
\(\begin{array}{|c|c|}\hline \text{Shoe Size (in cm)} & \text{Gender (M of F)} \\ \hline 25.7 & M \\ \hline 25.4 & F \\ \hline 23.8 & F \\ \hline 25.4 & F \\ \hline 26.7 & M \\ \hline 23.8 & F \\ \hline 25.4 & F \\ \hline 25.4 & F \\ \hline 25.7 & M \\ \hline 25.7 & F \\ \hline 23.5 & F \\ \hline 23.1 & F \\ \hline 26 & M \\ \hline 23.5 & F \\ \hline 26.7 & F \\ \hline 26 & M \\ \hline 23.1 & F \\ \hline 25.1 & F \\ \hline 27 & M \\ \hline 25.4 & F \\ \hline 23.5 & F \\ \hline 23.8 & F \\ \hline 27 & M \\ \hline 25.7 & F \\ \hline \end{array}\)
\(\begin{array}{|c|c|}\hline \text{Shoe Size (in cm)} & \text{Gender (M of F)} \\ \hline 27.6 & M \\ \hline 26.9 & F \\ \hline 26 & F \\ \hline 28.4 & M \\ \hline 23.5 & F \\ \hline 27 & F \\ \hline 25.1 & F \\ \hline 28.4 & M \\ \hline 23.1 & F \\ \hline 23.8 & F \\ \hline 26 & F \\ \hline 25.4 & M \\ \hline 23.8 & F \\ \hline 24.8 & M \\ \hline 25.1 & F \\ \hline 24.8 & F \\ \hline 26 & M \\ \hline 25.4 & F \\ \hline 26 & M \\ \hline 27 & M \\ \hline 25.7 & F \\ \hline 27 & M \\ \hline 23.5 & F \\ \hline 29 & F \\ \hline \end{array}\)
asked 2021-05-13

Here are the row and column totals for a two-way table with two rows and two columns:\( \begin{array}{ll|r} a & b & 50 \\ c & d & 50 \\ \hline 60 & 40 & 100 \end{array}\) Find two different sets of counts a, b, c, and d for the body of the table that give these same totals. This shows that the relationship between two variables cannot be obtained from the two individual distributions of the variables.

...