A bank teller wants to open a safe at the bank. However, she forget the pin number. She does not want to ask anyone because she doesnt want anyone to think that she is incompetent. She remembers that the pin number consists of a 5 digit number and was formed from the digits 1,2,3,4, and 5. She also remembers that no digit appears more than once and that 1 and 5 cannot be adjacent. How many such numbers are possible?
The way I looked at it is this:
the no. of arrangements of numbers 1- 5 in which 1 and 5 are not adjacent= Total no. of arrangements of the 5 nos. - the no. of arrangements in which 1 & 5 are adjacent.
Now, Total no. of arrangements of the 5 nos.= 5!
and the no. of arrangements in which 1 & 5 are adjacent. = 4!*2 (because- consider 1 & 5 as one no., always together, then we would have 4 nos. to arrange, so 4!. But also in considering 1 & 5 as one number we still have two possibilites of arranging 1 & 5 ie. 15 or 51, hence the multiplication by 2).
Hope it helps.