This document discusses random number generation and random variate generation. It covers:
1) Properties of random numbers such as uniformity, independence, maximum density, and maximum period.
2) Techniques for generating pseudo-random numbers such as the linear congruential method and combined linear congruential generators.
3) Tests for random numbers including Kolmogorov-Smirnov, chi-square, and autocorrelation tests.
4) Random variate generation techniques like the inverse transform method, acceptance-rejection technique, and special properties for distributions like normal, lognormal, and Erlang.
Simulation of Queueing Systems(Single-Channel Queue).Badrul Alam
A grocery store has one checkout counter. Customer arrive at this counter at random from 1 to 8 minutes apart and each interval time has the same probability of occurrence. The service time vary from 1 to 6 minutes, with probability give below:
It gives detail description about probability, types of probability, difference between mutually exclusive events and independent events, difference between conditional and unconditional probability and Bayes' theorem
This is an easy introduction to the concept of Genetic Algorithms. It gives Simple explanation of Genetic Algorithms. Covers the major steps that are required to implement the GA for your tasks.
For other resources visit: http://pimpalepatil.googlepages.com/
For more information mail me on pbpimpale@gmail.com
Statistical simulation technique that provides approximate solution to problems expressed mathematically.
It utilize the sequence of random number to perform the simulation.
This presentation on Pseudo Random Number Generator enlists the different generators, their mechanisms and the various applications of random numbers and pseudo random numbers in different arenas.
Dynamic Programming :
Dynamic programming is a technique for solving problems by breaking them down into smaller subproblems, solving each subproblem once, and storing the solution to each subproblem so that it can be reused in the future. Some characteristics of dynamic programming include:
Optimal substructure: Dynamic programming problems typically have an optimal substructure, meaning that the optimal solution to the problem can be obtained by solving the subproblems optimally and combining their solutions.
Overlapping subproblems: Dynamic programming problems often involve overlapping subproblems, meaning that the same subproblems are solved multiple times. To avoid solving the same subproblem multiple times, dynamic programming algorithms store the solutions to the subproblems in a table or array, so that they can be reused later.
Bottom-up approach: Dynamic programming algorithms usually solve problems using a bottom-up approach, meaning that they start by solving the smallest subproblems and work their way up to the larger ones.
Efficiency: Dynamic programming algorithms can be very efficient, especially when the subproblems overlap significantly. By storing the solutions to the subproblems and reusing them, dynamic programming algorithms can avoid redundant computations and achieve good time and space complexity.
Applicability: Dynamic programming is applicable to a wide range of problems, including optimization problems, decision problems, and problems that involve sequential decisions. It is often used to solve problems in computer science, operations research, and economics.
Algorithm Design Techniques
Iterative techniques, Divide and Conquer, Dynamic Programming, Greedy Algorithms.
Simulation of Queueing Systems(Single-Channel Queue).Badrul Alam
A grocery store has one checkout counter. Customer arrive at this counter at random from 1 to 8 minutes apart and each interval time has the same probability of occurrence. The service time vary from 1 to 6 minutes, with probability give below:
It gives detail description about probability, types of probability, difference between mutually exclusive events and independent events, difference between conditional and unconditional probability and Bayes' theorem
This is an easy introduction to the concept of Genetic Algorithms. It gives Simple explanation of Genetic Algorithms. Covers the major steps that are required to implement the GA for your tasks.
For other resources visit: http://pimpalepatil.googlepages.com/
For more information mail me on pbpimpale@gmail.com
Statistical simulation technique that provides approximate solution to problems expressed mathematically.
It utilize the sequence of random number to perform the simulation.
This presentation on Pseudo Random Number Generator enlists the different generators, their mechanisms and the various applications of random numbers and pseudo random numbers in different arenas.
Dynamic Programming :
Dynamic programming is a technique for solving problems by breaking them down into smaller subproblems, solving each subproblem once, and storing the solution to each subproblem so that it can be reused in the future. Some characteristics of dynamic programming include:
Optimal substructure: Dynamic programming problems typically have an optimal substructure, meaning that the optimal solution to the problem can be obtained by solving the subproblems optimally and combining their solutions.
Overlapping subproblems: Dynamic programming problems often involve overlapping subproblems, meaning that the same subproblems are solved multiple times. To avoid solving the same subproblem multiple times, dynamic programming algorithms store the solutions to the subproblems in a table or array, so that they can be reused later.
Bottom-up approach: Dynamic programming algorithms usually solve problems using a bottom-up approach, meaning that they start by solving the smallest subproblems and work their way up to the larger ones.
Efficiency: Dynamic programming algorithms can be very efficient, especially when the subproblems overlap significantly. By storing the solutions to the subproblems and reusing them, dynamic programming algorithms can avoid redundant computations and achieve good time and space complexity.
Applicability: Dynamic programming is applicable to a wide range of problems, including optimization problems, decision problems, and problems that involve sequential decisions. It is often used to solve problems in computer science, operations research, and economics.
Algorithm Design Techniques
Iterative techniques, Divide and Conquer, Dynamic Programming, Greedy Algorithms.
PPT on testing for randomness of numbers by using different tests like chi square test and chi autocorrelation test.
It aslo includes Komogrov Simrov test and other important topics of these.
It includes different methods to generate random numvers like
1. Mid square random number genetrator
2. Residue method
3. Arithmetic Congruetial Generator
Shor's algorithm is for quantum computer. Using this algorithm any arbitrarily large number can be factored in polynomial time. which is not possible in classical computer
This talk is going to cover some techniques of counting using a computer. Counting problems come up very often in areas of databases, networking, and elsewhere. Counting is so simple that by itself it isn’t even worth talking about, but there are some techniques that have truly impressive gains.
Accompanying notes at: http://www.slideshare.net/roshmat/counting-notes
Applet Basics,
Applet Organization and Essential Elements,
The Applet Architecture,
A Complete Applet Skeleton,
Applet Initialization and Termination,
Requesting Repainting
The update() Method,
Using the Status Window
Passing parameters to Applets
The Applet Class
Event Handling The Delegation Event Model
Events,
Using the Delegation Event Model,
More Java Keywords.
Multithreaded fundamentals
The thread class and runnable interface
Creating a thread
Creating multiple threads
Determining when a thread ends
Thread priorities
Synchronization
Using synchronized methods
The synchronized statement
Thread communication using notify(), wait() and notifyall()
Suspending , resuming and stopping threads
The exception hierarchy
Exception handling fundamentals
Try and catch
The consequences of an uncaught exception
Using multiple catch statements
Catching subclass exceptions
Nested try blocks
Throwing an exception
Re-throwing an exception
Using finally
Using throws
Java’s built-in exception
Creating exception subclasses
Introduction,Developing a Program, Program Development Life Cycle, Algorithm,Flowchart,Flowchart Symbols,Guidelines for Preparing Flowcharts,Benefits and Limitations of Flowcharts
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
Online aptitude test management system project report.pdfKamal Acharya
The purpose of on-line aptitude test system is to take online test in an efficient manner and no time wasting for checking the paper. The main objective of on-line aptitude test system is to efficiently evaluate the candidate thoroughly through a fully automated system that not only saves lot of time but also gives fast results. For students they give papers according to their convenience and time and there is no need of using extra thing like paper, pen etc. This can be used in educational institutions as well as in corporate world. Can be used anywhere any time as it is a web based application (user Location doesn’t matter). No restriction that examiner has to be present when the candidate takes the test.
Every time when lecturers/professors need to conduct examinations they have to sit down think about the questions and then create a whole new set of questions for each and every exam. In some cases the professor may want to give an open book online exam that is the student can take the exam any time anywhere, but the student might have to answer the questions in a limited time period. The professor may want to change the sequence of questions for every student. The problem that a student has is whenever a date for the exam is declared the student has to take it and there is no way he can take it at some other time. This project will create an interface for the examiner to create and store questions in a repository. It will also create an interface for the student to take examinations at his convenience and the questions and/or exams may be timed. Thereby creating an application which can be used by examiners and examinee’s simultaneously.
Examination System is very useful for Teachers/Professors. As in the teaching profession, you are responsible for writing question papers. In the conventional method, you write the question paper on paper, keep question papers separate from answers and all this information you have to keep in a locker to avoid unauthorized access. Using the Examination System you can create a question paper and everything will be written to a single exam file in encrypted format. You can set the General and Administrator password to avoid unauthorized access to your question paper. Every time you start the examination, the program shuffles all the questions and selects them randomly from the database, which reduces the chances of memorizing the questions.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
2. contents
• Random number generation
• Properties of random numbers
• Generation of pseudo-random numbers
• Techniques for generating random numbers
• Tests for Random Numbers
• Random-Variate Generation:
• Inverse transform technique
• Acceptance-Rejection technique
• Special properties
2
4. Properties of random numbers
• the main properties of random numbers are
• Uniformity
• Independence
• Maximum density
• Maximum period
• Maximum density means that the gaps between random numbers
should not be large, can be achieved by having maximum period.
• Maximum period refers the length of the sequence of random
numbers which are going to repeat after a certain random numbers.
4
5. • Each random number Ri must be an independent sample drawn from
a continuous uniform distribution between zero and 1
• The pdf of the given by
• f(x)=
1 , 0 ≤ 𝑥 ≤ 1
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
• The expected value of each is given by
• E( R) = 0
1
𝑥 𝑑𝑥 =
1
2
5
6. • The variance is given by
• V( R) = 0
1
𝑥2
− [𝐸 𝑅 ]2
=
1
12
• The following figure shows the pdf for random numbers
6
7. Generation of pseudo Random Numbers
• Pseudo means false , here it implies generating random numbers by
known method to remove the potential for true randomness.
• If the method is known then set of random numbers can be repeated.
• Which means that numbers are not random
• The main goal of random generation technique is to produce a
sequence of numbers between 0 and 1 that simulates or imitates the
ideal properties of uniform distribution and independence
• Random numbers are generated by digital computer as part of
simulation, there are numerous ways to generate these values
7
8. • The following are few important considerations
• The method should be fast, simulation process requires millions of random
numbers hence it has to be fast
• The method has to be portable to different computer
• The method should have sufficiently long cycle, means there should be long
gap between the random numbers once generated getting repeated.
• The random numbers should be repeatable
• The generated random numbers should closely approximate the ideal
statistical properties of uniformity and independence
8
9. Errors or departures of pseudo random
numbers
• The generated random numbers might not be uniformly distributed.
• Generated numbers might be discrete value instead of continuous
value.
• The mean of generated random numbers might be too high or too
low
• The variance of generated numbers might be too high or too low
• There might be dependence
• Authentication between numbers
• Numbers successively higher or lower than adjacent numbers
• Several numbers above the mean followed by several numbers below the
mean.
9
10. Techniques for generating random numbers
• Linear congruential method
• Combined linear congruential generators
• Random number streams
10
11. Linear congruential method
• Proposed by Lehmer, produces a sequences of integer numbers X1,X2 ,
… between zero and m-1 by following the recursive relationship:
• X i+1= (aXi+c) mod m, i=0,1,2,3…
• The initial value i.e. x0 is called seed
• a is called multiplier
• c is called the increment
• m is called the modulus
11
12. • If c ≠ 𝟎 then form is called mixed congruential method
• When c=0, the form is called multiplicative congruential method
• The selection of the values for a, c, m and X0 affects the statistical
properties and the cycle length.
• Random numbers Ri between 0 and 1 can be generated by setting
• Ri =
𝑿 𝒊
𝒎
, i=1,2,…
12
14. Combined linear congruential generators
• Combine two or more multiplicative congruential generators in such a
way that the combined generator has good statistical properties and
longer period.
• The following result from L’ Ecuyer suggest how this can be done:
14
18. Tests for random numbers
• Number of tests are performed to check the uniformity and independence
of random numbers
• Two types of tests are
• Frequency test : compares the distribution of the set of numbers
generated to a uniform distribution. Few are:
• Kolmogorov-Smirnov Test
• Chi-square Test
• Autocorrelation test: tests the correlation between the two numbers and
compares the sample correlation to the desired correlation, zero
• Runs test
• Gap test
• Pokers test
18
19. Kolmogorov- Smirnov Test –for uniformity (Procedure)
1. Formulate the hypothesis
H0:Ri ~U[0,1]
H1:Ri ~U[0,1]
2. Rank the data from smallest to largest
R(1)≤R(2) ≤R(3)…
3. Calculate the values of D+ and D-
19
20. 4. Find D=max(D+,D-)
5. Find the critical value Dα from the K-S table
6. If D> Dα then
reject the hypothesis H0
else If D < Dα then
accept the hypothesis H0
20
23. Chi-square Test –for uniformity (Procedure)
1. Formulate the hypothesis
H0:Ri ~U[0,1]
H1:Ri ~U[0,1]
2. Divide the data into different class intervals of equal intervals
3. Find out how many random numbers lie in each interval and hence find Oi
(observed frequency) & expected frequency Ei using the formula
Ei =
𝑁
𝑛
where N is the total no of observation
n is the no of class interval
L=n-1 is known as degree of freedom
23
27. Tests for autocorrelation (Test for
independence of random numbers)
• The test for autocorrelation are concerned with the dependence
between numbers in a sequence.
• The autocorrelation between every m numbers starting with ith
number i.e. Ri,Ri+m,Ri+2m, … , Ri+(m+1)m is ρ im
• The value M is the largest integer such that i+(m+1)≤N where N is
the total number of values in the sequence
• A non-zero autocorrelation implies a lack of independence
H0: ρ im = 0
H1: ρ im ≠ 0
27
28. • For large value of M, the distribution of the estimator of ρ im is
denoted as ρ im
• the test statistics is as follows
• Which is distributed normally with a mean of 0 and variance of
28
30. • After computing Z0, do not reject the null hypothesis of independence
if
• −𝑧 𝛼
2
≤ Z0 ≤ 𝑧 𝛼
2
where is the level of significance and
• 𝑧 𝛼
2
is obtained from a following table A-3
30
31. Runs test
• Definition: The runs test is defined as sequence of similar preceded
and followed by different events
• Eg. Suppose tossing a coin 10 times results in the following sequence
• H H T T T H T H T T
• Here are 6 runs, first one of length 2, 2nd length of 3, 3rd ,4th ,5th of
length 1 and 6th of length 2
• Two points to be considered while performing runs test
• No of runs
• Length of each run
31
32. Runs up and runs down
32
• A run is said to be up if its followed by a bigger number and down if
the number is followed by a smaller number
• Since last number is not followed by any number, the maximum
number of runs is n-1 where n is the number of observation
• Procedure of the runs up and runs down is as follows
• Step 1 :
H0: Ri is independent
H1: Ri is not independent
33. • Step 2: find runs up and runs down by assigning the + sign to every
random number that is followed by bigger number and – sign to a
number that is followed by a smaller number
• Step 3: find the total number of runs (a)
• Step 4: calculate 𝑍 =
𝑎−𝜇 𝑎
𝜎 𝑎
where 𝜇 𝑎=(2N-1)/3 and
𝜎 𝑎=sqrt((16N-29)/90) where N is total number of observation
• Step 5: find the critical value 𝑧 𝛼
2
from the normal table
• Step 6: reject H0 if |Z|≥ 𝑧 𝛼
2
otherwise accept H0
33
36. Inverse-transform technique
• It can be used to sample from the exponential , uniform, Weibull and
triangular distributions and from empirical distributions.
• Underlying principle for sampling from a wide variety of discrete
distributions.
• Most straightforward but not always efficient technique. Few are
• Exponential distribution
• Uniform distribution
• Weibull distribution
• Triangular distribution
• Empirical discrete distribution
• Discrete uniform distribution
• Geometric distribution
36
37. Exponential distribution
• Probability density function (pdf) is given by
• 𝑓 𝑥 = λ𝑒−λ𝑥 , 𝑥 ≥ 0
0, 𝑥 < 0
• The cumulative distribution function (cdf) is given by
• F(x)= −∞
𝑥
𝑓 𝑡 𝑑𝑡 = 1 − 𝑒−λ𝑥, 𝑥 ≥ 0
0 , 𝑥 < 0
37
42. Uniform distribution
• Consider a random variable X i.e. uniformly distributed on the interval
[a,b].
• Step 1 : the cdf is given by
F(x) =
0, 𝑥 < 𝑎
𝑥−𝑎
𝑏−𝑎
, 𝑎 ≤ 𝑥 ≤ 𝑏
1, 𝑥 > 𝑏
• Step 2: Set F(x)=
𝑥−𝑎
𝑏−𝑎
= R
• Step 3: on solving we get , X=a+(b-a)R which is the equation for
random variate generation using uniform distribution
42
52. Acceptance – rejection technique
• Devising a method for generating random numbers ‘X’ uniformly
distributed between ¼ and 1 follows three steps
1. Generate a random number R
2. a) If R ≥ ¼ accept X=R the goto step 3
2. b) if R < ¼ reject R and return to step 1
3. If another uniform random variate on [1/4,1] is needed, repeat the
procedure beginning at step 1 , if not stop.
52
53. Poisson distribution
• Step 1 : Set n=0, P=1
• Step 2 : generate a random number Rn+1 , replace P by P.Rn+1
• Step 3: If P < 𝑒−𝛼
then accept N=n, otherwise reject the current n, increase n by
one and return to step 2
• With N=n poison of average number is given by
E(N+1)=α+1
53
56. • For the arrival function in the table generate the 1st two arrival times
t(mins) mean time b/n Arrival rate
arrival (mins) A(t)
0 15 1/15
60 12 1/12
120 17 1/17
180 5 1/5
240 8 1/8
300 10 1/10
Given the random no’s are: 0.2130, 0.8830, 0.5530, 0.0240, 0.0001, 0.1443
56
58. Special properties
• They are variate generation techniques that are based on features of
particular family of probability distributions , rather than general
purpose techniques like inverse transform or acceptance-rejection
technique.
• Direct transformation for the normal and lognormal distributions
• Convolution method
• Erlang distribution
58
59. Direct transformation for the normal and
lognormal distributions
• The standard normal cdf is given by
ɸ (x) = −∞
𝑥 1
√2𝜋
𝑒
𝑡2
2 𝑑𝑡 , −∞ < 𝑥 < ∞
59
60. Convolution method
• The probability distribution of a sum of two or more independent
random variable is called convolution of distribution of the original
variable
• The convolution method refers to adding together two or more
random variables to obtain a new random variable with a desired
distribution
60