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

bookLaw of Large Numbers via Simulation

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 4
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

bookLaw of Large Numbers via Simulation

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 4
single

single

some-alt