Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Permutation and Combination Calculator (nPr, nCr)

Enter the total number of items n and the number you choose r. The calculator finds the permutations nPr (order matters) and the combinations nCr (order does not matter) at the same time. The formula below is linked to the input fields, so you can also edit n and r directly in it.

Enter n and r as whole numbers of 0 or more (r must not be larger than n). n can be up to 10000, and every digit of the answer is shown exactly, even when it runs to dozens of digits.
Result
Enter the total number of items n and the number you choose r in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Just enter the total number of items \(n\) and the number you choose \(r\). You get both the permutations \({}_{n}\mathrm{P}_{r}\) (ways to choose when order matters) and the combinations \({}_{n}\mathrm{C}_{r}\) (ways to choose when order does not matter) at once
  • Answer counting questions such as "How many ways can an 11-player soccer team pick a captain and a goalkeeper?" or "How many ways can it pick 2 forwards?" in one step
  • Even for a large \(n\) where the answer has dozens or hundreds of digits, every digit is shown exactly, with no rounding
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This page covers permutations and combinations without repetition, where an item cannot be chosen again once it is picked. When the same item can be chosen any number of times, like the faces of a die (permutations or combinations with repetition), the formulas are different, so this calculator does not handle them.

What is this calculation used for?

Putting a number on lottery odds

In Powerball, you pick 5 white balls from 69 and 1 red Powerball from 26. The order of the white balls does not matter, so they are a combination: \({}_{69}\mathrm{C}_{5} = 11{,}238{,}513\) ways. Multiply by the 26 choices for the red ball and you get \(292{,}201{,}338\) possible tickets. Only 1 of them wins the jackpot, so the odds are about 1 in 292 million.
The combination formula lets you check how hard it is to win a lottery or a prize draw with real numbers instead of a vague feeling.

Counting the ways to pick class officers or helpers

In a class of 30 students, choosing a class president and a vice president means the roles are different, so it is a permutation: \({}_{30}\mathrm{P}_{2} = 30 \times 29 = 870\) ways. Just picking 2 students for a cleanup duty, on the other hand, does not depend on order, so it is a combination: \({}_{30}\mathrm{C}_{2} = 435\) ways.
Once you know that the count changes depending on whether roles or order matter, you can count correctly for drawings and elections.

Finding the number of games in a round robin

In a round robin, every team plays every other team once. Each game is a choice of 2 teams, so \(n\) teams play \({}_{n}\mathrm{C}_{2}\) games. With 10 teams, that is \({}_{10}\mathrm{C}_{2} = 45\) games.
Tournament organizers use this calculation to estimate how many games, days and fields they need.

Counting PIN codes and lock codes (security)

If you make a 4-digit code from the 10 digits 0 to 9 without using any digit twice, order matters, so there are \({}_{10}\mathrm{P}_{4} = 5{,}040\) codes. The more codes there are, the harder it is to break the lock by trying them all, and permutations also show how much adding one more digit helps.
By the way, a "combination lock" only opens when the numbers are entered in the right order, so mathematically it is a permutation lock, not a combination lock.

Sampling inspection for quality control (manufacturing)

When 5 products are picked for inspection from a batch of 100, there are \({}_{100}\mathrm{C}_{5} = 75{,}287{,}520\) ways to pick them.
The theory of statistical sampling inspection is built on counts like this. It finds the chance that an inspection catches a defective product in the batch, and it is a key part of quality assurance in factories.

Formula

