StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Method of Generating Random Number - Assignment Example

Cite this document
Summary
In the "Method of Generating Random Number" paper, the inverse transform method of generating random numbers will be used to generate random numbers. If a wrong method is used the generated numbers may cover a small section of the population if a similar process is repeated over and over again…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER92.5% of users find it useful

Extract of sample "Method of Generating Random Number"

Name: Topic: Tutor : Date: 24th November, 2015 Generating Random numbers Introduction A random numbers is obtained by using methods, which can be generated from computers, calculators and tablet. The basic requirement is that for a sample in size n, all possible sample of the size must have an equal chance of being selected from the population. In producing randomness numbers various methods are used however some produce errors which many make the data samples and unrepresentative of the population. Therefore selection of the method for random sampling is critical and necessary for efficient working. If a wrong method is used the generated numbers may cover a small section of population if a similar process is repeated over and over again. In this study inverse transform method of method of generating random numbers will be used to generate random numbers. Method of generating random numbers Inverse transform method Suppose we require an algorithm for the generation of random variates from a distribution. The distribution function   necessarily returns a number in the interval   and we denote the inverse function to    as, defined for all  on that interval. If a random variable  is uniformly distributed over the interval for instance , that is   for then the random variable , has the distribution function . This forms the basis of the inverse transform method, because  . Therefore, if we require a random variate  from a given distribution, we can use the following short algorithm: 1. Generate a random variate   from ; 2. Return,   The main disadvantage of the inverse transform method is the need for either an explicit expression for the inverse of the distribution function, or a numerical method to solve   for an unknown. This means that it cannot be used for some distributions where the explicit expression does not exist, and the computation is too expensive. For example, to generate a random variate from the standard normal distribution using the inverse-transform method requires the inverse of the distribution function  Since no explicit solution to the equation   can be found in this case, numerical methods must be used. Using the inverse transform method, it is also possible to generate random variates from discrete distributions. Let X be a discrete random variable which can take values   where. The distribution function of X  is given by  , for where >0 and . The distribution function of X is therefore  If    then . The algorithm that generates random variates   from a discrete distribution is: 1. Generate   from ; 2. Find the positive integer   such that ; 3. Return  . This algorithm can only return variates   from the range , and the probability that a particular value   is given by  Generation e 500 random numbers Give inverse-transform algorithm for generating from the probability density function below. Using 1000 simulated values from this distribution, estimate its mean and variance. Apply the inverse transform method. In this case Inverting this c.d.f gives Sample of random generated numbers The data has been generated using In matlab code This clearly demonstrates the widely accepted possibility of variation numbers being unable to eliminate the null nature of random course for numbers. An immediate problem is in the context of the goodness pertaining to actual independence and in this context it becomes pertinent to understand that both number generation and randomness testing. It is known that errors can be made in such generating the numbers by assuming the specific measurement as being the standard for actual instability. Firstly, it is well recognized that the estimate pertaining to the second moment is more specific with the enhancement of sampling frequencies. Secondly, different methods relating to random generating are actually filtering procedures making use of data pertaining to the entire array of estimation to result in estimates during a specific point of time. When there changes over array, it is practical to presume about the estimates being dependent upon only restricted sample times that will be true reflection of actual numbers. Hypothesis testing for normality and independence amongst the generated numbers have been carried out and the results indicate that the restrictions estimate is mostly the same in comparison to estimates. Inverse transform proves to be effective because of parametrically explaining data pertaining to generated numbers. The dynamic processes can be modeled by the above equation in making it a linear function that relates to patterns observed in the past in relation to squared innovation that permit cross array and own impacts in the provisional variations. The significant characteristic of this arrangement is the considerable generality that it creates in permitting conditional variance and co-variance. More significantly, it is possible that the Inverse transform procedure will guarantee by constructing that the co-variance matrix in the systems could be positive and definite. Processes of sequential testing are used beneficially in determining the orders of the Inverse transform and for purposes of the provisional variance equation as applicable for Inverse transform procedures. Selected Tests for randomness Various tests will be used to test for randomness and independence test of the sample. These methods include frequency test, run test, poker test, Autocorrelation test and Gap test. The run test- When samples are selected, one assumes that they are selected at random. This is tested using run test for randomness which considers the number of runs rather than the frequency of the letters. The run test does not consider the questions of how many numbers were selected or how many of each is in specific run. After this is done the number of runs tested as to whether falls within the random range at a certain significant level . The formulae used in this test are shown below; For the mean + Standard deviation of run is calculated using To test the hypothesis the following formulae is used; Zo=(Xiannong 1) When the z value calculated is not within the limits of the selected level of significance then null hypothesis of the independence of the selected random is rejected Frequency test. Frequency test is used to test the uniformity of the generated random numbers this test will use chi-squire test and The Kolmogorov-Smirnov to determine whether the result of random numbers is uniformly distributed. It looks at the frequency of a certain digit within the generated numbers. Kolmogorov-Smirnov test will look at the difference in uniform distribution of population and sample using the following formulas(Gentle 48). D=max (Xiannong 1) where F(x)=x is for the general population and SN (x) is for the sample and F(x)=x is 0 while SN (x)= . in the equation above R1, R2 is the numbers and N is the selected sample. It should be noted that the null hypothesis is rejected when D>critical value. Gap Test – this is a test which measures the interval between a certain digit, let say 0. Therefore it determines the significance of the gap between the same digit recurring between the generated numbers (Gentle 26). It is calculated as . (Xiannong 1) Where P is the probability x is the number which is expected to be recurring. Let us assume x is 0.002 Poker test – this is a test which looks at independence of a digit or digits that follows each other frequently. For example, 0395 0.0061 0.0140 0.0901 0.2121 0.1244. the formula is Application of the tests To begin with testing of the numbers generated the following will be used Run test Here we begin by setting the hypothesis of the generated number which is the numbers Step 1 state the hypothesis and identify the claim. Ho: the numbers at random (claim). H1: the null hypothesis is not true. Step 2: choose significance level Test for randomness at =0.05. Step 3: find the number of runs. Arrange the numbers according to he runs of generated numbers, as shown. Runs Number 1 0395 0.0061 0.0140 0.0901 0.2121 2 0.2533 0.0195 0.0140 0.0149 3 0.0873 0.0140 0.0272 0.0431 4 0.0144 0.0862 0.0000 5 0.0418 0.0239 0.0185 0.0049 For 0.0144 = = =1.667 = = =0.2111 = = =7.254 Wher r is the number of runs Step 4: The calculated value of 7.254 and the critical value is 1.96 Step 5: summarize the results. We reject the null hypothesis since 7.254> 1.96 There is enough evidence to reject the hypothesis that the numbers were selected at random. Frequency test- in this case we are using Kolmogorov-Smirnov test to test the occurrence of the numbers 0.0061 0.0140 0.0901 0.2121 0.1244 0.0195 0.0140 0.0149 0.0585 0.0874 0.3805 , , Then we calculate , = 1.0089 Then we go ahead to compute D=max ( D=max ( The calculated D falls between 1.009 and 0.827 and the critical D is 9 at 5% level of significance. Since calculated D (significance D) we conclude that the data from a uniform distribution and conclude that there is no evidence to reject the null hypothesis that the random numbers were from a uniform distribution. The forecasts they achieved were evaluated by making use of Frequency test because the frequency of some numbers was not possible to be treated as the correct means to ascertain the assessment of the forecast and performance of varied inverse method. The benefit of making use of several forecasting options relates to the robustness in deciding for any predictor models Gap test – let as look at the gap between 0.0140 0.0061 0.0140 0.0901 0.2121 0.1244 0.0195 0.0140 0.0149 0.0585 0.0874 0.3805 Let us consider The critical value of D is given by D0.05 =1.36/ = 0.061 The calculated D = max |F(x) - SN(x)| is 0.0264 which is smaller than D 0.061, thus we accept the hypothesis of independence. It is also evident that the data does not indicate any evidences about the normality for any of the number. Thus not basis is found in indicating that there are skewed generalized error distributions in the context of generating the distributions of number. Poker test –we have two digits. 0.0061 0.0140 0.0901 0.2121 0.1244 0.0195 0.0140 0.0149 0.0585 0.0874 0.3805 Degree of freedom = n – 1 = 500 – 1 = 499 At 5% level of significance the acceptable value is 124.3. From the results it can be concluded that there is enough evident to suggest that 0.0140 is followed by 0.0901 thus the numbers generated are no entirely independent.The testing in this regard is done in the context of the parameters and is revealed whereby the null hypothesis is simply discarded at levels below 0.05. The Poker test in the context of values are inspired because of the temporal clusters of large numbers in the distribution as observed in the data above. The observed successes of such method occurs to some extent because of their capability in generating large numbers that have limited and unconditional variation. Because of such properties, testing procedures are usually considered in research studies as being options to stability procedures. When the testing actually become responsible for the complete observed numbers in the returns, it would be expected that the evidences that refute normality to be rejected will impact the inverse method after the effects of such exercises are considered. But the results in this paper are strongly indicative of the fact that even after the inverse method like behaviors have been taken into account; excessive large numbers will still be considerably non normal. In conducting tests for independence, the unreported results reveal that there is considerable variation amongst the use of inverse method. The issue becomes quite risky when reliance is placed on the frequency related to the use of data. It is possible to conceive that the variation that is ascertained by using the statistics will be extra accurate as compared to the other methods used. Randomness determined from data in view of the larger frequencies pertaining to statistics for every operational day. Although in some respects such results point at the success of ascertaining simple estimation from high frequency statistics, they still appear to be more complex than the non-random estimation obtained from other methods. It is better to confirm that such outcomes do not prove to become mere objects of the larger frequency differences amongst data. Comment findings This paper has focused upon Inverse transform method of generating random numbers by generating sample numbers. This method is appropriate since the population is quite large and it will be highly costly and long process to carry out the study at all these numbers therefore an appropriate random number generating could yield better results that are more reflective of the objective of the applied study. The result indicates that the numbers are not uniformly distributed and the frequency of the numbers is uniformly distributed. This means the numbers are not biased as shown by run test. Poker test show there is no proper sequence in the numbers except in the case of 0.0140 and 0.0901. Other method of testing for random numbers such as autocorrelations has not been debated in this paper. It can be concluded about the generated numbers that the given process is efficient in completely capturing the random numbers. But from a negative perspective, poker testing of data lies in the grouping of data, meaning that data in our case was not ideal for it thus being completely insufficient testing method. Works cited Biebighauser, Dan. Testing Random Number Generators. University of Minnesota - Twin Cities. Jan 2000. Web. 23 November 2015 Bagavathi, V. & Pillai, RS, 2003. Statistics - Theory and Practice. New Delhi: S.Chand & Company ltd. Bali T Gearge. Modeling the dynamics of interest rate volatility with skew fat-tailed distributions, Annals of Operations Research, 2007 1, 151-178. Bollerslev, Thomas 1986, Generalized autoregressive conditional heteroscedasticity, Journal of Econometrics, vol. 31, 307-27. Gentle, James. Computational Statistics New York: Springer, 2009. Print Gonzalo, J & Granger, CWJ 1995, ‘Estimation of common long memory components in co-integrated systems’, Journal of Business and Economics Statistics, vol. 13, no. 1, pp. 27-35. Poon S and Granger Charles. Forecasting financial market volatility: a review, Journal of Economic Literature, 2003, 41, pp.478–539. Xiannong , Meng. Frequency test. http://www.eg.bucknell.edu/~xmeng/Course/CS6337/Note/ master/node43.html , June 2002. Web. 23 November 2015. Xiannong , Meng.Gap test. http://www.eg.bucknell.edu/~xmeng/Course/CS6337/ Note/master /node46.html, June 2002. Web. 23 November 2015. Xiannong , Meng. Poker test. http://www.eg.bucknell.edu/~xmeng/Course/CS6337/ Note/master /node47.html, June 2002. Web. 23 November 2015. Xiannong , Meng. Run test. http://www.eg.bucknell.edu/~xmeng/Course/CS6337/Note/ master/node44.html , June 2002. Web. 23 November 2015. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(Method of Generating Random Number Assignment Example | Topics and Well Written Essays - 2750 words, n.d.)
Method of Generating Random Number Assignment Example | Topics and Well Written Essays - 2750 words. https://studentshare.org/mathematics/2054066-a-study-in-method-of-generating-random-number
(Method of Generating Random Number Assignment Example | Topics and Well Written Essays - 2750 Words)
Method of Generating Random Number Assignment Example | Topics and Well Written Essays - 2750 Words. https://studentshare.org/mathematics/2054066-a-study-in-method-of-generating-random-number.
“Method of Generating Random Number Assignment Example | Topics and Well Written Essays - 2750 Words”. https://studentshare.org/mathematics/2054066-a-study-in-method-of-generating-random-number.
  • Cited: 0 times

CHECK THESE SAMPLES OF Method of Generating Random Number

Changing Human Resource Management Practice

Project Proposal Gibaran Learning Group Michael Glover AIBA student ID number: A11035 Project Topic How has Generation Y changed HRM and the future impact on the work place Employee retention is a very important objective for organizations driven to consistently maintain competitive advantage and profitability.... (Finnegan 2009, p43) In an organizational attempt for employee retention and turnover, human resource managers have to examine, understand and manage the issue and that an effective management can positively impact the cost on recruitment, training, socialization and disruption, including a number of other indirect costs....
10 Pages (2500 words) Thesis Proposal

Statistical Methods In Psychology

Psychology is a broad science.... Methods appropriate in one area may be inappropriate in another.... The paper "Statistical Methods In Psychology" is concerned with the use of statistical methods and is not meant as an assessment of research methods in general.... ... ... ... Nine individuals were subsequently invited to join and all agreed....
5 Pages (1250 words) Essay

Decision-Making under Uncertainty

Relative frequency probability type gives the probability of an event through finding the ratio of the times the event occurs and the number of trials undertaken.... The other reason for the bias in statistical inference of historical data is that statistical inference is affected by the random variation of the data over time and this variation results in the change of the inference made at a point in time.... The difference in these methods in generating probability is that the theoretical probability assigns equal likelihood to all possible outcomes of an experiment, therefore, the chances of an event occurring is 1/n for each possible outcome....
2 Pages (500 words) Essay

Random Numbers Generation

In today's world there are various methods of generating random numbers being used.... While practicing the use of random numbers it is highly advisable to choose few random number generators that have an acceptable reputation.... Indeed, deriving an excellent random number is still a plight since computation of a series of random numbers cannot be generated by computers.... Various methods have been innovated to produce true random numbers and they include use of radioactive decay or quantum system, Lehmer's multiplicative congruently algorithm from which lots of random number generators are based, pseudo-random generators which are simple and when used together with Monte Carlo or multidimensional integration give a much satisfying result....
2 Pages (500 words) Essay

How Has Generation Y Changed HRM and the Future Impact

In an organizational attempt for employee retention and turnover, human resource managers have to examine, understand and manage the issue and that effective management can positively impact the cost of recruitment, training, socialization, and disruption, including a number of other indirect costs....
10 Pages (2500 words) Thesis Proposal

Exploring the Reliability and Validity of the Methods: Randomization and Blinding

"Exploring the Reliability and Validity of the Methods: Randomization and Blinding" paper discusses the randomization, split into the random assignment and allocation concealment, and blinding.... The first part is a random assignment, the generation of unpredictable randomized sequences of numbers....
10 Pages (2500 words) Essay

The Subject Area of Monte Carlo Methods in Financial Mathematics

Instead of applying random points in evaluating the integrals as in standard Monte Carlo, an individual is able to use a deterministic sequence which has appropriate properties.... The Monte Carlo method has proved to be important in integral evaluation.... These sequences are referred to as low discrepancy sequences and the method is named quasi-Monte Carlo....
19 Pages (4750 words) Term Paper

Components and Processes within a Polymerase Chain Reaction

This assignment "Components and Processes within a Polymerase Chain Reaction" presents polymerase chain reaction as a form of scientific technique that is made use of in the amplification of pieces of DNA that result in a great number of copies of a type of DNA sequence.... ... ... ...
6 Pages (1500 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us