For each n N with n > 2, let Zn be the set that contains all...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
For each n N with n > 2, let Zn be the set that contains all strings of length n with 2 b's and (n - 2) a's, in any order. (For example, I₁ = {aabb, abab, abba, baab, baba, bbaa}.) 2 Note that In] =() = (-1) because each element of In is made up of n individual characters, all but two of which are equal to a, and there are exactly (2) many different ways to choose the 2 positions that will contain b. (a) [1 mark] Let n N with n > 2, and let k be the value returned by alpha min(s), for some input $ € In. Write an expression for the "exact" number of steps executed by alpha min(s), in terms of n and k. Show your work (explain how you count your steps and how you arrive at your answer). (b) [1 mark] What is the exact average-case running time of alpha min over the set of inputs Z4? Give your answer in the form of a simplified, concrete rational number (like 17/5). Show your work (explain what you are calculating at each step). (c) [3 marks] For each nN such that I, is defined, and each possible return value k for alpha min, give an exact expression for the number of inputs s € In for which alpha min(s) returns k. In other words, calculate |{s € Zn| alpha min(s) returns k}. Show your work (explain how you obtain your expression, and how it relates to the algorithm). (d) [3 marks] Perform an average-case analysis of alpha min, for the input set I, defined above. Give an exact expression (without using Big-O/Omega/Theta). Show your work. In particular, your answer should be expressed in the form of a sum before you simplify it to a closed-form expression. HINT: You may use the following fact. 32 Σ²² = n(n+1)(2n+1) i=1 For each n N with n > 2, let Zn be the set that contains all strings of length n with 2 b's and (n - 2) a's, in any order. (For example, I₁ = {aabb, abab, abba, baab, baba, bbaa}.) 2 Note that In] =() = (-1) because each element of In is made up of n individual characters, all but two of which are equal to a, and there are exactly (2) many different ways to choose the 2 positions that will contain b. (a) [1 mark] Let n N with n > 2, and let k be the value returned by alpha min(s), for some input $ € In. Write an expression for the "exact" number of steps executed by alpha min(s), in terms of n and k. Show your work (explain how you count your steps and how you arrive at your answer). (b) [1 mark] What is the exact average-case running time of alpha min over the set of inputs Z4? Give your answer in the form of a simplified, concrete rational number (like 17/5). Show your work (explain what you are calculating at each step). (c) [3 marks] For each nN such that I, is defined, and each possible return value k for alpha min, give an exact expression for the number of inputs s € In for which alpha min(s) returns k. In other words, calculate |{s € Zn| alpha min(s) returns k}. Show your work (explain how you obtain your expression, and how it relates to the algorithm). (d) [3 marks] Perform an average-case analysis of alpha min, for the input set I, defined above. Give an exact expression (without using Big-O/Omega/Theta). Show your work. In particular, your answer should be expressed in the form of a sum before you simplify it to a closed-form expression. HINT: You may use the following fact. 32 Σ²² = n(n+1)(2n+1) i=1
Expert Answer:
Answer rating: 100% (QA)
a The algorithm alphamins aims to find the minimum number of steps required to sort a string s conta... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these accounting questions
-
A bond has an annual coupon of 5%, which makes semiannual payments. The next payment is 3 months away. The bonds quoted price is 105.1 with par of $1000, what is the bond's dirty price? (Please use...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
Plainbank has $10 million in cash and equivalents, $30 million in loans, and $15 in core deposits. a. Calculate the financing gap. b. What is the financing requirement? c. How can the financing gap...
-
Intravenous infusions are usually driven by gravity by hanging the fluid bottle at sufficient height to counteract the blood pressure in the vein and to force the fluid into the body. The higher the...
-
TRUE/FALSE 1. The idea that current cases must be decided based on earlier cases is called legal positivism. 2. Civil lawsuits are brought to court by the injured party, but criminal cases must be...
-
The following are the balances of the assets, liabilities, and equity of Kite Runner, Inc., at August 31, 2010: Requirements 1. What type of business organization is Kite Runner, Inc.? 2. Prepare the...
-
Presented below is information related to Farr Company. Retained earnings, December 31, 2010 ............. $ 650,000 Sales ........................... 1,400,000 Selling and administrative expenses...
-
If a municipal bond returns 6% and you pay taxes at the marginal rate of 35%, what rate would a taxable corporate bond of similar risk have to offer before you would consider investing in it?
-
You are performing the year-end audit of Halvorson Fine Foods, Inc. for December 31, 2024. The client has prepared the following schedule for the fixed assets and related allowance for depreciation...
-
Find the missing coordinate r, given the slope. 19) (12, 10) and (2, r) m = 20) (-11, r) and (12, 5); m = 0 Calculate Using the Slope formula and cross- multiplication 2 - 1 m 3D 21) (-4,9) and (r,...
-
Which of the following procedures would an auditor most likely perform in planning a financial statement audit? a. Inquiring of the client's legal counsel concerning pending litigation. b. Comparing...
-
Is $\mathrm{O}(2)$ an Abelian or a non-Abelian group?
-
Which of the following procedures would an auditor normally plan only for a first-time audit? a. Review litigation against the company that was settled in prior years. b. Review capital stock...
-
Prove that the cyclic group of order 3 does not have proper subgroups.
-
Prior to beginning interim work on a recurring audit, an auditor makes a preliminary judgment about materiality. Which of the following would not be an appropriate base for this decision? a....
-
Draw the phase diagram of a typical substance indicating the coexistence curves and the two special points. How are the chemical potentials of the phases related in the different regions and on the...
-
Digital Fruit is financed solely by common stock and has outstanding 25 million shares with a market price of $10 a share. It now announces that it intends to issue $160 million of debt and to use...
-
The Equity Premium Puzzle: Investments in equities (like stocks) yield substantially higher returns than investment in bonds. By itself, this is no surprisebecause stocks are riskier than bonds. What...
-
Consider inventions such as washing machines or self-propelled vacuum cleaners. Such inventions reduce the amount of time individuals have to spend on basic household chores and thus in essence...
-
One of the conditions we identified as important to the first welfare theorem is that there are no externalities. One of the most important externalities in the real world is pollution from...
-
Which of the following controls is most likely to help ensure that all credit revenue transactions of an entity are recorded? a. The billing department supervisor sends a copy of each approved sales...
-
If accounts receivable turnover (credit sales/receivables) was 7.1 times in 2009 compared to only 5.6 times in 2010, it is possible that there were a. Unrecorded credit sales in 2010. b. Unrecorded...
-
Smith Corporation has numerous customers. A customer file is kept on disk. Each customer file contains a name, an address, a credit limit, and an account balance. The auditor wishes to test this file...
Study smarter with the SolutionInn App