Definition of the useless function

Assignment Help Business Management
Reference no: EM132097521

Below is the definition of the useless function:

1: function useless(n)

2: if n = 1 then

3: return 1

4: else

5: return useless(random(1, n))

6: end if7: endfunction

where random(1, n) returns a uniformly distributed random integer in the range 1 . . . n.

Assuming an initial call to the function useless(m).

Point: The function will return 1 or will run infinitely.

Q1. How to prove it formally?

Point: Call to random function on line 5 will occurred whenever m is not equal to 1 and it will be infinite until m equals to 1.

Q2. So, how exactly we can calculate the expected no. of calls to random function?

Point: For best case scenario of useless function [useless(1)], calls for random function will be 0.

Q3. But what about the worst case scenario(useless(n) where n not equal to 1), how many times random function will be called?

Reference no: EM132097521

Questions Cloud

What services are finance companies able : What services are finance companies able to offer consumers and businesses that banks do NOT offer?
What kind of analysis do you do : What is a qualitative research question pertaining to our metta question? What kind of analysis do you do?
Specially designed prototype semiconductor wafers : A semiconductor wafer fabrication facility received an order for specially designed prototype semiconductor wafers.
Review problem on consumer purchasing behavior : One of the most important element in the success of any marketing plan is the full understanding of how consumer make their buying decisions.
Definition of the useless function : Below is the definition of the useless function:
Discuss what entry strategies might differ when companies : Discuss what entry strategies might differ when companies are entering the United States, compared to those entering China,
List four network tools that you would use : List four network tools that you would use to run your network and that you would recommend that management invests in.
Construct a decision tree of the various courses : Construct a decision tree of the various courses of action possible and their potential consequences.
Explain the importance of the product design process : Explain the importance of the product design process and how the connection of designing new products can impact the production processes.

Reviews

Write a Review

Business Management Questions & Answers

  Comparative advantages in the labor market

What are your comparative advantages in the labor market? What do you still feel you need to develop to be prepared

  Food for everyone being grown

Why is there food scarcity in the world today if there's supposed to be enough food for everyone being grown?

  Case diagram-airline reservation problem

To summarize, this swing GUI displays the reservation form and the airplane seating availability "diagram". Construct a Use-Case diagram for this airline reservation problem.

  Important in socializing new employees

Which two aspects of an orientation program do you think are the most important in socializing new employees? Support your choices.

  Efficient use of company resources

Apple has in recent years unveiled a new version of its iPhone each year. Is this an efficient use of company resources a new model with limited noticeable.

  Show internal factor evaluation matrix for mcdonalds

Prepare an IFE Matrix for McDonalds. Summarize your observations, including strategic implications as a result of the IFE and Financial Ratio analysis.

  Book marketnet working capital 20 40 debt net working

book marketnet working capital 20 40 debt net working capital 20 40 debtlong- term assets 80 60 equity long- term

  Explain a recent experience or observed act of prejudice

Explain a recent experience or observed act of prejudice. How would you have handled the situation differently?

  Give a specific example from your own experience

Give a specific example from your own experience to highlight one of the stages. If you have no team experience, utilize the case study you completed in connection with same.

  What stocks decreased and increased in value

What business or industry did you "Bench Mark" with your Portfolio? What prompted you to pick the stocks that are currently in your portfolio? What stocks decreased and increased in value?

  Illustrate what is the impact on the organization

Illustrate what happens if the merit pay program is not designed to differentiate between various levels of performance. Illustrate what is the impact on the organization.

  Elements in an expat compensation package

Select one of the major common elements in an expat's compensation package. Why is this important to an expatriate? Explain?

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