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

Population Estimate Calculator (Mark and Recapture, Random Samples)

Choose a mode for what you want to find, then enter the results of your survey. "Capture-recapture" estimates the total number, such as the fish in a pond. "Count in a population" estimates how many in the whole match a condition (such as the total number of defective items).

Enter counts as whole numbers. The answer from a sample is an estimate, so both the exact result of the division (a fraction) and a rounded "about ..." number are shown.
Result and graph
Enter the results of your survey in the fields on the left and press "Calculate". The estimate and a bar diagram will appear here.

What you can do on this page

  • Estimate the total size of a group you cannot count one by one, such as the fish in a pond, with the capture-recapture method (mark some, release them, catch a second group and check the share that is marked)
  • When you know the size of the whole population (for example, 3,000 products), estimate how many in it match a condition (the total number of defective items) from a random sample (for example, 2 defective out of 100)
  • Shows the steps with a proportion, just as in a middle school textbook (the product of the means equals the product of the extremes). The answer is shown both as the exact result of the division (a fraction) and as a rounded "about ..." number
  • A bar diagram lets you compare the share in the sample with the share in the population and see that they are the same
Estimates from a sample assume that the sample was chosen without bias, like drawing names from a hat (random sampling). The result is only an estimate and will differ somewhat from the real number.

What is this calculation used for?

Counting fish and wildlife populations (ecology and conservation)

To count animals that cannot all be counted, such as fish in a pond, deer in the mountains or invasive fish in a lake, researchers really use the capture-recapture method on this page. In fisheries management and invasive species control, the population estimate is the basic data for deciding catch limits and how big a control effort should be.
The method assumes that marks do not fall off, that few animals come or go (are born, die or move) during the study, and that the marked animals mix well with the rest. Real studies choose the timing and the method carefully to come close to these conditions.

Sample inspections in a factory (quality control)

Tests that destroy the product or make it unsellable, such as battery life tests or checking the contents of canned food, cannot be done on every item. Instead, a random sample is checked, and the total number of defective items is estimated from the defective share in the sample.
Estimating "about 60 in all" from 2 defective out of a sample of 100 is one of the most basic tools of quality control.

Opinion polls and TV ratings (social surveys)

Opinion polls such as the presidential approval rating do not ask every voter in the country. They estimate the share for the whole from a random sample of one thousand to a few thousand people. TV ratings, too, are shares for the whole audience estimated from a sample of households.
The power of sampling is that, as long as the sample is chosen at random, even a small sample can estimate the whole quite accurately (how big the error is depends on the sample size). Real surveys also add steps to avoid bias by region or age group, such as weighting, but the base is this idea of estimating the whole from the share in a sample.

Election night projections and exit polls

News networks can call a race when only a small share of the votes have been counted because they estimate each candidate's share of the total vote from samples: exit polls (interviews with people who just voted) and the part of the votes already counted.
Applying the share in a sample to the whole is the same idea as the proportion on this page. When calling a race, networks also combine data from past elections and statistical theory and decide carefully.

Formula and diagram

Capture-recapture (estimating the total)
Bar diagram
Standard notation (the usual math form)
\(x\) \(=\) \(m\) \(\times\) \(n\) \(\div\) \(k\)
In words (symbols replaced with words)
④ \(x\): total in the pond \(=\) ① \(m\): number marked \(\times\) ② \(n\): number in the 2nd catch \(\div\) ③ \(k\): marked in the 2nd catch
The formula in words
① Take the \(m\): number caught first and marked
② multiply it by the \(n\): number in the 2nd catch
③ divide by the \(k\): number marked in the 2nd catch
④ and you get the estimate of the \(x\): total in the pond
Quick example
If you mark 50 fish, put them back in the pond, and later catch 30 fish of which 6 are marked, the total number in the pond is
\(x\): total in the pond \(=\) number marked (50 fish) \(\times\) number in the 2nd catch (30 fish) \(\div\) number marked in it (6 fish)
\(x = \dfrac{50 \times 30}{6} = \dfrac{1500}{6} = 250\)
Key idea
This formula works because "the share of marked fish in the whole pond" and "the share of marked fish in the second catch" can be assumed to be about the same. If the marked fish mix evenly through the pond, the mix should be about the same wherever you scoop. So let \(x\) be the total in the pond, set up the proportion \(x : m = n : k\) (total : marked), and solve it with "the product of the means equals the product of the extremes" in the next card. This formula comes out. The answer is only an estimate. Counting every fish could give a different number, but the value of this method is that it gives you a good idea of the total without draining the pond.
Property of proportions (product of the means = product of the extremes)
Standard notation (the usual math form)
\(a\) \(:\) \(b\) \(=\) \(c\) \(:\) \(d\)
\(b \times c\) \(=\) \(a \times d\)
In words (symbols replaced with words)
extreme \(a\) \(:\) mean \(b\) \(=\) mean \(c\) \(:\) extreme \(d\)
① product of the means \(b \times c\) \(=\) ② product of the extremes \(a \times d\)
The formula in words
① When a proportion holds, the two inside terms (\(b\) and \(c\)) multiplied together, the product of the means \(b \times c\) ,
② and the two outside terms (\(a\) and \(d\)) multiplied together, the product of the extremes \(a \times d\) , are always equal
Quick example
Solving the proportion \(x : 50 = 30 : 6\) from the pond example gives
product of the means \(50 \times 30\) \(=\) product of the extremes \(x \times 6\)
\(50 \times 30 = x \times 6\)
\(6x = 1500\)
\(x = \dfrac{1500}{6} = 250\)
Key idea
The proportion \(a : b = c : d\) says that "the ratio of \(a\) to \(b\) equals the ratio of \(c\) to \(d\)". Written as fractions, it is the same as \(\dfrac{a}{b} = \dfrac{c}{d}\). Multiply both sides by \(b \times d\) and the denominators cancel, giving \(a \times d = b \times c\): the product of the extremes equals the product of the means. In fraction form this is the familiar "cross multiplication" (the cross products are equal). When a proportion has just one unknown number \(x\), this property turns it into an equation in \(x\) that you can solve. Estimating from a sample is an application of this property.
Estimating the matching count in a population
Bar diagram
Standard notation (the usual math form)
\(x\) \(=\) \(N\) \(\times\) \(k\) \(\div\) \(n\)
In words (symbols replaced with words)
④ \(x\): matching count in the population \(=\) ① \(N\): population size \(\times\) ② \(k\): matching in the sample \(\div\) ③ \(n\): sample size
The formula in words
① Take the \(N\): population size
② multiply it by the \(k\): number matching in the sample
③ divide by the \(n\): size of the sample you took
④ and you get the estimate of the \(x\): matching count in the population
Quick example
If you take 100 of 3,000 products at random, check them, and find 2 defective, the total number of defective items is
\(x\): total defective items \(=\) population size (3,000) \(\times\) defective in the sample (2) \(\div\) sample size (100)
\(x = \dfrac{3000 \times 2}{100} = \dfrac{6000}{100} = 60\)
Key idea
The idea is the same as capture-recapture: you assume that "the matching share in the population" and "the matching share in the sample" are about the same. You can also read it as multiplying the whole population \(N\) by \(\dfrac{k}{n}\) (the share in the sample). Let \(x\) be the matching count, set up the proportion \(N : x = n : k\) (total : matching), and solve it with "the product of the means equals the product of the extremes". This formula comes out. This estimate only works when the sample is chosen without bias, like drawing names from a hat (random sampling). For example, if a factory checks only "the first 100 items made", any quirk of the machine that day shows up in the result, and the estimate will be off.
Both modes rest on the same idea: "the share in the population and the share in a random sample are about the same". Just by solving a proportion (product of the means = product of the extremes), you can estimate the whole without counting everything. The answer is only an estimate, so the standard way is to give a rounded "about ..." number. Planning a survey, that is, how large a sample you need to keep the error within a limit, is covered by the sample size calculator in the related pages.

Symbols and terms

Symbols

\(x\) ex The letter used for a number you do not know yet (an unknown). On this page, the estimate you want, such as "the total in the pond" or "the matching count in the population", is called \(x\) to set up the proportion. The custom of using \(x\) for an unknown goes back to math books of the 1600s.
\(m\) em On this page, "the number caught first and marked". Think of it as m for "marked". It is also often used as a count together with \(n\).
\(n\) en The number in the sample (the second catch, or the number taken out and checked). It comes from "number" and is the standard letter for a count. In statistics, the sample size is written \(n\) by custom.
\(k\) kay The number in the sample that matched (the marked ones, the defective ones, and so on). Along with \(n\) and \(m\), it is a common letter for counts and positions.
\(N\) capital N The size of the whole population. By custom in statistics, the larger group is written with a capital letter to tell it apart from the sample size \(n\) (lowercase).
\(a : b\) a to b A way of writing a ratio. ":" is the ratio sign and is read "to". An equation that joins two ratios with an equals sign, such as \(a : b = c : d\), is a proportion.
\(\approx\) approximately equal to The sign for "almost equal". It can also be read "about". An answer from a sample is an estimate, so it is written with this sign or the word "about" instead of an equals sign.

Terms

sample survey A survey that studies only part of the population (a sample) and estimates what the whole looks like. It is used for things you cannot count completely or that are destroyed by testing. Students learn it in Grade 7 as random sampling and making inferences about a population.
census A survey that checks every member of the population. The US Census, taken every 10 years, is an example. Checking everything is accurate, but when it takes too much time or money, or when testing destroys the product, a sample survey is used instead.
population The whole group you want to study, such as all the fish in a pond, all the products a factory made, or all the voters in the country.
sample The part taken from the population that you actually study.
sample size The number of items in the sample. The larger the sample size, the smaller the error of the estimate becomes.
random sampling Taking a sample so that every member has the same chance of being chosen, like drawing names from a hat. No one picks on purpose. It is the basic condition for estimates from a sample to work.
capture-recapture A method that marks (tags) the animals caught, releases them, catches a second group after some time, and estimates the total from the share that is marked. Also called mark and recapture, it is really used to count fish and wildlife.
proportion An equation that says two ratios are equal, such as \(a : b = c : d\). The product of the means equals the product of the extremes, and this property lets you find an unknown number.
means In the proportion \(a : b = c : d\), the inside terms \(b\) and \(c\). The product of the means equals the product of the extremes. (This is not the average.)
extremes In the proportion \(a : b = c : d\), the outside terms \(a\) and \(d\). The product of the means equals the product of the extremes.
share How much of the whole a part takes up, found by dividing the part by the whole. Sample surveys rest on the idea that the share is the same in the population and in the sample.
rounded number An approximate number, cut off at a convenient place value by rounding. An answer from a sample is an estimate, so the standard way is to give a rounded number such as "about 250".
rounding To round to a place value, look at the digit just to its right. If it is 4 or less, round down; if it is 5 or more, round up.
estimate Judging what the whole looks like from the part of the information you have. An answer found from a sample is called an estimate in this sense.
error The gap between the estimate and the real value. Results from a sample always have some error, and the larger the sample size, the smaller the error becomes.

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.
If you get stuck, going back over the topics in this table is the fastest way forward.

Percents and shares (Grade 6)
  • Knowing that a share is how much of the whole a part takes up, found by dividing the part by the whole
  • Being able to write "20%" as a decimal such as 0.2
Ratios and proportions (Grades 6–7)
  • Understanding the ratio \(a : b\), and knowing that multiplying (or dividing) both parts by the same number does not change the ratio
  • Being able to find \(x\) in a proportion such as \(x : 4 = 6 : 8\) with the property of proportions (product of the means = product of the extremes)
Expressions and one-step equations (Grades 6–7)
  • Being able to call an unknown number \(x\) and write an equation from a word problem
  • Being able to solve an equation such as \(6x = 1200\) by dividing both sides by the same number
Rounding (Grades 3–4)
  • Being able to round to a given place value (example: 166.6 rounded to the nearest ten is 170)
  • Being able to write the answer to a division that does not come out even as a fraction or a rounded number

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table for capture-recapture (estimating the total)
Marked first m 50
2nd catch n 30
Marked in 2nd catch k 6
Estimated total x = m×n÷k =B1*B2/B3
Rounded to a whole number =ROUND(B4,0)
Table to check the property of proportions (product of the means = product of the extremes)
Extreme a (total; the answer to the pond example) 250
Mean b (number marked) 50
Mean c (2nd catch) 30
Extreme d (marked in 2nd catch) 6
Product of the means b×c =B2*B3
Product of the extremes a×d =B1*B4
Table to estimate the matching count in a population
Population size N 3000
Sample size n 100
Matching in sample k 2
Estimated count x = N×k÷n =B1*B3/B2
Rounded to a whole number =ROUND(B4,0)
After pasting, the upper rows (your survey results) are the inputs and the lower rows are calculated automatically.
The first table is the pond example (50 marked, 6 marked out of 30 in the second catch), and the answer is 250. When the division does not come out even, B4 shows a decimal, so read B5, which goes through the ROUND function, as the "about ..." answer.
The second table puts the answer 250 in for x in the proportion x : 50 = 30 : 6 and checks that the product of the means (B5) and the product of the extremes (B6) are both 1500, so they are equal.
The third table is the example of 3,000 products with 2 defective out of a sample of 100, and the answer is 60.

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 for capture-recapture (estimating the total)
Marked first m 50
2nd catch n 30
Marked in 2nd catch k 6
Estimated total x = m×n÷k =B1*B2/B3
Rounded to a whole number =ROUND(B4,0)
Table to check the property of proportions (product of the means = product of the extremes)
Extreme a (total; the answer to the pond example) 250
Mean b (number marked) 50
Mean c (2nd catch) 30
Extreme d (marked in 2nd catch) 6
Product of the means b×c =B2*B3
Product of the extremes a×d =B1*B4
Table to estimate the matching count in a population
Population size N 3000
Sample size n 100
Matching in sample k 2
Estimated count x = N×k÷n =B1*B3/B2
Rounded to a whole number =ROUND(B4,0)
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace the survey results with your own numbers.

How to calculate it in Python

from fractions import Fraction

# Capture-recapture: estimating the total number in the pond
marked_first = 50       # number caught first and marked, m
caught_second = 30      # number in the second catch, n
marked_in_second = 6    # number marked in the second catch, k

estimated_total = Fraction(marked_first * caught_second, marked_in_second)
# Adding Fraction(1, 2) and dropping the fraction part rounds 0.5 up every time
approx_total = int(estimated_total + Fraction(1, 2))
print(f"Estimated total (fraction): {estimated_total}")
print(f"Estimated total (rounded): about {approx_total}")

# Estimating the matching count in a population
population = 3000       # population size, N
sample_size = 100       # size of the sample taken, n
sample_hits = 2         # number matching in the sample, k

estimated_count = Fraction(population * sample_hits, sample_size)
approx_count = int(estimated_count + Fraction(1, 2))
print(f"Estimated count (fraction): {estimated_count}")
print(f"Estimated count (rounded): about {approx_count}")
With the fractions module from the standard library, you can calculate with exact fractions and no rounding error, even when the division does not come out even. The first half is the pond example (50 marked, 6 marked out of 30 in the second catch) and shows 250. The second half is the example of 3,000 products with 2 defective out of 100, and shows 60. Replace the survey results and run it.

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

Capture-recapture (estimating the total)
x = m × n ÷ k
x = \dfrac{m \times n}{k}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>x</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>m</mi><mo>&#x00D7;</mo><mi>n</mi></mrow>
      <mi>k</mi>
    </mfrac>
  </mrow>
</math>
x = (m*n)/k
(m*n)/k
x := m*n/k;
x = m*n/k;
x = (m×n)/k
Property of proportions (product of the means = product of the extremes)
a : b = c : d ⇔ a × d = b × c
a : b = c : d \iff ad = bc
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>a</mi><mo>:</mo><mi>b</mi>
    <mo>=</mo>
    <mi>c</mi><mo>:</mo><mi>d</mi>
    <mo>&#x21D4;</mo>
    <mi>a</mi><mi>d</mi>
    <mo>=</mo>
    <mi>b</mi><mi>c</mi>
  </mrow>
</math>
a : b = c : d <=> a*d = b*c
a*d == b*c
a*d = b*c;
a*d == b*c
a : b = c : d ⇔ a×d = b×c
Estimating the matching count in a population
x = N × k ÷ n
x = \dfrac{N \times k}{n}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>x</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>N</mi><mo>&#x00D7;</mo><mi>k</mi></mrow>
      <mi>n</mi>
    </mfrac>
  </mrow>
</math>
x = (N*k)/n
(N*k)/n
x := N*k/n;
x = N*k/n;
x = (N×k)/n

How to have ChatGPT  do the calculation

You are a math calculation assistant (middle school sampling). 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).

Estimate the total number of fish in a pond with the capture-recapture method.
First, 50 fish were caught, marked and put back in the pond. Later, 30 fish were caught, and 6 of them were marked.
Show each of the following:
1. The proportion with x as the total (x : number marked = number in the 2nd catch : number marked in it)
2. The steps to solve it with "the product of the means equals the product of the extremes"
3. The estimated total in the pond (if the division does not come out even, give both the fraction in lowest terms and the number rounded to the nearest whole number)

In Python, calculate exactly with the fractions module from the standard library, and show the formulas you used and 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.