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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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