Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a python script. Exercise 3 : Random sample generator Write a Python script that generates random numbers distributed according to a Breit -

I need a python script.
Exercise 3: Random sample generator
Write a Python script that generates random numbers distributed according to a Breit-
Wigner distribution with the statistical median m=3 and the full-width at half maximum
b=7. Use for the PDF and CDF the following expressions:
p(x)=1b(x-m)2+b2,
F(a)=12+1arctan(a-mb).
Generate Nsmpl=10000 accepted values of x, distributed according to p(x) using the following
methods discussed in the lecture:
(a) Accept-reject method.
(b) Inverting the CDF.
For each of the two methods, plot the histogram of the generated sample and superimpose
the PDF after normalising it to match the histogram.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions