Re: Combinatoric question



Robert Israel wrote:

The number of n-digit numbers (with leading zeros allowed)
having the digit d exactly x times may be obtained as
follows. Think of how you might select such a number.
1) choose x places out of n to put the digit d
2) fill the other n-x places with the other 9 digits.
So the number of ways to do this is (n choose x) 9^(n-x).

The number of n-digit numbers (with leading zeros allowed)
having the digit d at least x times is thus
sum_{y=x}^n (n choose y) 9^(n-y)

This can be written using a hypergeometric function, but
it's easier to just do the sum.

As was mentioned, if you don't allow leading zeros (and d
is not 0), just subtract the value for n-1 from the value
for n.

Thanks! (And thanks to the others who answered). Makes
perfect sense now that I've had a chance to read someone
else's explanation.

And to clarify, I was interested in ten-digit strings of
digits, and not really numbers less than 10 billion (so
leading zeros are included).
.



Relevant Pages

  • Re: New lexical function F$DELTA_TIME
    ... carl@gerg.tamu.edu writes... ... }You can add one more digit before it gives an IVDTIME error (I expect ... leading zeros) in the delta portion don't seem to matter except ... Leading zeros in the numeric parts of an absolute time don't matter either: ...
    (comp.os.vms)
  • Re: How do I stop Excel from dropping leading zeros?
    ... Data to import into Excel. ... valid leading zeros and the values are not fixed width. ... Is there a way to disable auto format? ... I also need to drop the last digit (the check ...
    (microsoft.public.excel.misc)
  • Re: 0,...1 and 9...
    ... Oh let me give you and advice skip the zeros and points they make no ... It makes perfect sense. ... It means that each digit following the decimal point ...
    (sci.math)
  • Re: How to suppress leading zeros in Excel
    ... >I recieve a spreadsheet that has phone stored as a 10 digit number. ... > to parse it to end up with 3 columns; AreaCode, Exchange, Extension. ... For example if an extension is 0040 the leading zeros are ...
    (microsoft.public.excel.misc)
  • Re: How to suppress leading zeros in Excel
    ... > I recieve a spreadsheet that has phone stored as a 10 digit number. ... > to parse it to end up with 3 columns; AreaCode, Exchange, Extension. ... For example if an extension is 0040 the leading zeros are ...
    (microsoft.public.excel.misc)