Prove that for all positive real numbers a and b

Assignment Help Computer Engineering
Reference no: EM131433615

Q1. Little-Oh

Recall the definition of Big-Oh:

∃c ∈ R+, ∃n0 ∈ R+, ∀n ∈ N, n ≥ n0 ⇒ g(n) ≤ cf(n)

Here is one variation of this definition.

Definition 1 (little-oh). Let f, g : N → R≥0. We say that g is little-oh of f, and write g ∈ o(f), when:

∀c ∈ R+, ∃n0 ∈ R+, ∀n ∈ N, n ≥ n0 ⇒ g(n) ≤ cf(n)

This is a stronger property than Big-Oh, in the sense that if g ∈ o(f), then g ∈ O(f). While g ∈ O(f) says (colloquially) that "it is possible to scale up f so that it eventually dominates g," g ∈ o(f) says that "no matter how you scale f (up or down), it will always eventually dominate g." Or, in terms of rates of growth, g ∈ O(f) means that g grows at most as quickly as f, while g ∈ o(f) means that g grows strictly slower than f.

Prove the following statements about little-oh, using only the definitions of little-oh and Big-Oh. You may not use any external properties of Big-Oh in this question.

(a) Prove that for all positive real numbers a and b, if a < b then na ∈ o(nb).

(b) Prove that for all functions f, g : N → R+, if g ∈ o(f) then f ∉ O(g).

Note: we've restricted the range of f and g to exclude 0.

Q2. A tricky nested loop

Our goal for this question is to analyse the running time of the following function:

1 def nested(n):

2 """Assume n is an integer that is greater than 1."""

3 b = 1

4 while b <= n:   # Loop 1

5 i = 1

6 while i < b:       # Loop 2

7 print(i)

8 i = i * 3

9 b = b + 1

(a) First, prove that for all functions f, g : N → R+ and b ∈ R+, if all three of the following conditions are true:

(i) g(n) ∈ O(f(n))

(ii) f(n) and g(n) are eventually ≥ b [Correction: this used to say ≥ 1]

(iii) b > 1

then logb(g(n)) ∈ O(logbf(n)).

You may not use any external properties about Big-Oh; we're looking for you to prove this statement using the definition of Big-Oh.

(b) Find an exact expression for the total number of iterations of the inner loop of nested, in terms of the function's input n. Your expression may contain summation notation (e.g., i=1ni); you do not need to simplify it here. Make sure to use the floor and/or ceiling functions to ensure that you're counting with natural numbers.

(c) Determine, with proof, a good upper bound (Big-Oh only) on the running time of nested, in terms of the value of its input n. Note that by \good" we mean that it should be possible to prove the matching Omega lower bound, even though we are not requiring it here.

You can use the statement you proved in part (a), and your solution to part (b), and the following external facts:

∀x ∈ R, x ≤ ⌈x⌉ < x + 1                                                    (Fact 1)

n! ∈ Θ (en ln n - n + ½ ln n)                                               (Fact 2)

the exponent of e in Fact 2 is eventually ≥ 1                        (Fact 3)

Q3. Algorithm analysis

Consider the following function, which takes in a list of integers.

1 def my_sum(L):

2 x = 0

3 y = 1

4 n = len(L)

5 i = 0

6 while x + y < n:

7 if L[i] % 2 == 0:

8 y = y + 1

9 else:

10 x = x + y

11 i = i + 1

Let WC(n) and BC(n) represent the worst-case and best-case runtime functions of my sum, respectively.

(a) Prove that WC(n) ∈ O(n), where n is the length of the input list to my sum.

(b) Prove that WC(n) ∈ Ω(n), where n is the length of the input list to my sum.

(c) Prove that BC(n)  ∉ Θ(n), where n is the length of the input list to my sum. You can use the definition of Theta that says g ∈ Θ (f) if and only if g ∈ O(f) Λ g ∈ Ω(f).

Attachment:- Assignment Files.rar

Reference no: EM131433615

Questions Cloud

