Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Law of Large Numbers via Simulation | Random Sampling and Probabilistic Foundations
Simulation and Monte Carlo Modeling with Python

bookLaw of Large Numbers via Simulation

Taak

Swipe to start coding

You will implement a Python function that demonstrates the law of large numbers using samples drawn from a standard normal distribution.

Your task is to complete the required parts of the code so that:

  1. The function accepts an integer n_samples.
  2. Generates n_samples independent samples from a normal distribution with mean 0 and standard deviation 1 using NumPy.
  3. Computes the running mean after each newly drawn sample.
  4. Plots the running mean against the sample index using Matplotlib.
  5. Draws a horizontal line at 0, representing the theoretical mean of the distribution.

Follow the placeholders in the task code. Use only numpy and matplotlib.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookLaw of Large Numbers via Simulation

Veeg om het menu te tonen

Taak

Swipe to start coding

You will implement a Python function that demonstrates the law of large numbers using samples drawn from a standard normal distribution.

Your task is to complete the required parts of the code so that:

  1. The function accepts an integer n_samples.
  2. Generates n_samples independent samples from a normal distribution with mean 0 and standard deviation 1 using NumPy.
  3. Computes the running mean after each newly drawn sample.
  4. Plots the running mean against the sample index using Matplotlib.
  5. Draws a horizontal line at 0, representing the theoretical mean of the distribution.

Follow the placeholders in the task code. Use only numpy and matplotlib.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

some-alt