Purchase Solution

# Discrete structures: Sample questions

Not what you're looking for?

6. A string that contains only 0s 1s and 2s is called a ternary string
a) find a recurrence relation for the number of ternary strings that contain two consecutive 0s
b) what are the initial conditions
c) how many ternary strings of length six contain two consecutive 0s

The next 3 problems deal with a variation of the Josephus problem described by Graham, Knuth, and Patashnik in [GrKnPa94].? This problem is based on an account by the historian Flauvius Josephus, who was part of a band of 41 Jewish rebels trapped in a cave by the Romans during the Jewish-Roman war of the first century.? The rebels pre-ferred suicide to capture; they decided to form a circle and to repeatedly count off around the circle, killing every 3rd rebel left.? However, josephus and another rebel did not want to be killed this way; they determined the positions where they should stand to be the last two rebels remaining alive.? The variation we consider begins with n people, numbered 1 to n, standing around a circle.? In each stage, every second person still left alive is eliminated until only one survives.? We denote the number of the survivor by J(n).

7) Determine the value of J(n) for each integer n with 1 <= n <= 16.? Use these values to conjecture a formula for J(n).? Hint: Write n=2^m +k, where m is a nonnegative integer and k is a nonnegative integer less than 2^m.

8) Show that J(n) satisfies the recurrence relation J(2n) = 2J(n) - 1 and J(2n+1) = 2J(n) + 1, for n >= 1, and J(1) = 1.

9) Use mathematical induction to prove that the formula you conjectured in exercise 50, making use of the recurrence relation from the previous exercise.

10) a. Assume that in the average case, the running time for Quicksort is f(n) = 2f(n/2)+ n. Use the Master Theorem to estimate its closed-form running time.

b. Do the same for Slowsort, whose running time is f(n) = 4f(n/2)+n.

##### Solution Preview

6).a) Let t(n) denote the number of ternary string with length n containing two consecutive 0s. For a ternary string a1a2...an, if a1=0, then the number of such string is 3^(n-1). and the number of the strings satisfying a1=0 and a2= is 2*3^(n-2). We can ...

Solution provided by:
###### Education
• BSc , Wuhan Univ. China
• MA, Shandong Univ.
###### Recent Feedback
• "Your solution, looks excellent. I recognize things from previous chapters. I have seen the standard deviation formula you used to get 5.154. I do understand the Central Limit Theorem needs the sample size (n) to be greater than 30, we have 100. I do understand the sample mean(s) of the population will follow a normal distribution, and that CLT states the sample mean of population is the population (mean), we have 143.74. But when and WHY do we use the standard deviation formula where you got 5.154. WHEN & Why use standard deviation of the sample mean. I don't understand, why don't we simply use the "100" I understand that standard deviation is the square root of variance. I do understand that the variance is the square of the differences of each sample data value minus the mean. But somehow, why not use 100, why use standard deviation of sample mean? Please help explain."
• "excellent work"
• "Thank you so much for all of your help!!! I will be posting another assignment. Please let me know (once posted), if the credits I'm offering is enough or you ! Thanks again!"
• "Thank you"
• "Thank you very much for your valuable time and assistance!"

##### Solving quadratic inequalities

This quiz test you on how well you are familiar with solving quadratic inequalities.

##### Multiplying Complex Numbers

This is a short quiz to check your understanding of multiplication of complex numbers in rectangular form.

##### Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.

##### Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.

##### Geometry - Real Life Application Problems

Understanding of how geometry applies to in real-world contexts