在線即時計算器 · 純前端本地秒算 · 零數據上傳

📐 Combinations With Repetition 計算機

專業免費的 Combinations With Repetition 計算機。純前端本機毫秒級計算、零資料上傳、極致隱私保護。提供詳細公式推導、實例示範與常見問答。

即時推算結果 (Computed Output)
10 multisets of size r from n types
專業公認計算模型,即時運算完畢
📜 計算歷史記錄 (試算軌跡)
尚無歷史記錄,每次點擊「計算」將在此留下試算軌跡...

What is combinations with repetition?

Combinations with repetition count the number of ways to choose r items from n distinct types when you are allowed to pick the same type more than once and the order of selection does not matter. This quantity is often written as nHr and is also called the multiset coefficient. It answers questions like "how many different scoops can I get from 4 ice-cream flavors if I take 2 scoops and repeats are fine?"

How to use this calculator

Enter the number of distinct types n (must be at least 1) and the number of items you wish to choose r (zero or more). Click calculate and the tool returns nHr, the exact number of distinct multisets. Both inputs are plain non-negative integers; there are no units to convert.

The formula explained

The core identity is

\overline{C}(n,r) = \binom{n + r - 1}{r} = (((n + r - 1)!) ÷ (r! · (n - 1)!)).
The trick: lining up r chosen items and (n - 1) dividers between the types gives n + r - 1 positions, and we choose where the items (or dividers) go. To avoid huge factorials, this calculator evaluates the binomial coefficient with a stable multiplicative loop, multiplying by (m - k + i) and dividing by i for i = 1..k, where m = n + r - 1 and k = \min(r, n - 1).

Worked example

With the defaults n = 4, r = 2:

\overline{C}(n,r) = \binom{4 + 2 - 1}{2} = \binom{5}{2} = ((5 · 4) ÷ (2 · 1)) = 10.
The ten combinations from types {a, b, c, d} are: aa, ab, ac, ad, bb, bc, bd, cc, cd, dd.

使用注意事項與精準校對原則(6 大核心守則)

📐 1. 嚴格對齊輸入量綱與單位

輸入各項數值時請務必確認量綱(例如小時、天數、金額、百分比),避免單位不匹配引發推算偏差。

🔒 2. 純前端本機毫秒級隱私保障

所有計算邏輯 100% 在您的終端瀏覽器內完成,資料絕不上傳伺服器,嚴格守護商業與個人隱私。

📊 3. 符合公認學術與產業計算模型

演算法嚴格遵循國際通用數學公式與標準計算模型,經多重情境交叉核對,數值嚴密精確。

📋 4. 一鍵複製與免登入 PDF 匯出

支援一鍵複製推算結果字串至剪貼簿,亦可直接點擊列印按鈕輸出純淨 PDF 工作報表。

🔄 5. 多情景敏感度動態對比

建議針對極端值與多組預期情景分別試算,觀察輸出數據的波動區間,輔助做出更穩健的決策。

🛡️ 6. 專業諮詢與日常參考免責聲明

本工具運算結果供日常排程、學業研習與事前參考之用,如涉及重大法規或投資決策請諮詢持證專家。

常見問題 (FAQ)

How is this different from ordinary combinations?
Ordinary combinations \(C(n, r)\) forbid repetition, so each item is chosen at most once; here repetition is allowed, giving a larger count.
What if r = 0?
There is exactly one combination: the empty selection, so \(\overline{C}(n,r) = 1\).
What if n = 1?
With only one type you must pick it \(r\) times, so there is exactly one multiset and \(\overline{C}(n,r) = 1\) for any \(r\).