ForHosting KIT · Math

Rényi entropy calculator

Probabilities of 0.5 and 0.5 at order 2 give a Rényi entropy of 1 bit. Enter a list of probabilities or plain counts and an order α, and see the entropy, the normalized distribution and the power sum behind it. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Probabilities
0.5, 0.5
Alpha
2
You get
Total
1 bits
N
2
Sum p alpha
0.5
Renyi entropy
1

Rényi entropy is a one-parameter family of information measures that generalizes Shannon entropy for discrete probability distributions. For an order alpha other than one, it is defined from the alpha-power sum of the normalized probabilities and reduces to familiar special cases at particular orders, including Hartley entropy at zero and collision entropy at two. This calculator accepts a list of non-negative weights or probabilities and a finite order alpha, normalizes the list by its total, and returns the Rényi entropy in bits together with the normalized distribution and the intermediate power sum.

What Rényi entropy measures and how it relates to Shannon

Shannon entropy quantifies the average surprise of a discrete source under a single logarithmic expectation. The resulting H_alpha is measured in bits when the logarithm is base two. At alpha equal to zero the measure becomes the Hartley or max-entropy style count of the support size on a log scale.

At alpha equal to two it is the collision entropy, closely tied to the collision probability and often used in cryptography and randomness extractors. As alpha grows large the value is dominated by the largest probability mass and approaches the min-entropy. Different orders emphasize rare versus common events: lower alpha values are more sensitive to the tails of the distribution, while higher alpha values focus on the peak.

Using a single family with a tunable alpha lets information theorists, ML practitioners, and students compare the same source under several lenses without inventing a new definition each time. This page implements the classical discrete Rényi formula on a finite alphabet given by your array, not continuous differential entropy and not a Monte Carlo estimate of an unknown density.

Homework and information-theory labs

Students enter a short discrete distribution and order α, then check H_α in bits against hand calculation without installing a full scipy stack.

Cryptography and randomness quality

Engineers compare collision entropy (α = 2) and other orders on empirical symbol histograms when sizing extractors or auditing sources.

Diversity and ML feature weights

Pipelines turn non-negative class or topic weights into a single Rényi diversity number under a fixed α for dashboards and tests.

Why is alpha equal to one rejected?

The closed-form Rényi expression divides by (1−α), which is singular at α = 1.

What happens if the total of the probability array is zero?

A zero total cannot be normalized into a probability distribution. Validation failures are not charged.

Do I need probabilities that already sum to one?

No. Non-negative weights are accepted and divided by their total.

What does the Rényi entropy calculator cost?

The browser tool runs free on your device.

What does the order α change in Rényi entropy?

It sets which outcomes weigh most. Low orders are more sensitive to rare outcomes in the tails, high orders focus on the most likely outcome, and very large orders approach the min-entropy, which depends only on the biggest probability.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/renyi-entropy

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/renyi-entropy \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"probabilities":[0.5,0.5],"alpha":2}'
{
  "probabilities": [
    0.5,
    0.5
  ],
  "alpha": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.renyi_entropy",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Requests fail cleanly with invalid_input when the total weight is zero or when alpha is one, so automation never confuses the singular closed form with a successful Shannon value.

What Rényi entropy measures and how it relates to Shannon

Alfréd Rényi introduced a continuum of alternatives indexed by a real order alpha: after the distribution is written as non-negative probabilities that sum to one, form the sum of each probability raised to alpha, take the base-two logarithm of that sum, and scale by one over one minus alpha. As alpha approaches one the expression has a removable singularity and the limit recovers Shannon entropy, which is why this endpoint refuses alpha equal to one instead of silently switching formulas.

Input contract, normalization, response fields, and errors

Pair this tool with a Shannon calculator when you specifically need the alpha-to-one limit rather than forcing alpha equals one into the singular formula. Send a JSON object with two required fields. probabilities is a non-empty array of non-negative finite numbers; aliases probs, p, weights, and values are accepted, and a comma or whitespace separated string is also allowed for simple text forms. The engine sums the weights into a total and divides each entry by that total so unnormalized counts and histograms work the same as already-normalized probabilities. alpha is the Rényi order, a finite number that must not equal one; aliases order and a are accepted. On success the response includes n as the length of the array, alpha as the cleaned order, total as the sum of the raw weights before normalization, probabilities as the normalized distribution, sum_p_alpha as the sum of each normalized mass raised to alpha, renyi_entropy as H_alpha in bits, unit set to bits, formula as the closed-form string, and method set to renyi_entropy_bits. Validation fails with invalid_input and without charge when the list is missing or empty, any entry is negative or non-finite, the total of the weights is zero, alpha is missing or non-finite, alpha is one, the list exceeds the published size cap, or for negative alpha a zero probability would make a power infinite. Example: probabilities zero point five and zero point five with alpha two yield renyi_entropy equal to one bit, matching collision entropy of a fair binary source.

Practical uses, limits, pricing, and delivery

Use the free browser tool when you want an immediate Rényi number for a short histogram, a homework distribution, or a feature-importance weight vector while reading a paper that quotes H_alpha. Each successful request is one billable item at $0.002; failed validation does not consume balance. Keep arrays within the published maximum length so Worker isolates and browser paths stay fast; one hundred thousand non-negative weights cover classroom tables and typical empirical histograms. Results are fully deterministic: the same probabilities and alpha always yield the same renyi_entropy, with no language model, no external statistics service, and no random number generator on the hot path. When alpha is close to one but not exactly one, expect numerical sensitivity of the one-over-one-minus-alpha scale factor; for the true Shannon value use a dedicated Shannon endpoint or an analytic limit rather than an extremely close alpha. Wire the endpoint into cryptography labs that compare collision and min-style orders, into diversity indices that already speak Rényi language, or into any automation that needs a documented H_alpha instead of reimplementing log of power sums in every language.

How do I compute Rényi entropy with this calculator?

Send JSON with probabilities (non-negative numbers) and alpha (order ≠ 1). The API normalizes the weights and returns renyi_entropy in bits as 1/(1−α)·log2(Σ p_i^α), plus the normalized distribution and sum_p_alpha.

Read the full KIT documentation →