Question

Problem 3 - use the following definition of permutation below: List A is a permutation of...

Problem 3 - use the following definition of permutation below:

List A is a permutation of list B if any of the following are true:

- list A and list B are both null, otherwise

- a.head=b.head, and a.tail is a permutation of b.tail

- a.head≠b.head, and there exists a list C such that

- a.tail is a permutation of b.head:c, and

- b.tail is a permutation of a.head:c

a) Use induction to prove that any finite list is a permutation of itself-in other words, that the permutation relation is reflexive.

b) Using the recursive definition of permutation above, use induction to prove that if list a is a permutation of list b, then list b is a permutation of list a-in other words, that the permutation relation is symmetric.

Homework Answers

Answer #1

Defintion of permutation of list : List a is a permutation of list b if any of the following are true: CASE 1) both lists are null, CASE 2) a.head = b.head, and a.tail is a permutation of b.tail, CASE 3) a.head ≠ b.head and there exists another list.

Your base case is when the list is null. Assume that the property holds for a list of length

nn, and look at lists of length n+1n+1.

Now we can split the list into head and tail. The tail is a list of length nn. Apply the above definitions, but keep in mind that a=ba=b.

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
1. Use mathematical induction to show that, ∀n ≥ 3, 2n2 + 1 ≥ 5n 2....
1. Use mathematical induction to show that, ∀n ≥ 3, 2n2 + 1 ≥ 5n 2. Letting s1 = 0, find a recursive formula for the sequence 0, 1, 3, 7, 15,... 3. Evaluate. (a) 55mod 7. (b) −101 div 3. 4. Prove that the sum of two consecutive odd integers is divisible by 4 5. Show that if a|b then −a|b. 6. Prove or disprove: For any integers a,b, c, if a ∤ b and b ∤ c, then...
QUESTION 1 For the following recursive function, find f(5): int f(int n) { if (n ==...
QUESTION 1 For the following recursive function, find f(5): int f(int n) { if (n == 0)    return 0; else    return n * f(n - 1); } A. 120 B. 60 C. 1 D. 0 10 points    QUESTION 2 Which of the following statements could describe the general (recursive) case of a recursive algorithm? In the following recursive function, which line(s) represent the general (recursive) case? void PrintIt(int n ) // line 1 { // line 2...
) Let α be a fixed positive real number, α > 0. For a sequence {xn},...
) Let α be a fixed positive real number, α > 0. For a sequence {xn}, let x1 > √ α, and define x2, x3, x4, · · · by the following recurrence relation xn+1 = 1 2 xn + α xn (a) Prove that {xn} decreases monotonically (in other words, xn+1 − xn ≤ 0 for all n). (b) Prove that {xn} is bounded from below. (Hint: use proof by induction to show xn > √ α for all...
A list of economic terms is shown below. Match each term with its definition. A. Production...
A list of economic terms is shown below. Match each term with its definition. A. Production B. Physical Capital C. Short run D. Long run E. Marginal product F. Specialization G. Law of diminishing returns Place the letter that is shown in front of each term above with that? term's definition. Use only the appropriate letter. Do not write out the term or include the period after the letter. Letter Definition 1. ?Increases in inputs eventually lead to less additional...
Write a Turing-machine style of algorithm to decide the language L1 given below. Use specific, precise,...
Write a Turing-machine style of algorithm to decide the language L1 given below. Use specific, precise, step-by-step English. So, describe how to test whether or not an input string is in the language L1 in finite time. No need to write a state diagram. L1 = {w : every ‘a’ within w is to the left of every ‘b’ within w} over the following alphabet Σ = {a, b, c}. In other words, you’re not allowed to have any ‘b’...
Must satisfy the following: Define a function named series. This function will accept two arguments, both...
Must satisfy the following: Define a function named series. This function will accept two arguments, both integers, named base and span. The function will compute the sum of the integers, starting at the value of base and down to 0 (zero) that are span apart. In other words, if base is 19 and span is 3, series will compute the sum of 19 + 16 + 13 + 10 + 7 + 4 + 1. The series function does not...
Prove that for a square n ×n matrix A, Ax = b (1) has one and...
Prove that for a square n ×n matrix A, Ax = b (1) has one and only one solution if and only if A is invertible; i.e., that there exists a matrix n ×n matrix B such that AB = I = B A. NOTE 01: The statement or theorem is of the form P iff Q, where P is the statement “Equation (1) has a unique solution” and Q is the statement “The matrix A is invertible”. This means...
Use the description of a scenario below to answer the following problem. Note: this is identical...
Use the description of a scenario below to answer the following problem. Note: this is identical to the scenario described above. Organic waste deposited into a lake will cause a decrease in the oxygen concentration in milligrams per liter of the water. Assume organic waste is deposited into the lake at year t=0 and the oxygen concentration is modeled by O(t)=t3−3t2+22 for three years following the event. ---- What is the non-zero value of t that maximizes the oxygen concentration...
I'm working in a 6 page research paper and below is the complete list of the...
I'm working in a 6 page research paper and below is the complete list of the paper has to be set up and the required things needed to be included. Can you check to see what is already included on the list and what is missing in my paper. Also, what I need to improve and how? My topic is "The Struggles of Epilepsy". Can you help me with the content (background, empirical research, and hypothesis )? I also need...
Use the following statements to answer the question: I. Consider the problem of negotiating the price...
Use the following statements to answer the question: I. Consider the problem of negotiating the price of a rug that costs $200 to make. If there are two buyers (one with a maximum willingness-to-pay of $200 and one with a maximum willingness-to-pay of $250), then the situation is a noncooperative game. II. The likely outcome from the game described in statement I is that the second buyer will bid a price slightly above $200 (e.g., $201) to win the rug.               ...