Verify Law of Large Numbers - MATLAB Cody - MATLAB Central

Problem 44951. Verify Law of Large Numbers

Difficulty:Rate
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,...N i.e. the expected value of one die. For example, the expected value of a 6-sided die is 3.5.
Given N, simulate 1e8 N-sided dice rolls by creating a vector of 1e8 uniformly distributed random integers. Return the difference between the mean of this vector and the mean of integers from 1 to N.

Solution Stats

32.54% Correct | 67.46% Incorrect
Last Solution submitted on May 14, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Group

MATLAB Onramp Practice Image
MATLAB Onramp Practice
  • 15 Problems
  • 4632 Finishers

Problem Recent Solvers11472

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!