Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that an event repeatedly occurs over time at a constant rate but at random (Poisson process). For example, let's observe the arrival of

  Suppose that an event repeatedly occurs over time at a constant rate but at random (Poisson process). For  

Suppose that an event repeatedly occurs over time at a constant rate but at random (Poisson process). For example, let's observe the arrival of buses at a bus stop. On average we see a bus every 10 minutes. However, the time interval between the arrivals of two buses is exactly 10 minutes. We may see the buses, for example, at 0 min, 13.1 min, 19.7 min, 33.3 min, 40.2 min, ... We divide a time period of concern into n pieces. In each piece of time interval, the probability for occurrence of an event is p = [0, 1]. Then, the probability that this event occurs k times in the whole time period is Pr(k, n, p): This is called binomial distribution. Do the following operations by SymPy. n! k! (n - k)! pk (1 - p)n-k. 1. Define the symbols n and k standing for two nonnegative integers. Define the symbol p standing for a nonnegative real number. 2. Define the expression for Pr (k, n, p) and print out this expression by pprint(). 3. Substitute n = 20 and p = 0.5 into the expression of Pr(k, n, p). Then, the new expression is only a function of k, i.e., Pr(k) 4. Convert the SymPy expression Pr(k) to a python function called binomial_prob_k_func() by sympy.lambdify . Note that the expression Pr(k) may contain the operation sympy.factorial() which is not supported by NumPy but is supported by SciPy. So, we cannot use sympy.lambdify( ..., "numpy"); instead, we must use sympy.lambdify( ..., "scipy"). 5. Try three sets of parameters: n = 20 and p = 0.4, n = 20 and p = 0.7, n = 40 and p = 0.5. Similar to Question 3, for each set of parameters, substitute n and p to the expression of Pr(k, n, p). Then, similar to Question 4, for each set of parameters, define the python function binomial_prob_k_func(). Finally, for each set of parameters, plot this python function, i.e., Pr(k). Activate Windows

Step by Step Solution

3.34 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

The image contains a descriptive text regarding a scenario of using a binomial distribution to model the arrival times of buses at a bus stop akin to ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Managerial Finance

Authors: Lawrence J. Gitman, Chad J. Zutter

13th Edition

9780132738729, 136119468, 132738724, 978-0136119463

More Books

Students also viewed these Computer Network questions

Question

Solve for I: log2(x) = -8 T

Answered: 1 week ago