SOLUTION: How many different 5-digit PINs contain the sequence 12 (order matters)
12000 counts
12121 counts
13332 doesn't count
Algebra ->
Permutations
-> SOLUTION: How many different 5-digit PINs contain the sequence 12 (order matters)
12000 counts
12121 counts
13332 doesn't count
Log On
Question 1105054: How many different 5-digit PINs contain the sequence 12 (order matters)
12000 counts
12121 counts
13332 doesn't count Answer by math_helper(2461) (Show Source):
You can put this solution on YOUR website! There are 4 patterns to worry about:
12xxx —>
x12xx —>
xx12x —> <<< minus 10 for the 1212x pattern already counted
xxx12 —> <<< minus 20 for 12x12, x1212, both already counted
——
That's = 3970
——
Check using a Perl one-liner:
perl -e 'for ($i=0, $s=0; $i<100000; $i++) { if ($i =~ /12/) { $s++; } }; print "$s\n";'
3970