What is the probability that you hire exactly n times

Assignment Help Data Structure & Algorithms
Reference no: EM131060600

Question 1. What is the smallest value of n such that an algorithm whose running time is 100n2 runs faster than an algorithm whose running time is 2n on the same machine?

Question 2. Consider the searching problem:

Input: A sequence of n numbers A = (a1 , a2,....., an) and a value v.

Output: An index i such that v = A[i] or the special value NIL if v does not appear in A.

Write pseudocode for linear search, which scans through the sequence, looking for v. Using a loop invariant, prove that your algorithm is correct. Make sure that your loop invariant fulfills the three necessary properties.

Question 3. Use mathematical induction to show that when n is an exact power of 2, the solution of the recurrence

T(n) = {2              if n =2

            2T(n/2)     if n = 2k, for k > 1

is T(n) = nlg n.

Question 4. We can express insertion sort as a recursive procedure as follows. In order to sort A[1 .. n], we recursively sort All n - 1] and then insert A[I] into the sorted array A[1 .. n - 1].

Write a recurrence for the running time of this recursive version of insertion sort.

Question 5. We can extend our notation to the case of two parameters n and m that can go to infinity independently at different rates. For a given function g(n, m), we denote, by O(g (n, m)) the set of functions

O(g (n m)) = {f(n, m) : in there exist positive constants c, no and mo

                                        such that 0 ≤ f(n, m) ≤ cg(n, m)

                                        for all n ≥ no or m ≥ mo} .

Give corresponding definitions for Ω(g (n m)) and Θ(g(n, m)).

Question 6. Write pseudocode for the brute-force method of solving the maximum-subarray problem. Your procedure should run in Θ(n2) time.

Question 7. Show that the solution of T(n) = T(n - 1) + n is O(n2).

Question 8. Use the master method to give tight asymptotic bounds for the following recur-rences.

a. T(n) = 2T(n/4) + 1.
b. T(n) = 2T(n / 4) + √n.
c. T(n) = 2T (n /4) n.
d. T(n) = 2T (n/4) + n2.

In HIRE-ASS1STANT, assuming that the candidates are presented in a random order, what is the probability that you hire exactly one time? What is the probability that you hire exactly n times?

Reference no: EM131060600

Questions Cloud

Which coding system you would use for each diagnosis : Decide which coding system you would use for each diagnosis and procedure/service that you have abstracted or found in your documentation.
Problem regarding the administrative costs : What would have to be charged to the patient/employer if the HMO had administrative costs equaling 10 percent of its costs and it wanted a profit margin of 7 percent?
Discuss how a smaller page frame size : Consider a scenario where a computer system has a small number of active processes using a large amount of their virtual address space
Investment includes expenses for land : Imagine that you have invested $1 million in a McDonald's franchise restaurant.  The investment includes expenses for land, buildings, and franchise fees.
What is the probability that you hire exactly n times : What is the smallest value of n such that an algorithm whose running time is 100n2 runs faster than an algorithm whose running time is 2n on the same machine?
Unanticipated inflation harm the country : If actual inflation exceeds anticipated inflation, who will lose purchasing power, and who will gain? How does unanticipated inflation harm the country? As part of your answer, include how you and your employer would both be affected.
Statement of constitutional issues : We have to made from respondet (commonwealth), external affair file is material file.. STATEMENT OF CONSTITUTIONAL ISSUES, STATEMENT OF FACTS and ARGUMENTS FOR THE RESPONDENT
Interest exist in a pure exchange economy : Would interest exist in a pure exchange economy where no production occurred? Explain. Briefly contrast the static and dynamic views of monopoly and the policies appropriate for each.
Benefit and total cost from a continuous activity : Suppose that the total benefit and total cost from a continuous activity are, respectively, given by the following equations:

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement the selection sort algorithm for sorting an array

Implement the Selection Sort algorithm for sorting an array of n elements. This algorithm has n-1 iterations, each selecting the next largest element a[j] and swapping it with the ele- ment that is in the position where a[j] should be.

  Computing hash value for message

For a message, he computes the hash value H = (VChar 1 x VChar 2 x VChar 3 ...x VChar N) mod(26).

  Creating the flowchart for the decision structure

A telephone corporation service plan charges twenty-five cents for each call made. In addition, it charges five cents a minute for all calls made to a phone number that has a service plan with the corporation.

  State how you would recover the actual set s given a .

Prove correctness of your greedy algorithm by stating and proving the loop invariant.

  I this assignment you will implement the compact

in this assignment you will implement the compact representation of the compressed suffix trie adt for dna analyses.a

  Explain spacewise efficient implementation two-stack data

Structure of such two-stack data type would consist of two arrays and two top pointers. Describe why this may not be a spacewise efficient implementation.

  Develop a profile of various projects for risk visibility

A key point in project portfolio management is that the IT manager must determine the risk associated with each project and develop a profile of various projects for risk visibility.

  Write an algorithm for computing total flight time

Write an algorithm for computing total flight time and the horizontal distance traveled by the cannon ball for the problem discussed in class?

  Explaining augmented red-black tree

Consider T be augmented red-black tree, where each node x has attribute x.size, which is number of internal nodes in subtree rooted at x. Given such augmented red-black tree T.

  Function to swap all the left-right subtrees of binary tree

Write a function, swapSubTrees, that swaps all of the left and right subtrees of a binary tree. write a method singleParent, that returns the number of nodes in a binary tree that have only one child.

  What is the annual compound interest rate

What is the annual compound interest rate

  Inventory tracking database

Construct a relational database of your choice. The DB should contain no more than six tables. Define three business requirements that this database will provide.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd