The goal of this problem is to simulate a geometric random

Assignment Help Basic Computer Science
Reference no: EM13770266

The goal of this problem is to simulate a geometric random variable (which will be covered on Friday, Feb 6th in lecture). We will break this problem into two parts.

Part a

Build a function which takes in p. This function should repeat a Bernoulli trial until a "success" (defaulted to a 1 in R) occurs, and return the trial number on which the first success occurred (i.e., if the 3rd trial resulted in a "success", this function should return 3). Use your function with the following values of p (and show your functions output):

i.p=0.02 ii.p=0.10 iii. p = 0.50

Part b

Build another function which takes in p, r, and N. This function will calculate the probability that the first "success" occurred on the rth trial, based on N simulations.

Notice you can use your function from Part a in this function.

Use your function with the following values of p, r, and N (and show your functions output):

i. p = 0.02, r = 10, N = 600000
ii. p = 0.10, r = 10, N = 600000
iii. p = 0.20, r = 10, N = 600000

These simulations may take a few minutes (or more depending on your computer) to run, but they should not crash your computer.

Remember that you can always use the computer labs to complete simulations.

Reference no: EM13770266

Questions Cloud

Firm has decreasing returns : In the short-run, if a firm has decreasing returns, does it have increasing, constant, or decreasing marginal cost? Explain. What about if it has constant returns? Increasing returns? Explain.
Partner wants to take the bid and let the subcontractor : Your partner wants to take the bid and let the subcontractor suffer consequences of his bad estimate. What do you think you should do?
What are the implications for defensive actions : Based on the article by Don et al on networked terrorists and your readings on cyber collection, what advantage do those planning a cyber attack have? What are the implications for defensive actions
Model over time would depletion from non-renewable resource : If we think about a model over time (dynamic), would depletion (production) from a non-renewable resource, we wouldn't have a traditional, static supply curve that is completely based on price. Would the classic demand curve still apply?
The goal of this problem is to simulate a geometric random : The goal of this problem is to simulate a geometric random variable (which will be covered on Friday, Feb 6th in lecture). We will break this problem into two parts.
The level of prices and the value of money : Suppose the price level reflects the number of dollars needed to buy a basket of goods containing one cup of coffee, one donut, and one newspaper. In year one, the basket costs $8.00.
To meet increased delivery demands : To meet increased delivery demands, a Dairy company just bought 15 new delivery trucks. Each truck cost $30,000 and has an expected life of 4 years. The trucks can each be sold for $8,000 after four years. Using CCA Class 10 depreciation, determine a..
Resulted from the change in the reserve requirement : The U.S. money supply (M1) at the beginning of 2000 was $1,148 billion broken down as follows: $523 billion in currency, $8 billion in traveller’s checks, and $616 billion in checking deposits. Suppose the Fed decide to reduce the money supply by inc..
Develop hypotheses predicting the effect : Develop hypotheses predicting the effect of pyrite and coal on the acidity of water? Based on the results of your experiment, would you reject or accept each hypothesis that you produced in question 1? Explain how you determined this.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Calculation for programming and machine independency

Assume f is a function that returns the result of reversing string of symbols given as its input, and g is a function that returns concatenation of the 2-strings given as its input. If x is the string abcd,

  What is greenhouse effect

What is Greenhouse effect - We are legally, ethically,and socially required to green our IT products, applications, services, and practices - is this statement true? Why?

  Let r be a cfg in chomsky normal from with x variables.

Let R be a CFG in Chomsky normal from with x variables.

  Encryption could assist in addressing some of the current ch

From the e-Activity and your own research, give your opinion of the two (2) most important ways that you believe encryption could assist in addressing some of the current challenges facing organizations today, and explain why these solutions are so i..

  Explaining leverage data from across enterprise

Many companies have executed ____________ to enable managers and knowledge workers to leverage data from across enterprise.

  Design an application to take and process a pizza order

Design an application to take and process a pizza order. The user should be able to make pizza order choices from listboxes, and the application should display the order price.

  User experience framework

The user experience framework also informs about the relationship between a conceptual model and a user's understanding of it for past, current, and future systems. The case study actually consists of two studies

  The shipping charge on a purchase

The shipping charge on a purchase of $234.65 is $5.00.

  Convert the following two''s complement to decimal numbers

Convert the following two's complement representations to decimal numbers (assume 5 bit numbers). a. 11101 b. 01111 c. 10011

  Better job of allowing computers to network

You wrote a piece of software that does a better job of allowing computers to network than any other program designed for this purpose.

  Preparing for a company-wide migration to windows 8

Crescent Manufacturing Inc. (CMI) is a luxury leader in crafted and customized home furnishings. The corporate headquarters and a production facility are located in Texas, with additional manufacturing facilities located in Nebraska and Maryland.

  Secure data access and encryption of a patientdatabase

OverviewIn this lab, you implemented policies that map to the Sarbanes-Oxley Act (SOX), the PaymentCard Industry Data Security Standard (PCI-DSS), and the Health Insurance Portability andAccountability Act (HIPAA). You ensured secure data acce..

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