Re: Combinatoric question



In article <4463FB4E.281D@xxxxxxx>, Larry Coon <lmcoon_nospam@xxxxxxx> wrote:
Not homework or anything like that -- just curiosity.
Been too long since college math classes, and I didn't
turn up anything via Google.

What's the correct approach to problems like, "find
how many n-digit numbers have the digit d at least x
times." E.g., "find how many 10-digit numbers have
at least five sevens."

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.

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
.



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: 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)
  • Sorting alphanumeric numbers
    ... I am trying to sot several thousand items of equipment tracked by their ... - Some have leading zeros and if so, ... to left, (so two digit numbers show up before three digit numbers, etc.) And ... Prev by Date: ...
    (microsoft.public.excel.misc)