Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

a) Give a recursive definition of the length of a string.

b) Use the recursive definition from part (a) and structural induction to prove that\(l\left( {xy} \right) = l\left( x \right) + l\left( y \right)\).

Short Answer

Expert verified

a) Length of the string is\(l\left( {{b_1},{b_2},{b_3},\_\_\_\_{b_{n - 1}}} \right) = l\left( {{b_1},{b_2},{b_3},\_\_\_\_{b_{n - 1}}} \right) + 1\).

b) Thus, prove\(l\left( {xy} \right) = l\left( x \right) + l\left( y \right)\).

Step by step solution

01

Recursively Defined Functions.

We use two steps to define a function with the set of non-negative integers as the domain.

Basis step:-Enter a function value of zero.

Recursive step:-Give a rule for finding its value on an integer from its value on smaller integers.

02

Structural induction.

Structural induction is used to show that some statement P(x) holds for all x of some recursively defined structure such as formulas, lists, or trees.

03

Step 3:a) Give a recursive definition of the length of a string.

1) Solution.

Let the empty string \(\lambda \) has length\(0\).

\(l\left( \lambda \right) = 0\)

\({b_1},{b_2},{b_3},\_\_\_\_{b_{n - 1}}{b_n},\)

Then its length is one greater than the length of the string, \({b_1},{b_2},{b_3},\_\_\_\_{b_{n - 1}}\).

\(l\left( {{b_1},{b_2},{b_3},\_\_\_\_{b_{n - 1}}} \right) = l\left( {{b_1},{b_2},{b_3},\_\_\_\_{b_{n - 1}}} \right) + 1\).

04

prove that\(l\left( {xy} \right) = l\left( x \right) + l\left( y \right)\).

1) Explanation.

In the given question,

\(l\left( {xy} \right) = l\left( x \right) + l\left( y \right)\).

2)Basic step.

Let,

\(\begin{array}{c}\lambda = 0\\l\left( {\lambda \lambda } \right) = l\left( \lambda \right)\\ = 0\\ = l\left( \lambda \right) + l\left( \lambda \right)\end{array}\)

The statement holds for the basic step.

3) Recursive Step

Let\(l\left( x \right) = n{\rm{ and }}l\left( y \right) = m\).

Here let,

\(\begin{array}{c}x = {x_1}{x_2} - - - {x_n}\\y = {y_1}{y_2} - - - {y_m}\end{array}\)

4) Solution.

Here prove\(l\left( {xy} \right) = l\left( x \right) + l\left( y \right)\).

\(\begin{array}{c}l\left( {xy} \right) = l\left( {{x_1}{x_2} - - - {x_n}{y_1}{y_2} - - - {y_m}} \right)\\ = l\left( {{x_1}{x_2} - - - {x_n}{y_1}{y_2} - - - {y_{m - 1}}} \right) + 1\\ = l\left( {{x_1}{x_2} - - - {x_n}{y_1}{y_2} - - - {y_{m - 2}}} \right) + 2\\ \vdots \\ = l\left( {{x_1}{x_2} - - - {x_n}} \right) + m\\ = l\left( x \right) + m\\ = l\left( x \right) + l\left( y \right)\end{array}\)

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

In the proof of Lemma 1 we mentioned that many incorrect methods for finding a vertex such that the line segment is an interior diagonal of have been published. This exercise presents some of the incorrect ways has been chosen in these proofs. Show, by considering one of the polygons drawn here, that for each of these choices of , the line segment is not necessarily an interior diagonal of .

a) p is the vertex of P such that the angleโˆ abpis smallest.

b) p is the vertex of P with the least -coordinate (other than ).

c) p is the vertex of P that is closest to .

How many additions are used by the recursive and iterative algorithms given in Algorithm 7 and 8, respectively, to find the Fibonacci numberf7 ?

How does the number of multiplications used by the algorithm in Exercise 24 compare to the number of multiplications used by Algorithm 2 to evaluatea2n ?

Let P(n)be the statement that when nonintersecting diagonals are drawn inside a convex polygon with sides, at least two vertices of the polygon are not endpoints of any of these diagonals.

a) Show that when we attempt to prove P(n)for all integers n with nโ‰ฅ3using strong induction, the inductive step does not go through.

b) Show that we can prove that P(n)is true for all integers n withnโ‰ฅ3 by proving by strong induction the stronger assertion Q(n), for nโ‰ฅ4, where states that whenever nonintersecting diagonals are drawn inside a convex polygon with sides, at least two nonadjacent vertices are not endpoints of any of these diagonals.

Prove that โˆ‘j=0nโ€Š(โˆ’12)j=2n+1+(โˆ’1)n3โˆ’2n whenever n is a nonnegative integer.

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free