combinatorics - Counting Integers - Mathematics Stack Exchange


determine number of valid 6-digit integers (ie. no leading zeros) no digits can repeated , such divisible 4

my answer (correct):

fact: integer divisible 4 if last 2 digits divisible 4 (eg. 416, 756)

there are

  • $8\times7\times6\times5\times6$ valid 6-digit integers end in $04, 08, 20, 40, 60, 80$
    (ie. divisible 4, contains 1 0 , no digit repeated)

  • $7\times7\times6\times5\times16$ valid 6-digit integers end in
    $12, 16, 24, 28, 32, 36, 48, 52, 56, 64, 68, 72, 76, 84, 92, 96$
    (ie. divisible 4, not contain zeros , no digit repeated)

$\therefore$ there $(8\times7\times6\times5\times6) + (7\times7\times6\times5\times16)$ valid 6-digit integers no digits can repeated , such divisible 4

my question:

is there better (as in less error-prone) way solve original problem hand?
(enumerating two-digit numbers divisible 4 , adding amount of such integers correctly bit problematic me)

is there better (as in less error-prone) way solve original problem?

this might not answer you'd want hear, yes. it's counting. , computers really, @ this. mathematician in modern world think it's important learn @ least basics of programming, numerical exploration can form quick hypotheses , intuitions, , use speed finding references, proofs, or coming own.

so in example, generate every valid 6-digit integer such divisible 4 , has no repeated digits. display how many such integers generated. example in python:

no_repeated_digits = lambda n: len(str(n)) == len(set(str(n))) numbers = [n n in range(100000, 999999) if n % 4 == 0 , no_repeated_digits(n)] print(len(numbers)) 

which instantly gives our result 33600.


Comments

Popular posts from this blog

analysis of two transistors ib,ic,ie? - Electrical Engineering Stack Exchange

Choosing and replace capacitors for audio amplifier - Electrical Engineering Stack Exchange

sql server 2008 r2 - LogWriter: Operating system error 1117 - Database Administrators Stack Exchange