Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Law of Large Numbers via Simulation | Random Sampling and Probabilistic Foundations
Quizzes & Challenges
Quizzes
Challenges
/
Simulation and Monte Carlo Modeling with Python

bookLaw of Large Numbers via Simulation

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookLaw of Large Numbers via Simulation

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

some-alt