Definition of the useless function

Assignment Help Business Management
Reference no: EM132095906

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 if
7: 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: EM132095906

Questions Cloud

Convert the record to binary : Assume your computer has 4 gigs of RAM, each gig in a different memory chip, therefore you have 4 one gig RAM chips.
What are some methods that can be used to improve your skill : What are some methods that can be used to improve your skills when developing these?
Show the two correlation coefficients to the user : First develop your program and then test it using any dataset you like. Your Instructor will have his own dataset to test your program
Differences between a default vulnerability scan : What is the differences between a default vulnerability scan and a credentialed scan exactly?
Definition of the useless function : Below is the definition of the useless function:
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
Vulnerabilities in policy enforcement : Who is ultimately liable for risk, threats, and vulnerabilities in policy enforcement?
Finds the number of zeros and ones and twos : Suppose that we have a decimal number x and we only need to find the number of twos, ones and zeros in its equivalent ternary number.
Contrast automated vs manual policy enforcement : Contrast automated vs. manual policy enforcement controls in Policy Enforcement

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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