08-15-2023 , 03:56 PM
helping my nephew with some math contest preparation.........

how many distinct numbers can you make with Four 2's, one 3 and one 13

so the six numbers are:

2 2 2 2 3 13

it's a big pain, and easy to make a mistake when you do it by hand.. but it's possible.

but what if there were 100 2's?........ then you can't do it long-hand.

i've had a brain-wave just while typing this out...... (and i'm going back to the original question with 4 2's) ....so 3 and 13 are two of the possible numbers....... then you make all the numbers using just the 2's.... so 2, 4, 8,16,,, then append 3 to each. then append a 13 to each of the numbers made just with 2's.. then append 3 and 13 to those numbers

so that gets me to 18 numbers............. 13 and 3 = 2 numbers...all 2's = 4 numbers..... then then there are 3 sets with the 2's. so 12 numbers... 18 numbers.

BUT I FORGOT 3 x 13 ... so 19 numbers...........

is that correct? is there a formulaic way to do this? ...... 4, 1, 1 different numbers?..... 16 + 1 +2?

i notice one of the 10 core question-types of math contests is basically (to me) "counting stuff"..... say, how many 3 digit numbers have at least 1 ZERO?...... so you do a hardcore count, but easy to undercount or double-count. and often you'll know the answer is around X. but then 3 possible choices (multiple choice) are X, X+1, X+2 (suggesting it's easy to make a minor error).... any advice on these types of questions?

one technical question: is ZERO an even number?... i would say "yes" but i'm not certain of definitional answer...................... like one not being a prime number. or the sqrt of 4 being 2 and NOT -2.....

08-16-2023 , 06:57 AM
Quote:
then you make all the numbers using just the 2's.... so 2, 4, 8,16
I'm pretty sure we're just supposed to arrange the numbers, not multiply them or perform any operations. The problem would have had to specify that it wanted multiplication.

Quote:
2 2 2 2 3 13
I'll assume we aren't supposed to treat that as 7 numbers, so a 1 must always be followed by a 3.

There are 6*5 arrangements using all six numbers (6 places for the 3 and then 5 places for the 13). This might already be the answer, but I think the question also wants us to count subsets of the six numbers.
N(arrangements using 5 of the numbers) = 2*5 + 5*4
N(4) = 1 + 2*4 + 4*3
N(3) = 1 + 2*3 + 3!
N(2) = 1 + 3(2!)
N(1) = 3
Total = 104

Quote:
but what if there were 100 2's?
Each subtotal would still be easy, eg N(100)=100*99, but there would be 100 subtotals, so we'd wanna write code.

Quote:
how many 3 digit numbers have at least 1 ZERO
(10^3 possibilities) - (9^3 without a 0) - (10^2 with a leading 0)

Quote:
any advice on these types of questions?
Git gud at permutation/combination problems. It's practice, because given the time factor in a contest, you not only have to understand the stuff, you have to be fast and not prone to rushed errors.

Quote:
one technical question: is ZERO an even number?
Yes
09-20-2023 , 11:03 AM
Quote:
how many distinct numbers can you make with Four 2's, one 3 and one 13

so the six numbers are:

2 2 2 2 3 13
1 number used:
2, 3, 13 ==> 3 distinct numbers

2 numbers used:
22, 23, 32, 213, 132, 313, 133 ==> 7 distinct numbers

3 numbers used:
1. With one 2: 3! = 6 (2313, 2133, 3213, 3132, 1323, 1332)
2. With two 2: 2*3 = 6 (223, 232, 322, 2213, 2132, 1322)
3. With three 2: 1 (222)
Total of 13 distinct numbers

4 numbers used:
1. With one 2: not possible
2. With two 2: 6*2 = 12 (6 different ways to place 2 different numbers)
3. With three 2: 4*2 = 8 (two different numbers other than 2 can be placed in 4different ways)
4. With four 2: 1 (2222)
Total of 21 distinct numbers

5 numbers used:
1. With one 2: not possible
2. With two 2: not possible
3. With three 2: 10*2 = 20 (two different numbers other than 2 can be placed in 10 different ways)
4. With four 2: 5*2 = 10 (two different numbers other than 2 can be placed in 5 different ways)
Total of 30 distinct numbers

6 numbers used:
1. With one 2: not possible
2. With two 2: not possible
3. With three 2: not possible
4. With four 2: 15*2 = 30 (two different numbers other than 2 can be placed in 15 different ways)
Total of 30 distinct numbers

So a total of 30 + 30 + 21 + 13 + 7 + 3 = 104 distinct numbers, just like heehaww said.

If 13 was substituted with any single digit positive integer other than 2 or 3, the essence of the problem would not change.

Quote:
but what if there were 100 2's?........ then you can't do it long-hand.
This is the same problem but more number cruching. I might post the answer without detailed solution if I can spare some time .

Quote:
say, how many 3 digit numbers have at least 1 ZERO?
You can do it the way heehaww did. Or like this for a longer solution:

With 1 zero only:

Our number will be of either of these forms where x and y are non-zero: xy0, x0y.

x and y can get 9 different values. So 9*9 = 81 for each, 162 in total.

With 2 zeros only:

Our number must be of the form x00, again x cannot be 0.

x can get 9 different values, so 9 in total.

There are 9 + 162 = 171 different 3 digit numbers with at least one zero.

Quote:
(10^3 possibilities) - (9^3 without a 0) - (10^2 with a leading 0)