2

I want to check how many combinations of $2$ numbers I can generate from $20$ different numbers when the same number can be picked twice. I calculated it like this and answer is $20 \cdot 20 =400$. Is it correct? I used to do this when I was studying statistics, but I don't remember what this technique is called and what formula is used to calculate it. Surely, it's not Permutations or Combinations. $$ 1,2,3, \ldots, 20\\ (1,1), (1,2), (1,3), \ldots, (1,20)\\ \vdots\\ (20,1), (20,2), (20,3), \ldots (20, 20) $$

N. F. Taussig
  • 76,571
  • 1
    Yes, that is correct, it is $20×20= 400$. Wikipedia calls this the Rule of Product or “counting principle>". – MJD Jul 30 '15 at 13:22
  • This is fundamental principle of counting. If you have $r$ things to do, first thing can be done in $p_1$ way, second in $p_2$ ways,....$r^{th}$ thing in $p_r$ ways... then you can do your job in $ p_1 X p_2 .... X p_r$ ways. Your answer is correct. – Ashutosh Gupta Jul 30 '15 at 13:24
  • If you aren't sure exactly how the rule of product works, I attempted to explain a little intuition for it in an answer for another question. – anak Jul 30 '15 at 13:28

2 Answers2

3

Yes, the correct answer is 400. Here is one way to view the problem which may help demonstrate why this is the true.

Imagine a $20 \times 20$ grid where the each column is labeled from 1 to 20 and each row is (separately) labeled from 1 to 20. Picking the first number from 1-20 amounts to picking a column from the grid. Likewise, picking a second number from 1-20 (possibly the same number as the first) amounts to picking a row from the grid. Thus, each pair of numbers selected points to one and only one cell in the grid. Conversely, each cell in the grid points to one and only one pair of selected numbers (the column number and row number map to the first and second numbers selected).

Thus, since there is a one-to-one correspondence between the number of pairs of selected numbers and the number of cells in the grid, and that correspondence covers the entire grid, they must have the same size. Since there are 400 cells in the grid ($20 \times 20 = 400$), there must also be 400 ways to pick the two numbers.

rywit
  • 141
0

True, provided (a,b) is different from (b,a) that is, order matters. Otherwise, if order does not matter ie (a,b) is the same as (b,a) then from the square that you used to calculate your answer, you have to remove nearly half of it and you are left with 210 different combinations.