1. You increase the number of trials or observations, the average of the results gets closer to the expected value or the theoretical mean.

  2. As the sample size grows, the distribution of the sample mean will tend to be approximately normal, even if the population from which the sample is drawn is not normally distributed. The sample mean’s distribution becomes closer to a normal distribution with a mean (μ) and a standard deviation (σ/√N), where N is the sample size.

  3. Similarity:
    They both describe the distribution of sample means and how these means behave as the sample size increases.
    Differences:
    The LLN focuses on the convergence of the sample mean to the population mean as the sample size grows. The CLT describes the shape of the distribution of sample means.

  4. Exponential distribution
    It is a continuous probability distribution often used to model the time until an event occurs, such as failure or arrival times. The Exponential distribution is memoryless, meaning the probability of an event occurring in the next unit of time is the same, regardless of how much time has already elapsed. It is characterized by its rate parameter \(λ\), where \(λ>0\). The mean \(μ\) of the Exponential distribution is \(1/λ\), and the standard variance is \(1/λ\).

# Function to apply CLT on Exponential distribution for a given statistic
clt_exponential <- function(lambda, sample_size, num_samples, stat = 'mean') {
  stats <- numeric(num_samples)
  for (i in 1:num_samples) {
    sample <- rexp(sample_size, rate = lambda)
    if (stat == 'mean') {
      stats[i] <- mean(sample)
    } else if (stat == '80th_percentile') {
      stats[i] <- quantile(sample, probs = 0.8)
    }
  }
  stats
}

# Parameters
lambda <- 0.5
sample_size <- 30
num_samples <- 1000

# Apply CLT to sample means
sample_means <- clt_exponential(lambda, sample_size, num_samples, 'mean')

# Apply CLT to the 80th percentile
sample_80th <- clt_exponential(lambda, sample_size, num_samples, '80th_percentile')

# Plot the distribution of sample means
hist(sample_means, breaks = 30, col = 'skyblue', main = 'Distribution of Sample Means', xlab = 'Sample Mean', ylab = 'Frequency')

# Plot the distribution of 80th percentiles
hist(sample_80th, breaks = 30, col = 'lightgreen', main = 'Distribution of Sample 80th Percentiles', xlab = 'Sample 80th Percentile', ylab = 'Frequency')

mean <- 1 / lambda
std <- 1 / lambda

# Print the results
cat("Mean:", mean, "\n")
## Mean: 2
cat("Standard Deviation:", std, "\n")
## Standard Deviation: 2

The Central Limit Theorem (CLT) appears to hold for the Exponential distribution as expected. The distribution of the sample means from the Exponential distribution is approaching a normal distribution, as indicated by the histogram. This is consistent with the CLT, which predicts that the sampling distribution of the mean will be normally distributed, regardless of the shape of the population distribution, as the sample size grows.