tinycodinglm / math /math-0105.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 15)
b27bfb3 verified
|
Raw History Blame
1.45 kB
opencode trace
System You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing c...

You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies.

User

Explain the key concepts of statistics in math, with concrete details and common pitfalls. Include a runnable code example with its expected output.

Assistant

CLT: The sampling distribution of the sample mean approaches
a normal distribution as sample size increases, regardless of population shape.

python
import numpy as np
import matplotlib.pyplot as plt

np.random.seed(42)
population = np.random.exponential(scale=2, size=100000)
sample_means = [np.mean(np.random.choice(population, size=30)) for _ in range(10000)]

plt.hist(sample_means, bins=50, density=True, alpha=0.7)
plt.title('CLT: Sample Means (n=30)')
plt.show()

Key points:

  • Mean of sampling dist = population mean
  • Std dev = σ/√n (standard error)
  • n ≥ 30 is often sufficient for approximation