WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Puzzler -- PINs

Posts

Puzzler -- PINs

#1

Puzzler -- PINs

Alex Y

A bank assigns 4-digit PINs to their customers' ATM cards. They use all the digits (including leading zeros). But fearing that some customers may be superstitious, they make it a practice never to have "13" appear in the PIN. I.e., "4153" is a legitimate PIN, but "4135" is not.

How many unique PINs can they assign using with this restriction in place?

Re: Puzzler -- PINs

#2

Re: Puzzler -- PINs

Henry Higginbotham

One way to do this (in addition to a pencil and a bunch of sheets of paper), is to put all 10,000 numbers into a spreadsheet and have it search for "13" in "values." I did this and so have an answer, but I wonder if you're not looking for a more elegant way.

Re: Puzzler -- PINs

#3

More Elegance, please ;-)


Re: Puzzler -- PINs

#4

Re: Puzzler -- PINs

Ed in Leaside

There are few 'places' where 13 can appear ...

Re: Puzzler -- PINs

#5

Re: More Elegance, please ;-)

Alex Y

True confession:

I found the more elegant solution to calculate the answer in my head.

And got it wrong.

TWICE!

>(

Re: Puzzler -- PINs

#6

Re: Puzzler -- PINs

Larry Barrett

and some of the places are in the same zip code as other places.

Re: Puzzler -- PINs

#7

Re: Puzzler -- PINs

Ed in Leaside

So all the places except these places: 13xx, x13x, xx13.

Re: Puzzler -- PINs

#8

Re: Puzzler -- PINs

Larry Barrett

So you would conclude that there are 10*10 + 10*10 + 10*10 = 300 of these places, except for double counting which means subtracting ...

Re: Puzzler -- PINs

#9

Re: Puzzler -- PINs

Ed in Leaside

Do you mean this one? 1313

Re: Puzzler -- PINs

#10

Re: Puzzler -- PINs

Larry Barrett

and that is the only double count.

So the answer (my answer and Ed's, I think) is the number of unique PINs that do not include the number 13 is 10000 - (300-1). Hope this is what Henry came up with.

Re: Puzzler -- PINs

#11

Re: Puzzler -- PINs

Henry Higginbotham

Yes, same thing. Excel found 299 instances of "13," counting 1313 as only one instance. So 10,000 - 299 = 9701 assignable PINs.

I wanted to include a screen shot showing all 10,000 numbers, with the 13s highlighted, but I've just bought a new computer and don't yet have any program that can reduce the file size enough to post.

Re: Puzzler -- PINs

#12

Re: Puzzler -- PINs

Alex Y

All of you got this one right. I need to be more careful with ones like this. :-)

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.