# Combinations and permutations calculator > How many ways can you pick them? Exact counts of combinations and permutations, with or without repetition, and the chance of one particular pick. Count the ways to choose k of n items with nCr and nPr, with or without order and repeats. Exact even for huge numbers, with the odds of one pick. - Page: https://how.box/combinations/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/combinations/?n={n}&k={k}&o={o}&r={r}&v={v} - `n` (whole number 0 to 1e6): How many items to pick from. Example: `49`. - `k` (whole number 0 to 1000): How many to pick. Example: `6`. - `o` (boolean): Order matters: 1 or 0. Example: `false`. - `r` (boolean): Repeats allowed: 1 or 0. Example: `false`. - `v` (count or lottery): View: count (the count) or lottery (the chance of one row of a draw). Example: `lottery`. Example answer: https://how.box/combinations/?n=49&k=6&o=0&r=0&v=lottery A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `combinations_count`: Exact number of ways to pick k of n items. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"combinations_count","arguments":{"n":49,"k":6,"order_matters":false,"repetition":false,"view":"lottery"}}}` - GET: https://how.box/mcp/run/combinations_count?n=49&k=6&order_matters=false&repetition=false&view=lottery ## How it works Counting the ways to pick things comes down to two questions: does the order matter, and can an item be picked again? A lottery draw ignores order and never repeats a ball, a race podium cares about order, and a PIN code cares about order and lets digits repeat. Without repeats, the number of ordered picks is P(n, k) = n! ÷ (n − k)!, where n! = 1 × 2 × … × n. Ignoring the order divides that by the k! ways to arrange the same picks: C(n, k) = n! ÷ (k! × (n − k)!). Choosing 6 numbers out of 49 gives 49! ÷ (6! × 43!) = 13,983,816 rows. With repeats, ordered picks are nᵏ (a four-digit PIN has 10⁴ = 10,000) and unordered picks are C(n + k − 1, k). The formulas follow Graham, Knuth and Patashnik's Concrete Mathematics. Counts grow very fast, so every digit is computed exactly and big results are also shown as a power of ten. The chance of one particular pick is 1 divided by the count, which holds only when every outcome is equally likely, as in a fair draw. ## FAQ **What is the difference between a combination and a permutation?** In a combination only which items are picked counts; in a permutation the order counts too. Every combination of k items can be arranged in k! orders, so there are k! times as many permutations. **How many possible PIN codes are there?** Turn on both switches and pick 4 of 10 digits: 10⁴ = 10,000 codes. Six digits give 1,000,000. **How many hands of 5 cards can a deck of 52 give?** The order of a hand doesn't matter and a card can't repeat, so it is C(52, 5) = 2,598,960 hands. **Why is the count 0?** Without repeats you cannot pick more items than there are: choosing 7 out of 5 has no way to do it. **Why is choosing no items counted as one way?** There is one empty selection. That is why choosing zero items gives one outcome, even when there are no items available. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)