CalcBE
Calculators Search
Autres langues ja | en | zh-CN | es | pt-BR | id | fr | hi-IN | ar

Calculateur étoiles et barres

Calculez les répartitions avec répétition en quelques secondes, avec détail des formules utilisées.

Comment l'utiliser (3 étapes)

  1. Enter n (total) and k (number of variables / boxes).
  2. Select the condition: xi ≥ 0, xi ≥ 1, or xi ≥ ai (optional: bounded).
  3. Copy a shareable URL to reproduce the same state.

Note: This page counts identical balls. If balls are distinct, the model is different.

Visual guide

For small inputs, this shows one example encoding with stars (*) and bars (|). It is an illustration, not “the only arrangement”.

Condition
Examples:

Result

Condition:
Method:
Value:
Digits:
Formula:

Steps (short)

Afficher le raisonnement

    Examples (solutions)

    Afficher les solutions pour petits n,k

    Tip: Solutions listing is capped (performance). For large inputs, use the count only.

    Formulas & common mistakes

    Common mistakes

    Calculatrices associées

    FAQ

    Qu’est-ce que la méthode des étoiles et barres ?

    It counts the number of ways to distribute n identical items into k boxes, which is the number of solutions to x1+…+xk=n under conditions like xi≥0.

    Pourquoi le cas non négatif devient-il C(n+k−1, k−1) ?

    Place n stars and k−1 bars in a row. Choosing bar positions uniquely determines a solution, giving C(n+k−1, k−1).

    Comment la formule change-t-elle quand xi≥1 ?

    Let yi=xi−1. Then y1+…+yk=n−k with yi≥0, so the count is C(n−1, k−1) when n≥k, otherwise 0.

    Comment fonctionnent les bornes inférieures xi≥ai ?

    Let yi=xi−ai. Then y1+…+yk=n−Σai with yi≥0. If n≥Σai, the count is C((n−Σai)+k−1, k−1); otherwise 0.

    Et si les objets sont distinguables ?

    This calculator assumes identical balls. If balls are distinguishable, the model changes (often k^n or multinomial), so use a different calculator depending on the problem.

    Related (auto)