In what ways does the wsq framework address challengers : In what ways does the WSQ Framework address challengers brought about by the VUCA environment?
Leading cross-functional teams : One of the biggest challenges project managers need to overcome is being able to influence their teams without having direct authority over each individual within their project. Frequently, project managers are tasked with overseeing cross-functio..
Missions statements crafted for the organization : Are missions statements crafted for the organization the same as one crafted for a project?
Work readiness and structural planning : Review the four Casey plans and consider the structural systems that will be used in the construction including the footings, floor system, structural and non-structural walls, roofing and external wall cladding.
Prove that for all positive real numbers a and b : CSC165H1 Problem Set. Prove the following statements about little-oh, using only the definitions of little-oh and Big-Oh. You may not use any external properties of Big-Oh in this question. Prove that for all positive real numbers a and b, if a
Identify three job requirements that could apply : Identify three (3) job requirements (e.g., needed certifications, previous work experience, external influences, etc.) that could apply to your chosen scenario. Determine two (2) ways these requirements could impact staffing at your organization. ..
Department for visual arts in metro government of nashville : Imagine you are an an administrator in the Department for the Visual Arts in the Metro Government of Nashville. Your supervisor, Doris Holmes (the administrator of the department) would like for the Metro Government to build a place on a small pie..
Analyze and describe the sources in annotated bibliography : Thereafter, you are required to analyze and describe the sources in the Annotated Bibliography, in the format proposed in the document labelled, "thesis_and_ebook_bibliography".
Why marketing is important for your career : The latest trends in Marketing (short background, current situation, best practices and the future). Why Marketing is important for your career

Reviews

len1433615

3/20/2017 3:39:20 AM

Your problem sets are graded on both correctness and clarity of communication. Solutions which are technically correct but poorly written will not receive full marks. Please read over your solutions carefully before submitting them. Problem sets must be submitted online through MarkUs. If you haven't used Mark Us before, give yourself plenty of time to figure it out, and ask for help if you need it! If you are working with a partner, you must form a group on MarkUs, and make one submission per group. \I didn't know how to use MarkUs" is not a valid excuse for submitting late work. The work you submit must be that of your group; you may not refer to or copy from the work of other groups, or external sources like websites or textbooks. You may, however, refer to any text from the Course Notes (or posted lecture notes), except when explicitly asked not to.

len1433615

3/20/2017 3:39:14 AM

Note: review the Extra Instructions for hints about working with logarithms. Please read the following instructions carefully before starting the problem set. They contain important information about general problem set expectations, problem set submission instructions, and reminders of course policies. Solutions must be typeset electronically, and submitted as a PDF with the correct lename. Hand-written submissions will receive a grade of ZERO.

Write a Review

Computer Engineering Questions & Answers

  Design an application that either sums or averages

make a menu bar with a file menu that includes a Perform Action command and an Exit command. The Perform Action command computes either the sum or the average of the rows or columns in the array and displays the result in a message box. The Exit c..

  Supply supporting evidence for the decision

Now that you have a normal plan and have identified the information that you need for this program, you feel you are ready to start development. You told your uncle that you would need to purchase software for this program. Since your uncle is in ..

  What is the itsec

What is the meaning of CIA triad in Information Security.What is the difference between Symmetric and Asymmetric Key Cryptography

  Compute a discount that customers receive

find a discount that customers receive based on the value of their order. If the total amount ordered is less than $20.00, no discount will be given.

  Develop various features of application software

You will also develop various features of application software that you will use in the day to day running of Better Buy Bespoke.  You will use your expertise to create macros that will automate features and functions of the application software

  Create a solution that allows a customer to purchase pizzas

Create an object oriented solution that allows a customer to purchase between 1 and 3 pizzas, add toppings to each pizza, if desired, and then displays a receipt and a grand total amount including 6% tax.

  Matlab quad function

The root-mean-square current can be determined as I rms = (1/T int (i^2(t) dt) |from 0 to T )^1/2 rms utilizing the MATLAB quad function.

  Give difference between testing and debugging

You have just been hired as the testing guru for the CatchAllBugs.com Company. Your first task is to write a set of test cases to debug a small VB program. Unfortunately, you do not have access to the code of program. All you have is the following ..

  Write the monthly sales amounts to a file

Using Visual Logic, write the monthly sales amounts to a file, monthly_Sales.dat. (Hint: be sure to enter a sentinel value for end of file processing later.)

  Explain would you object to the given approach

She claims that you could also eliminate your SAN and connect the client computers directly to the disk array. Would you object to this approach? Explain.

  Communicate information effectively in a multimedia format

Produce documents and present work in multimedia formats appropriate for the intended audience and apply basic design elements, principles and techniques in different scenarios.

  Identifying issues relating to information systems

Demonstrate problem-solving skills by identifying and resolving issues relating to information systems and their components, and proficiently utilise different types of information systems software

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