1

I'm really confused with the question below.

A phone number is a 7-digit sequence that does not start with 0.
(a) Call a phone number lucky if its digits are in non-decreasing order. For example, 1112234 is lucky, but 1112232 is not. How many lucky phone numbers are there?
(b) A phone number is very lucky if its digits are strictly increasing, such as with 1235689. How many very lucky phone numbers are there?

I have learnt that to determine if a question is asking for permutations or combinations we see if the order matters. For part a) it's talking about the order of these numbers and how many of these exist. In my head, permutations pop up and I would say the first position has 9 possibilities and so do the rest (if repeated). This is my same logic in part b). However, they are wrong and I do not understand how to proceed with this question. Please give some helpful tips when solving such problems.

N. F. Taussig
  • 79,074
ShippyDippy
  • 21
  • 1
  • 2

1 Answers1

0

You can do this with a kind of stars and bars method. Let's line up all the digits (except $0$):

$123456789$

These are like the 'stars'

Now, to represent a number like $1112234$ we can place the following $7$ bars:

$1|||2||3|4|56789$

(that is, we place a bar after the digit we're using)

Note that there will never be a bar before the $1$, so we can ignore that:

$|||2||3|4|56789$

Each different placement of the bars uniquely represents a lucky number, since you simply lists the digits by looking at the bars from left to right. For example:

$|2|3|45|6|78|9|$

would represent the 'very lucky' number $1235689$

So ... with this representation, how many lucky numbers are there?

any lucky number has $7$ bars placed among $8$ 'stars', meaning that there are $7+8=15$ 'positions' for the bars to be, and that means that there are ${15}\choose {7}$ lucky numbers

OK, but what about 'very lucky numbers'?

OK, this time we cannot have multiple bars after a digit, which actually does not make this a very good representation to think about 'very lucky numbers'. However, note that you simply have to pick $7$ different digits out of the $9$ digits available to you. Once you have those $7$ different digits, there is only one way to put them in increasing order. So, you have $9 \choose 7$ very lucky numbers

Bram28
  • 103,721
  • So the bars are representing the number of times a number is being repeated? I'm guessing for any arrangement, there would be 7 bars and 8 stars and not necessarily for a "lucky" number? – ShippyDippy Apr 14 '19 at 20:32
  • @ShippyDippy Right, $3$ bars after digit $4$ would represent $444$. But, every representation like this represents a lucky number, since you create the number looking at the position of the bars from left to right. E.g. $23|4|||5||6789|$ would correspond to $3444559$ – Bram28 Apr 14 '19 at 20:34
  • Just a small clarification. Why are we not using the bars and stars method for very lucky numbers? So it would be 2|3|4|5|6|7|8| for example which would be 14 positions? so 14C7? – ShippyDippy Apr 14 '19 at 20:45
  • For Very Lucky numbers, you only need to pick two arbitrary digits to omit, so how many ways can pick two (unequal) digits from a set of 9 digits? For Lucky numbers, the standard Stars & Bars approach to "how many ways can you put 7 identical balls into 9 numbered boxes" will get you the number you want since it's only the multi-set of 7 digits that you need -- the order is fixed to be non-decreasing. – Ned Apr 14 '19 at 21:32
  • @ShippyDippy You can't use the same stars and bars method for Very Lucky Numbers as you did for Lucky numbers, since if you have two successive positions for two bars, then that means you have two repeating digits, which is not allowed. – Bram28 Apr 14 '19 at 21:40