Then the total number of different ways the task canoccur is: n1.n2.n3.n4….nk.

To understand this concept, assume that there are 4 roads from city A to city B and 3 roads from city B to city C. The total number of ways by which a person can reach from city A to city B is 4x3 = 12.
Let us look at a simple illustration.
Illustration: A dhaba has a lunch special which consists of a sandwich, soup, dessert and drink for Rs 99. They offer the following choices:
Sandwich: chicken salad, ham, and tuna, and roast beef
Soup: tomato, chicken noodle, vegetable
Dessert: cookie and pie
Drink: tea, coffee, coke, diet coke and sprite
How many lunch specials are there?
Let’s use the basic counting principle:
There are 4 stages or events: choosing a sandwich, choosing a soup, choosing a dessert and choosing a drink. There are 4 choices for the sandwich, 3 choices for the soup, 2 choices for the dessert and 5 choices for the drink. Putting that all together we get, 4x3x2x5 = 120. So there are 120 lunch specials possible.
Now, Let us look at another more complicated illustration.
Illustration: A company places a 6-symbol code on each unit of product. The code consists of 4 digits, the first of which is the number 5, followed by 2 letters, the first of which is NOT a vowel. How many different codes are possible?
Let’s use the basic counting principle: There are 6 stages or events: digit 1, digit 2, digit 3, digit 4, letter 1, and letter 2. In general there are 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The first digit is limited to being the number 5, so there is only one possibility for that one. There is no restriction on digits 2 - 4, so each one of those has 10 possibilities.
In general, there are 26 letters in the alphabet. The first letter, cannot be a vowel (a, e, i, o, u), so that means there are 21 possible letters that could go there. The second letter has no restriction, so there are 26 possibilities for that one.
Putting that all together we get: 1x10x10x10x21x26 = 546000.