+10 XP

Noise Is Real

The brain is not a deterministic machine. When a neuron receives the same input stimulus twice, it doesn't fire the exact same spikes. There's randomness from synaptic noise, stochastic channel opening/closing, and random thermal fluctuations.

How do you model this in code? With random numbers.

Why neuroscientists care:

Ignoring noise = building unrealistic models. Real neurons are probabilistic. A neuron with mean firing rate 50 Hz doesn't fire at exactly 50 Hz every second — it fires ~50, or 48, or 52. The exact number is random, following a Poisson distribution.

python
import numpy as np
import matplotlib.pyplot as plt

# Generate random spike counts (Poisson distribution)
# Poisson with lambda=50 Hz
spike_counts = np.random.poisson(lam=50, size=1000)  # 1000 trials

plt.hist(spike_counts, bins=30, edgecolor='black', alpha=0.7)
plt.axvline(x=spike_counts.mean(), color='r', linewidth=2, label=f'Mean = {spike_counts.mean():.1f}')
plt.xlabel('Spikes per second')
plt.ylabel('Count across 1000 trials')
plt.title('Random Spike Counts Follow Poisson Distribution')
plt.legend()
plt.show()

print(f'Mean: {spike_counts.mean():.1f}')
print(f'Std Dev: {spike_counts.std():.1f}')

Poisson(λ) models event counts when events arrive independently at rate λ. For spike trains, λ = firing rate.