Factorial \(n!\) (ways to arrange all \(n\) items)
Standard notation (the usual math form)
\(n!\) \(=\) \(n \times (n-1) \times \cdots \times 2 \times 1\)
In words (symbols replaced with words)
② \(n!\): ways to arrange all \(n\) items \(=\) ① the product of the whole numbers from \(n\) down to \(1\)
The formula in words
① Multiply all the whole numbers from \(n\) down to \(1\) together
② and you get the \(n!\): ways to arrange all \(n\) items
Quick example
The number of ways to line up 4 people (A, B, C and D) in a row is
ways to line up all 4 people \(4!\) \(=\) the product from 4 down to 1
\(4! = 4 \times 3 \times 2 \times 1 = 24\)
Key idea
There are \(n\) choices for the first place, then \((n-1)\) choices for the next place from those left, and so on. The number of choices goes down by 1 each time, so multiplying them all gives the number of ways to arrange everything. By definition, \(0! = 1\) (there is exactly 1 way to arrange nothing). Thanks to this rule, the permutation and combination formulas below also work as they are when \(r = n\) or \(r = 0\).
Permutations \({}_{n}\mathrm{P}_{r}\) (order matters)
Standard notation (the usual math form)
\({}_{n}P_{r}\) \(=\) \(n!\) \(\div\) \((n-r)!\)
In words (symbols replaced with words)
③ \({}_{n}\mathrm{P}_{r}\): number of ordered arrangements \(=\) ① \(n!\): ways to arrange all \(n\) items \(\div\) ② \((n-r)!\): ways to arrange the rest
The formula in words
① Take the \(n!\): ways to arrange all \(n\) items
② divide it by the \((n-r)!\): ways to arrange the \((n-r)\) items not chosen
③ and you get the \({}_{n}\mathrm{P}_{r}\): number of ways to choose \(r\) of \(n\) items in order
Quick example
The number of ways to choose a captain and a goalkeeper from the 11 players of a soccer team (the roles are different, so order matters) is
2 of 11 people in order \({}_{11}\mathrm{P}_{2}\) \(=\) ways to arrange all 11 (11!) \(\div\) ways to arrange the other 9 (9!)
\({}_{11}P_{2} = \dfrac{11!}{(11-2)!} = \dfrac{11!}{9!} = 11 \times 10 = 110\)
Key idea
Out of the \(n!\) ways to arrange all \(n\) items, the order of the \((n-r)\) items that were not chosen does not matter, so we divide by \((n-r)!\). That is what this formula means. When you work it out by hand, the fraction cancels down to "multiply \(r\) numbers, counting down from \(n\)". For \({}_{11}\mathrm{P}_{2}\) that is \(11 \times 10 = 110\). A permutation counts "captain A, goalkeeper B" and "captain B, goalkeeper A" as two different choices.
Combinations \({}_{n}\mathrm{C}_{r}\) (order does not matter)
Standard notation (the usual math form)
\({}_{n}C_{r}\) \(=\) \({}_{n}P_{r}\) \(\div\) \(r!\)
In words (symbols replaced with words)
③ \({}_{n}\mathrm{C}_{r}\): number of ways to choose \(=\) ① \({}_{n}\mathrm{P}_{r}\): choices in order \(\div\) ② \(r!\): ways to reorder the \(r\) chosen items
The formula in words
① Take the \({}_{n}\mathrm{P}_{r}\): choices in order
② divide it by the \(r!\): ways to reorder the \(r\) chosen items to remove the repeats caused by order
③ and you get the \({}_{n}\mathrm{C}_{r}\): number of ways to choose \(r\) of \(n\) items
Quick example
The number of ways to choose 2 forwards from the 11 players of a soccer team (the order of the 2 does not matter) is
2 of 11 people \({}_{11}\mathrm{C}_{2}\) \(=\) choices in order (110 ways) \(\div\) ways to reorder 2 people (2! = 2 ways)
\({}_{11}C_{2} = \dfrac{{}_{11}P_{2}}{2!} = \dfrac{110}{2} = 55\)
Key idea
Among the 110 permutations, each pair of people is counted \(2! = 2\) times, once as "A and B" and once as "B and A". Dividing by \(r!\) removes these repeats and leaves only the number of different groups. Substitute the permutation formula \({}_{n}\mathrm{P}_{r} = \dfrac{n!}{(n-r)!}\) and you get the familiar textbook form \({}_{n}\mathrm{C}_{r} = \dfrac{n!}{r!\,(n-r)!}\). \({}_{n}\mathrm{C}_{r}\) is also called a binomial coefficient and is often written \(\binom{n}{r}\), read "n choose r".
The permutations nPr count the ways to choose when order matters, and the combinations nCr count the ways to choose when order does not matter. The easiest way to remember them is this link - find the permutations first, then divide by \(r!\) to remove the repeats caused by order, and you have the combinations.

