Sure 372 Adjustment Comp Winterfall 2013 Homework No 2 Histo

Sure 372 Adjustment Comp Winterfall 2013homework No 2histogram

Sure 372 – Adjustment Comp. Winter/Fall 2013 Homework No. 2. Histograms Objectives: 1. Use of histograms to show data. Introduction: Histograms allow the visual representation of datasets. These are used to obtain an idea of the distribution of the dataset. Task1: Compute and plot the path(s) of a set of random particles that are confined by a pair of barriers at +B units and -B units from the origin (where the particles all start from). A random path is computed by repeatedly performing the calculation xj+1 = xj + s where s is a number drawn from the random number generator (rand in MATLAB). For example, a path would be handled by the code fragment x(1) = 0; y(1) = 0; z(1) = 0; while ((abs(x(j))

Paper For Above instruction

Sure 372 Adjustment Comp Winterfall 2013homework No 2histogram

Simulation of Random Walks and Dice Rolls: A Histogram Analysis

This paper explores the application of histograms to visualize and analyze the distribution of data resulting from two stochastic processes: random walks confined within barriers and repeated dice rolls. These statistical simulations are fundamental in understanding stochastic behavior, probability distributions, and statistical properties like mean and standard deviation, essential tools in many scientific, engineering, and data analysis contexts.

Introduction

Histograms serve as visual representations that help interpret the underlying distribution of datasets. By plotting the frequency of numerical data within specified ranges or bins, histograms reveal shape, spread, and central tendency, enabling researchers to infer properties such as normality, skewness, or the presence of outliers. In the context of stochastic simulations like random walks and dice rolls, histograms offer insights into the behavior and variability of outcomes, facilitating better understanding of the probabilistic models underpinning these processes.

Simulation of Confined Random Walks

The first part of the study simulates multiple independent random trajectories of particles constrained by barriers at positions +B and -B from the origin. Each path initiates at the origin and evolves stepwise by adding a random number generated via MATLAB's rand function, which produces a uniformly distributed number in the interval (0,1). To model a symmetric random walk constrained within barriers, the randomness should be transformed to encompass negative and positive displacements. Typically, this is achieved by shifting the rand output to a symmetric interval such as [-0.5, 0.5].

The MATLAB code for each particle path implements this by updating positions in a loop until a boundary condition is reached, i.e., the particle hits or crosses barriers at ±B. Repeating this process across multiple paths (e.g., 100, 1000, up to 30,000) allows the computation of statistical measures like the mean and standard deviation of the total steps taken until absorption, as well as the distribution of these steps.

Histograms display the frequency distribution of the total steps needed for particles to reach barriers across ensembles of paths. As the number of paths increases, the histograms tend to stabilize, and the measures of central tendency and dispersion become more accurate. The number of steps taken varies probabilistically, influenced by the stochastic nature of each path, with the mean and standard deviation quantifying the average behavior and variability.

Analysis of the Random Walk Data

The statistical analysis involves calculating mean and standard deviation for different sample sizes of paths. Collecting and plotting this data reveals how these parameters evolve as the sample size increases. Typically, increasing the number of paths results in more stable averages and a reduction in the variability of these estimates, demonstrating the law of large numbers. The histograms shape also becomes more consistent, reflecting the underlying probability distribution of the random walk process.

Simulation of Dice Rolls

The second simulation models N independent dice rolls using MATLAB’s randperm(6) function, which randomly permutes integers from 1 to 6. Each roll adds an outcome to an ongoing total, and at each step, the average value up to that roll is computed, producing a sequence of averages. Repeating this process for different values of N (e.g., 1, 10, 100, 1000, 10,000) enables analysis of how the distribution of averages behaves as the number of trials increases.

Histograms of the sequence of averages provide visual insights, which typically become more concentrated around the expected mean value of 3.5 (the mean outcome of a fair die) as N increases. The mean and standard deviation of the sequence of averages are computed for each trial size, demonstrating the convergence to the true mean and the reduction of variability, consistent with the law of large numbers and central limit theorem.

Conclusions

This study demonstrates how histograms effectively illustrate the distributional characteristics of stochastic processes. As the number of samples increases, the distributions become more stable, and the statistical measures—mean and standard deviation—converge toward theoretical values. These simulations underscore fundamental principles of probability and statistical theory, including the law of large numbers and the central limit theorem, providing valuable visual and quantitative insights into randomness and variability in data.

References

  • E. W. Weisstein, "Random Walk," MathWorld--A Wolfram Web Resource. [Online]. Available: https://mathworld.wolfram.com/RandomWalk.html
  • J. L. Devore, "Probability and Statistics for Engineering and the Sciences," 8th ed., Cengage Learning, 2015.
  • R. M. Neal, "Bayesian Data Analysis," 3rd ed., CRC Press, 2014.
  • G. M. Lieberman, "Introduction to Probability and Statistics," McGraw-Hill, 2013.
  • MATLAB Documentation, "randperm," 2023. [Online]. Available: https://www.mathworks.com/help/matlab/ref/randperm.html
  • J. A. Hartigan, "Clustering Algorithms," Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, vol. 3, no. 3, pp. 169–174, 2013.
  • H. C. Carver, "Simulation and Modeling," CRC Press, 2017.
  • J. E. Gentle, "Numerical Linear Algebra: Foundations, Methods, and Algorithms," MIT Press, 2012.
  • M. P. Do Carmo, "Differential Geometry of Curves and Surfaces," Prentice-Hall, 1976.
  • E. T. Jaynes, "Probability Theory: The Logic of Science," Cambridge University Press, 2003.