30 prove that in bit string the string 01 occurs at most one


#30) prove that in bit string, the string 01 occurs at most one time than the string 10

b) S = {(a, b) | a Z+, b E c) S={(a, b) la € Z+.beZ*..nohla+b) ition of the functions max and , a) and min(a,a....an) l minimum of the n numbers ely bi, bo...., bn be real numbers. ions that you gave in Exercise 20 29. Give a recursive definition of each of these sets of or- dered pairs of positive integers. Use structural indaction to prove that the recursive definition you found is correc [Hint: To find a recursive definition, plot the points in the set in the plane and look for patterns ) -4) =-min(ai, a2. . . . , an) , an) + max(bi,b2,....ba) 2,a + bn) 30. Prove that in a bit string,te 0 us an) + min(bi,b....bn) 31. Deh 31. Define well formed f ed by 1 Sands +te S when the set of positive integers

Solution

I wish to use structural induction for this proof.

Let * be the set of all strings over the alphabet . Let P(w) be the proposition \"in the bit string w, the string 01 occurs at most one more time than the string 10\".

Basis step: P(), where is the empty string, is true, because there are 0 strings 01 and 0 strings 10.

Recursive step: Here, I have to show that, if P(w) is true for some arbitrary w belonging to *, then P(wx) is true, where x belongs to . In other words, wx (the bit string w with one more bit x added to it) also has at most one 01 more than 10.

Suppose that P(w) is true. Then, in the bit string w, the string 01 occurs at most one more time than the string 10.

The bit string w can only end in 0 or in 1. When the bit x (which can be 0 or 1) is added, four possibilities occur:

1) w ends in 1 and x ends in 0. In this case, P(wx) is true, because wx has no extra 01\'s.

2) w ends in 0 and x ends in 0. In this case, P(wx) is also true.

3) w ends in 1 and x ends in 1. In this case, P(wx) is also true.

4) w ends in 0 and x ends in 1.

We have a problem in the last case, because there is one \"01\" added. By the inductive hypothesis, if w has at most one extra 01, then the proof would fail.

To complete the proof, I have to show that, if w ends in 0, it cannot have more 01\'s than 10\'s.

Here is an informal attempt. I will try to build w adding bits to it, and show that, if it ends with 0, for every 01 there will be a 10:

Suppose w is initially one or more 0\'s. If I add one or more 1\'s, then there would be one 01. If I add one 0, there will be one 10 to balance with that 01. If I keep adding 0\'s, the situation won\'t change. The only way to add one extra 01 would be to add one or more 1\'s. If I add one or more 0\'s to the end, one more 10 will be added and the number of 10\'s and 01\'s will be equal again.

By the above reasoning, if w ends in 0 and begins in 0, the number of 10\'s will always equal the number of 01\'s.

If w begins in one or more 1\'s, I can add 0 and apply the same reasoning as above, only that there will be one extra 10.

 #30) prove that in bit string, the string 01 occurs at most one time than the string 10 b) S = {(a, b) | a Z+, b E c) S={(a, b) la € Z+.beZ*..nohla+b) ition of

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site