Symbols and terms

Symbols

\(n\) en The total number of items you choose from. (Example - choosing from 11 people, \(n = 11\))
\(r\) ar The number of items you choose from the total. (Example - choosing 2 people, \(r = 2\))
\(n!\) n factorial The product of all the whole numbers from \(n\) down to \(1\). It is the number of ways to arrange all \(n\) items in a row. By definition, \(0! = 1\). (Example - \(4! = 4 \times 3 \times 2 \times 1 = 24\))
\({}_{n}\mathrm{P}_{r}\) n P r The number of ways to choose \(r\) of \(n\) items and put them in order (permutations). P stands for "permutation". It is also written \(P(n, r)\).
\({}_{n}\mathrm{C}_{r}\) n C r The number of ways to choose \(r\) of \(n\) items (combinations). C stands for "combination". It is also written \(C(n, r)\).
\(\binom{n}{r}\) n choose r (binomial coefficient) Another way to write \({}_{n}\mathrm{C}_{r}\). This is the form most often used in college math and in many textbooks.

Terms

counting Finding how many possible outcomes there are in total. Permutations and combinations are both tools for counting.
permutation A way to choose \(r\) of \(n\) items and put them in a row, where order matters. Different roles or ranks, such as "captain and vice captain", are counted as different.
combination A way to choose \(r\) of \(n\) items where order does not matter. As with "2 people for a cleanup duty", the same group of people counts as 1 way.
factorial Multiplying all the whole numbers from \(n\) down to \(1\). The symbol is \(n!\), and it gives the number of ways to arrange all \(n\) items.
binomial coefficient Another name for \({}_{n}\mathrm{C}_{r}\). The name comes from the fact that the coefficients you get when you expand \((a+b)^n\) are exactly the values of \({}_{n}\mathrm{C}_{r}\).
tree diagram A branching diagram that lists every possible outcome, so you count each one exactly once. The permutation and combination formulas do the same counting as a tree diagram in a single calculation.
permutation with repetition A permutation where the same item can be chosen any number of times. There are \(n^r\) of them. The calculator on this page only handles the case without repetition.
combination with repetition A combination where the same item can be chosen any number of times. The calculator on this page only handles the case without repetition.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Multiplication and division (Grades 3–5)
  • Being able to multiply whole numbers, as in \(11 \times 10\), and divide, as in \(110 \div 2\)
Counting outcomes and tree diagrams (Grade 7)
  • Being able to list all possible outcomes with a tree diagram or similar, counting each one exactly once
  • Seeing that arranging (order matters) and choosing (order does not matter) are two different ways of counting
Factorial notation (high school, Algebra 2 or Precalculus)
  • Knowing that \(n!\) means "multiply everything from \(n\) down to \(1\)"
  • Knowing the rule that \(0! = 1\)
Permutations and combinations (high school, Algebra 2 or Statistics)
  • Choosing correctly between them - the permutations nPr when order matters, the combinations nCr when it does not
  • Being able to explain that combinations are "permutations divided by \(r!\) to remove the repeats caused by order"

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the factorial n!
Items to arrange n 4
All arrangements n! =FACT(B1)
Table to find the permutations nPr
Total items n 11
Items chosen r 2
Permutations nPr =PERMUT(B1,B2)
Table to find the combinations nCr
Total items n 11
Items chosen r 2
Combinations nCr =COMBIN(B1,B2)
After pasting, B1 (and B2) are your inputs and the last row is calculated automatically.
FACT, PERMUT and COMBIN are the Excel functions for the factorial, permutations and combinations.
For example, B3 shows 110 in the second table and 55 in the third. Just replace B1 and B2 with your own numbers.
Note that Excel keeps only 15 significant digits, so when n is large and the answer has dozens of digits, the last digits are rounded.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the factorial n!
Items to arrange n 4
All arrangements n! =FACT(B1)
Table to find the permutations nPr
Total items n 11
Items chosen r 2
Permutations nPr =PERMUT(B1,B2)
Table to find the combinations nCr
Total items n 11
Items chosen r 2
Combinations nCr =COMBIN(B1,B2)
The same formulas as in Excel work as is (FACT, PERMUT and COMBIN have the same names in Google Sheets).
Copy the whole table, paste it into cell A1, and replace B1 and B2 with your own numbers.

