Question

PYTHON Im kinda stuck here for this question, could use some help! Python please, and please follow the requirements.09 5 Points Al and Bob are arguing about their algorithurs. Al claims his Oinlogn time method is always faster than Bobs O(n

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans:-

Let Al function is c*nlogn where c is constant>0

Bob function is b*n² where b is constant > 0

Let base of logarithm is 2,

Compare them,

if n<=100, then

c*nlogn >= b*n²

c*logn >= b*n

when n = 100,

c* log(100) >= b*100

c/b >= 100/log(100)

c/b >= 166.1 (condition 1)

if n> 100 i.e n = 101

c*nlogn < b*n²  

c*101*log(101) < b* 101²

c/b < 167.4 (condition 2)

Values exist for constants c and b that satisfies both conditions 1 and 2

Hence this can be possible.

If any doubt ask in the comments.

Add a comment
Know the answer?
Add Answer to:
PYTHON Im kinda stuck here for this question, could use some help! Python please, and please...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please help me with this assignment. im kinda stuck here :( 2. Find the input impedance...

    please help me with this assignment. im kinda stuck here :( 2. Find the input impedance for the given circuit below. Assume that R = 15 ohms, L = 15mH, C = 69uF and o=377 rad/s. (10 points) R R zin R R с

  • PYTHON: Im stuck here, big O notation and runtime. What is it and Why are they...

    PYTHON: Im stuck here, big O notation and runtime. What is it and Why are they those? Please look at the pic, need help as Im confused. Thank You! def method3(n): for i in range(n): for j in range(100): for k in range(n): print(i+j+k) What is the runtime (tightest/closest bound in terms of O) for the above python function (method 3)? Please briefly explain. Enter your answer here def method4(n): for i in range(n): for j in range(n, o, -2):...

  • PYTHON please help! im stuck on this homework question, THANK YOU! please follow the rules! Give...

    PYTHON please help! im stuck on this homework question, THANK YOU! please follow the rules! Give a recursive python implementation of the following function: def check_Decreasing_Order(lissy): Given lissy, a python list of integers, the above function will return True if lissy is sorted in decreasing order, otherwise it will return false. For example, print(check_Decreasing Order([100,50,8, -2])) True print(check_Decreasing_Order([108,50,8,2,35])) False Implementation Requirements: 1. Your implementation must be recursive. 2. If you need more parameters, you may define new functions or helper...

  • PYTHON this implementation is really hard, Im stuck especially with the requirements they give. PLEASE HELP!...

    PYTHON this implementation is really hard, Im stuck especially with the requirements they give. PLEASE HELP! THANK YOU! RECURSIVE! Give a recursive python implementation of the following function: def check_Decreasing_Order(lissy): Given lissy, a python list of integers, the above function will return True if lissy is sorted in decreasing order, otherwise it will return false. For example, print(check_Decreasing Order([100,50,8, -2])) True print(check_Decreasing_Order([108,50,8,2,35])) False Implementation Requirements: 1. Your implementation must be recursive. 2. If you need more parameters, you may define...

  • Please help. Im stuck on the exponential smoothing part of this problem. Here are the actual...

    Please help. Im stuck on the exponential smoothing part of this problem. Here are the actual tabulated demands for an item for a nine-month period (January through September). Your supervisor wants to test two forecasting methods to see which method was better over this period. MONTH ACTUAL January 110 February 130 March 150 April 170 May 160 June 180 July 140 August 130 September 140 a. Forecast April through September using a three-month moving average. (Round your answers to 1...

  • PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU!...

    PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU! Implement an efficient python function for the following: def find_Number_of_A11_Possible_Ways(matrix, totalGasAmount): The above function will count all the possible paths from top left cell to bottom right cell of a matrix using exactly totalGasAmount. Each cell of this matrix has a nonnegative number which represents gas amount of that cell. The constraint is that from each cell, you can either move right or move...

  • Please answer this in python pseudocode. It's an algorithm question. 1. [10 marks] Consider the function...

    Please answer this in python pseudocode. It's an algorithm question. 1. [10 marks] Consider the function SumKSmallest(A[0..n – 1), k) that returns the sum of the k smallest elements in an unsorted integer array A of size n. For example, given the array A=[6,-6,3,2,1,2,0,4,3,5] and k=3, the function should return -5. a. [3 marks) Write an algorithm in pseudocode for SumKSmallest using the brute force paradigm. Indicate and justify (within a few sentences) the time complexity of your algorithm. b....

  • can you please help me? im stuck, thanks :) 1. 2. Question 18 Which reagent would...

    can you please help me? im stuck, thanks :) 1. 2. Question 18 Which reagent would best serve as the basis for a simple chemical test to distinguish between acetophenone and benzophenone? O A GO3/H2SO4 OB. NaHCO3/H20 o Ag NH3)2 O D.Bra/CC14 O E NaCl (12 in NaOH) Question 5 A compound, C5H 100 reacts with phenylhydrazine and gives a positive iodoform test. The compound could be which of these? ОА O OB. CACAČCA Cho CHACHECHICHTE CH,CHCHICO CHI ОС. OD...

  • Here is the whole question, someone please help im stuck Entries for Payroll and Payroll Taxes...

    Here is the whole question, someone please help im stuck Entries for Payroll and Payroll Taxes The following information about the payroll for the week ended December 30 was obtained from the records of Saine Co.: Salaries: Deductions Salsslaries Warehouse salaries Office salaries $249,000 137,000 127,000 Income tax withheld Social security tax withheld Medicare tax withheld $90,288 30,780 7,695 11,286 9,234 $149,283 $513,000 Retirement savings Group insurance Tax rates assumed: Social security, 6% Medicare, 1.5% State unemployment (employer only), 5.4%...

  • Hard question could use some help please m Couse: 1asp Basc Ecan G adeence purchase price...

    Hard question could use some help please m Couse: 1asp Basc Ecan G adeence purchase price nect htn Q2-Quiz #2 on UNIT 20 Help Save& Exit Sulbmit 7 Price Per Yard Quntity supplied $25 f the weekly supplule for al eat aking in a certain neighborhod Accorditi to the laws o economics, which of the tollowing could be the missing number? Multple Choice More intormation is needed 20 30 < Prev 7 of 20?Next > O Type here to search...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT