On this page
When you have to calculate the chance that a number picked at random between 1 and 100 is divisible by 3 or 5, you cannot simply count the multiples of 3 and add the multiples of 5. Some numbers, like 15 and 30, are divisible by both, which means a simple addition counts them twice and inflates your final result.
Probability is formally the number of favourable outcomes divided by the total number of outcomes, yielding a value between 0 and 1, according to BYJU'S probability guide. To find the exact count of our favourable outcomes without missing or double-counting any items, we use a basic counting rule from set theory.
How to find the probability of a number from 1 to 100 divisible by 3 or 5?
First, state the total number of possible outcomes. When picking from the integers 1 to 100, there are exactly 100 numbers to choose from. This complete set of possibilities is known as your sample space.
Next, count the numbers divisible by 3. A quick way to do this without listing them out is to divide 100 by 3 and take the floor value. Because 100 ÷ 3 = 33.33, there are exactly 33 multiples of 3 in this range (starting with 3, 6, 9, and going up to 99).
Then, count the numbers divisible by 5. Dividing 100 by 5 gives exactly 20. There are 20 multiples of 5 (5, 10, 15, and so on up to 100).
If we simply added these together, we would get 53. But that number is wrong, because we have counted some integers twice.
What about the multiples of 15?
Because numbers such as 15, 30, 45, 60, 75 and 90 are multiples of both 3 and 5, they appear in both the group of 33 and the group of 20.
The cardinality formula for two sets states that the size of their union is n(A ∪ B) = n(A) + n(B) − n(A ∩ B), as detailed by BYJU'S on set operations. In our case, the intersection—the numbers that exist in both groups simultaneously—consists of the multiples of 15, which is the lowest common multiple (LCM) of 3 and 5. The LCM is exactly the point where the two multiplication tables first meet, and every subsequent overlap will also be a multiple of this LCM. We have to subtract this overlap so we do not count those numbers twice.
Dividing 100 by 15 gives 6.66, which means there are exactly 6 multiples of 15 in this range.
Applying the formula: 33 (divisible by 3) + 20 (divisible by 5) − 6 (divisible by both) = 47.
There are 47 numbers between 1 and 100 that are divisible by 3 or 5. Dividing this by the total 100 outcomes gives a probability of 47/100, or 0.47.
If you struggle with double-counting or applying the inclusion-exclusion principle across multiple variables, the Fermi Concept Library contains every concept in mathematics and computing, each with its own lesson and its place in the map.
What is the probability of a number divisible by neither 3 nor 5?
Sometimes a test will ask for the opposite condition, which is called the complement. If 47 out of the 100 numbers are divisible by 3 or 5, the rest are not.
You simply subtract the 47 favourable outcomes from the 100 total outcomes: 100 − 47 = 53.
The probability of picking a number divisible by neither 3 nor 5 is 53/100, or 0.53. This complementary counting method saves time when the direct calculation involves overlapping sets.
A framework for any "divisible by A or B" problem
You can use this exact floor-division method for any range and any two numbers. If an exam asks for the probability of a number from 1 to 500 being divisible by 2 or 7, follow this four-step checklist:
Find total multiples of the first number: Divide the maximum range by the first number. For 1 to 500 and the number 2, calculate 500 ÷ 2 = 250.
Find total multiples of the second number: Divide the maximum range by the second number. For 7, calculate 500 ÷ 7 = 71.42, so there are 71 multiples.
Find the overlap using the LCM: The lowest common multiple of 2 and 7 is 14. Divide 500 ÷ 14 = 35.71, giving 35 overlapping multiples.
Apply the inclusion-exclusion formula: Add the first two counts and subtract the overlap. 250 + 71 − 35 = 286.
The probability for this new example is therefore 286/500, or 0.572. By systematically isolating the overlap, you prevent common double-counting errors and can handle much larger numerical ranges with complete confidence.
When you practise probability numericals, the Fermi Problem Library offers worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, helping you structure these steps and spot missing constraints.
If you are exploring related counting concepts, read more on:



