Statistics is the field that teaches you how to work with data: collect it, summarize it, compare it, and make decisions based on it. It answers questions like: is this result real or just luck? How much can I trust this average?
In artificial intelligence, statistics underpins almost everything, from how a model learns to how we measure whether it is good.
How it works
Statistical work usually follows a few steps. First, collect data from a population or a sample of it. Then, summarize that data with measures like mean, median and standard deviation.
Next comes inference: using the sample to draw conclusions about the whole, always with a margin of error. Hypothesis tests and confidence intervals are part of this stage.
Finally, the result is communicated with charts and numbers that other people can check.
Practical example
You have an online store and tested two texts for the buy button. Text A got 120 clicks out of 1,000 visits. Text B got 135 clicks out of 1,000 visits.
B looks better, but the difference could be chance. A statistical test tells you whether the difference is large enough to trust. Without it, you might switch texts for no reason.
The same applies to anyone comparing two AI models. If one gets 82% correct and another 80% on a few tests, there may be no real difference.
import statistics
notas = [8, 7, 9, 6, 8]
print(statistics.mean(notas))
print(statistics.stdev(notas))What it is for
Statistics is for making decisions with less guesswork. In business, it helps analyze sales, A/B tests and customer research.
In AI, it supports model evaluation, metric selection and the detection of data issues, such as bias and samples that do not represent the real audience.
For programmers, understanding the basics avoids wrong conclusions, like thinking a model improved when it just got lucky on a small test.
Difference between statistics and probability
Probability starts from a known model and calculates the chance of events, such as the chance of getting heads on a fair coin. Statistics goes the opposite way: it starts from observed data and tries to figure out how the world works. One feeds the other.