How to calculate it in Python

import math

total_items = 11    # total number of items n
chosen_items = 2    # number of items chosen r

permutations = math.perm(total_items, chosen_items)   # permutations nPr
combinations = math.comb(total_items, chosen_items)   # combinations nCr

print(f"Permutations nPr (order matters): {permutations}")
print(f"Combinations nCr (order does not matter): {combinations}")
Runs with just the standard math library (math.perm and math.comb need Python 3.8 or later). Python integers have no limit on the number of digits, so the answer stays exact even with hundreds of digits. Change the first two numbers and run it.

How to write it in LaTeX and other math languages (copy and paste)

Factorial \(n!\) (ways to arrange all \(n\) items)
n! = n × (n − 1) × ⋯ × 2 × 1
n! = n \times (n-1) \times \cdots \times 2 \times 1
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>n</mi><mo>!</mo>
    <mo>=</mo>
    <mi>n</mi>
    <mo>&#xD7;</mo>
    <mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>1</mn><mo>)</mo>
    <mo>&#xD7;</mo>
    <mo>&#x22EF;</mo>
    <mo>&#xD7;</mo>
    <mn>2</mn>
    <mo>&#xD7;</mo>
    <mn>1</mn>
  </mrow>
</math>
n! = n xx (n-1) xx cdots xx 2 xx 1
Factorial[n]
nFactorial := factorial(n);
n_factorial = factorial(n);
n! = n × (n − 1) × ⋯ × 2 × 1
Permutations \({}_{n}\mathrm{P}_{r}\) (order matters)
ₙPᵣ = n! ÷ (n − r)!
{}_{n}P_{r} = \dfrac{n!}{(n-r)!}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mmultiscripts>
      <mi>P</mi>
      <mi>r</mi><none/>
      <mprescripts/>
      <mi>n</mi><none/>
    </mmultiscripts>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>n</mi><mo>!</mo></mrow>
      <mrow><mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mi>r</mi><mo>)</mo><mo>!</mo></mrow>
    </mfrac>
  </mrow>
</math>
P(n, r) = (n!)/((n-r)!)
n!/(n - r)!
nPr := factorial(n)/factorial(n - r);
npr = factorial(n)/factorial(n - r);
P(n,r) = n!/(n − r)!
Combinations \({}_{n}\mathrm{C}_{r}\) (order does not matter)
ₙCᵣ = n! ÷ (r! × (n − r)!)
{}_{n}C_{r} = \dfrac{n!}{r!\,(n-r)!}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mmultiscripts>
      <mi>C</mi>
      <mi>r</mi><none/>
      <mprescripts/>
      <mi>n</mi><none/>
    </mmultiscripts>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>n</mi><mo>!</mo></mrow>
      <mrow>
        <mi>r</mi><mo>!</mo>
        <mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mi>r</mi><mo>)</mo><mo>!</mo>
      </mrow>
    </mfrac>
  </mrow>
</math>
C(n, r) = (n!)/(r!(n-r)!)
Binomial[n, r]
nCr := binomial(n, r);
ncr = nchoosek(n, r);
C(n,r) = n!/(r!(n − r)!)

How to have ChatGPT  do the calculation

You are a calculation assistant for counting (permutations and combinations). Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

A soccer team has 11 players.
1. How many ways are there to choose a captain and a goalkeeper? (The roles are different, so this is a permutation.)
2. How many ways are there to choose 2 forwards? (The order of the 2 does not matter, so this is a combination.)

For each question, say whether you used the permutations nPr or the combinations nCr, and show the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.