Entropia Shannon (2 classes)

−p·log₂(p) − (1−p)·log₂(1−p).
Created by
Renato Passos, Eng. de Software
Reviewed by
Renato Passos, Eng. de Software

Last updated: Apr 18, 2026

H
1,0000

About this calculator

Shannon entropy is a measure of uncertainty or randomness in a system. In this calculator, you can calculate the Shannon entropy for two classes using the formula H = -p·log₂(p) − (1−p)·log₂(1−p), where p is the probability of belonging to class 1.

This formula is applied in various fields, such as statistics, computer science and information technology. Some examples of when to use this calculator include data analysis of classification, measuring uncertainty in classification systems and comparing classification models.

However, it's essential to be careful when calculating the Shannon entropy, as the formula can be sensitive to small changes in the probabilities. Additionally, it's essential to ensure that the probabilities are valid and within the interval [0, 1].

Frequently asked questions

What is the Shannon entropy?

The Shannon entropy is a measure of uncertainty or randomness in a system.

What is the formula to calculate the Shannon entropy?

-p·log₂(p) − (1−p)·log₂(1−p), where p is the probability of belonging to class 1.

When should I use this calculator?

You can use this calculator for data analysis of classification, measuring uncertainty in classification systems and comparing classification models.

What are the precautions I should take when calculating the Shannon entropy?

It's essential to ensure that the probabilities are valid and within the interval [0, 1].

Other Estatistica Aplicada calculators