Supplementary exercise : Generation of a random value picked

Slides:



Advertisements
Similar presentations
The Random Class.
Advertisements

Modeling of Data. Basic Bayes theorem Bayes theorem relates the conditional probabilities of two events A, and B: A might be a hypothesis and B might.
Geant4 Low Energy Polarized Compton Processes Gerardo Depaola * Francesco Longo + Francesco Longo + * National University of Córdoba (Argentina) + University.
Bayesian Methods with Monte Carlo Markov Chains III
Markov Chains 1.
F (x) - PDF Expectation Operator x (fracture stress) Nomenclature/Preliminaries.
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
A gentle introduction to Gaussian distribution. Review Random variable Coin flip experiment X = 0X = 1 X: Random variable.
Statistics.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
J. Tinslay 1, B. Faddegon 2, J. Perl 1 and M. Asai 1 (1) Stanford Linear Accelerator Center, Menlo Park, CA, (2) UC San Francisco, San Francisco, CA Verification.
7/12/2015 Top Pairs Meeting 1 A template fit technique to measure the top quark mass in the l+jets channel Ulrich Heintz, Vivek Parihar.
1 Random Variables and Probability Distributions: Discrete versus Continuous For this portion of the session, the learning objective is:  Learn that the.
Compton Scattering Reporter: Hui He. Outline Theory Experimental setup Experimental results (1) Calibration (2) Angular Distribution of the 137 Cs Source.
621 project Spring project 1. The heating rate is defined as :- Let us assume that the effect of scattering is small, and that in the ultraviolet.
Lecture 12 Monte Carlo Simulations Useful web sites:
Sergey Ananko Saint-Petersburg State University Department of Physics
Chapter 14 Monte Carlo Simulation Introduction Find several parameters Parameter follow the specific probability distribution Generate parameter.
بسم الله الرحمن الرحيم ” وقل رب زدنى علماً “ صدق الله العظيم.
Topics Covered Discrete probability distributions –The Uniform Distribution –The Binomial Distribution –The Poisson Distribution Each is appropriately.
1 Lesson 3: Choosing from distributions Theory: LLN and Central Limit Theorem Theory: LLN and Central Limit Theorem Choosing from distributions Choosing.
Geant4 Low Energy Polarized Processes Gerardo Depaola * Francesco Longo + Francesco Longo + * National University of Córdoba (Argentina) + University of.
PH24010 Data Handling and Statistics Photon Scattering program written in MathCAD.
Sampling Methods  Sampling refers to how observations are “selected” from a probability distribution when the simulation is run. 1.
Random Numbers and Simulation  Generating truly random numbers is not possible Programs have been developed to generate pseudo-random numbers Programs.
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
Radiation Shielding and Reactor Criticality Fall 2012 By Yaohang Li, Ph.D.
The Median of a Continuous Distribution
PHY240 Question #6 Suppose that a beam of 0.2-MeV photon is scattered by the electrons in a carbon target. What is the wavelength of those photon scattered.
Classical ConceptsEquations Newton’s Law Kinetic Energy Momentum Momentum and Energy Speed of light Velocity of a wave Angular Frequency Einstein’s Mass-Energy.
MCMC reconstruction of the 2 HE cascade events Dmitry Chirkin, UW Madison.
4.3 More Discrete Probability Distributions NOTES Coach Bridges.
Tom.h.wilson Department of Geology and Geography West Virginia University Morgantown, WV.
Components are existing in ONE of TWO STATES: 1 WORKING STATE with probability R 0 FAILURE STATE with probability F R+F = 1 RELIABLEFAILURE F R Selecting.
Project 2 22C:021 Computer Science II : Data Structures.
CS774. Markov Random Field : Theory and Application Lecture 15 Kyomin Jung KAIST Oct
Chapter 5 Joint Probability Distributions and Random Samples  Jointly Distributed Random Variables.2 - Expected Values, Covariance, and Correlation.3.
Module 9.4 Random Numbers from Various Distributions -MC requires the use of unbiased random numbers.
Compton Scattering When light encounters charged particles, the particles will interact with the light and cause some of the light to be scattered. incident.
SEMICONDUCTOR PHOTONICS LAB., HANYANG UNIV 3.1 Photons Compton Scattering Scattering of an x-ray photon by a free electron in a conductor When the.
Monte Carlo Simulation of the Ising Model Consider a system of N classical spins which can be either up or down. The total.
J. Helsby, P. Ford, R. Hoch, K. Gnanvo, R. Pena, M. Hohlmann, D. Mitra
Lesson 8: Basic Monte Carlo integration
Monte Carlo Methods Some example applications in C++
MCMC Output & Metropolis-Hastings Algorithm Part I
Photons and QM III Introduction Quiz
Randomized Algorithm (Lecture 2: Randomized Min_Cut)
Quiz_14 Previous material – Compton scattering, pair production New material – Wave-Particle duality, probability, Uncertainty Principle Physics 274 9/30/2016.
Quantum Mechanics Reference: Concepts of Modern Physics “A. Beiser”
The relational operators
Introduction to Instrumentation Engineering
© Akhilesh Bajaj, All rights reserved.
Modelling data and curve fitting
Parallel Line Bingo.
Probability Review for Financial Engineers
Particle filters for Robot Localization
Photoelectric Effect Maximum kinetic energy of the electron:
Chapter V Interacting Fields Lecture 7 Books Recommended:
Day 33 Range Sensor Models 12/10/2018.
Monte Carlo Methods in Scientific Computing
Outline Texture modeling - continued Julesz ensemble.
Linear Functions of a Discrete Random Variable
Computing and Statistical Data Analysis / Stat 7
Measurement of
Chapter 14 Monte Carlo Simulation
VQMC J. Planelles.
Parallel Line Bingo.
Lecture 9 Randomized Algorithms
Generating Random Variates
Maximum Likelihood Estimation (MLE)
Presentation transcript:

Supplementary exercise : Generation of a random value picked from a given probability distribution Example used here is the Compton Scattering angular distribution

Problem spec: The Compton scattered photon is produced at an angle  with respect to the “straight on” direction. The probability of it being scattered at such an angle  is given by: where is a = incident photon energy/electron mass The maximum value of this expression is at f = 0 You are required to write a random generator class (similar to the one written before) which delivers a random value of  with this probability distribution. It should return a value in the range 0-180 degrees. You might start by reminding yourselves of the example which you wrote earlier in C which generates a random number with uniform or Gaussian distributions.

1. Remind yourself of the algorithm to pick a random number from a given distribution, I.e. - pick a random number, x, in the required range. - pick another number, Ptest, in the range 0  Max(P) - if Ptest < P(x) then keep the x value generated - otherwise repeat the loop until the test is satisfied 2. Write a class which has the following public methods: float uniform( ) // uniform distribution float gauss( ) // gaussian distribution float scatter( ) // compton scattering angular distribution 3. It should also have a constructor which takes the incident photon energy and electron mass as arguments. [You are going to need these in the Monte Carlo generator we write in the second part of the course]