| |
 |
|
|
Science Forum Index » Statistics - Math Forum » Some help with a ballast math question?...
Page 1 of 1
|
| Author |
Message |
| Horseman... |
Posted: Mon Jun 23, 2008 3:32 pm |
|
|
|
Guest
|
I could use some help devising a formula for the following problem:
A ship has 7 ballast tanks. Each tank can hold up to 20 units of
water. The ship can only handle at most 100 units of water in the
tanks at once. The ship does not need to carry 100 units of water as
ballast, and a tank can be full, empty, or partially filled. The ship
needs a minimum of 20 units of water to keep itself stable.
~~
This is not a school question, but a logic/statistics type question I
devised of myself to help me learn more about math.
I realize that there is usage of pascals triangle on the formula, but
is there a way to write out a formula to work this problem? Or failing
that is there a way to devise the answer with a series of formulas for
individual aspects? Well I know the answer to the second is true.. but
the way I have seems rather time consuming.
I am trying to find out how many possible different loads of units of
water there are, and how this can be calculated. |
|
|
| Back to top |
|
| Phil Holman... |
Posted: Tue Jun 24, 2008 9:13 pm |
|
|
|
Guest
|
"Horseman" <michaelhh at (no spam) gmail.com> wrote in message
news:bd739d85-84d2-4b92-a804-527868ce7c71 at (no spam) m45g2000hsb.googlegroups.com...
Quote: I could use some help devising a formula for the following problem:
A ship has 7 ballast tanks. Each tank can hold up to 20 units of
water. The ship can only handle at most 100 units of water in the
tanks at once. The ship does not need to carry 100 units of water as
ballast, and a tank can be full, empty, or partially filled. The ship
needs a minimum of 20 units of water to keep itself stable.
~~
This is not a school question, but a logic/statistics type question I
devised of myself to help me learn more about math.
I realize that there is usage of pascals triangle on the formula, but
is there a way to write out a formula to work this problem? Or failing
that is there a way to devise the answer with a series of formulas for
individual aspects? Well I know the answer to the second is true.. but
the way I have seems rather time consuming.
I am trying to find out how many possible different loads of units of
water there are, and how this can be calculated.
You need to limit one of the variables to discrete values....partially
filled or total ballast between 20 or 100 units. Otherwise the
combinations are
infinite.
I suggest partially filled should be replaced with 1/2 filled.
Now we have a finite number of combinations of 0, 10 and 20 units that
can sum to a range from 20 to 100 units in 10 unit increments.
Starting at 20, there are only 2 ways to get 20 ( 2*10 and 1*20). But
with 7 tanks, there are 7 different combinations of one tank with 20,
and 21 different combinations of 2*10 making at total of 28.
The formula applied here is the number of combinations nCr =
n!/[r!*(n-r)!]
For 30, there are 3 ways to get 30 (3*10, 1*20+2*10 and 1*30).
for 3*10 the number of combinations is 7!/(3!*4!) = 35
etc etc
The problem is a little bit tedious.
Phil H |
|
|
| Back to top |
|
| Horseman... |
Posted: Wed Jun 25, 2008 12:40 am |
|
|
|
Guest
|
Well the answer lies inside 20 per 5 all combinations, then
20,20,20,20,19,1 in all tank combinations, 20,20,20,20,18,2 and
20,20,20,20,18,1,1 and so forth. It can be worked out. There is most
assuredly a finite number to this, and I suspect it's less than a
billion total outcomes, therefore it is eminently solvable. Do not
assume units can be decimalled out, they are full units of 1. Just as
ships in real life wont worry about a drop, or a pound of water in a
ballast tank for being to small to worry about measuring for purposes
of staying afloat, we need not count the individual water atoms in an
unknown sized ship :P
Instead we can merely worry about a vague measure called a unit which
is always a whole number  |
|
|
| Back to top |
|
| Horseman... |
Posted: Wed Jun 25, 2008 11:20 am |
|
|
|
Guest
|
On Jun 25, 11:49 am, Scott Hemphill <hemph... at (no spam) hemphills.net> wrote:
Quote: Horseman <michae... at (no spam) gmail.com> writes:
Well the answer lies inside 20 per 5 all combinations, then
20,20,20,20,19,1 in all tank combinations, 20,20,20,20,18,2 and
20,20,20,20,18,1,1 and so forth. It can be worked out. There is most
assuredly a finite number to this, and I suspect it's less than a
billion total outcomes, therefore it is eminently solvable. Do not
assume units can be decimalled out, they are full units of 1. Just as
ships in real life wont worry about a drop, or a pound of water in a
ballast tank for being to small to worry about measuring for purposes
of staying afloat, we need not count the individual water atoms in an
unknown sized ship :P
Instead we can merely worry about a vague measure called a unit which
is always a whole number :P
Phil has already shown you how to solve this problem. It's just that
he started doing it with increments of 10 units. You just have to do
the same thing with increments of 1 unit.
To recap:
You have seven variables which can take on the integer values between
0 and 20 inclusive. You ask how many combinations there are, such
that the sum of the seven variables is between 20 and 100, inclusive.
Let c(k) be the number of combinations of the seven variables whose
sum is k. So the answer to your problem is:
Sum[c(k), 20 <= k <= 100]
Sums of combinations generally have simple forms when you count all
the cases. For example,
Sum[c(k), 0 <= k <= 140] is 21^7 = 1801088541
because each of the seven variables has 21 possible values. This
number is larger than the answer to your problem because it counts the
cases where k < 20 or k > 100. Still, most of these combinations have
20 <= k <= 100, so this is the first hint that your suspicion that the
number of combinations is less than a billion is incorrect. (I'm
using the U.S. definition of 1 billion = 10^9 = 1000000000. I note
that you are posting from the state of Oregon.)
Rather than count the cases 20 <= k <= 100, it is easier to start with
all the cases 0 <= k <= 140 and subtract the cases 0 <= k < 20 and 100
k <= 140.
First, lets subtract the cases where 0 <= k < 20:
Sum[c(k), 20 <= k <= 140] = 1801088541 - Sum[c(k), 0 <= k < 20]
Let's look at c(k) for small values of k:
c(0) = 1
c(1) = 7
c(2) = 28
For c(2), there are 7 ways of choosing the same variable, and 21 ways
of choosing two different variables (7*6, divided by two because
you've counted them twice).
c(3) = 84
Compare with Pascal's triangle. Do you see the pattern that's
developing? These numbers are coming from a diagonal row. As long as
k <= 20, c(k) = ch(k+6,6). (Here ch(n,m) = n!/((n-m)!m!) is the
binomial coefficient which is the number of combinations of "n"
objects, taken "m" at a time. I chose "ch" as an abbreviation for
"choose".)
It turns out that there is a simple formula for summing terms like
ch(k+6,6):
Sum[ch(k+6,6), 0 <= k <= t] = ch(t+7,7)
So our first calculation is:
Sum[c(k), 20 <= k <= 140] = 1801088541 - Sum[c(k), 0 <= k < 20]
= 1801088541 - Sum[ch(k+6,6), 0 <= k <= 19]
= 1801088541 - ch(26,7)
= 1800430741
Now lets subtract the cases where 100 < k <= 140:
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 100 < k <= 140]
First, notice that c(k) is symmetric:
c(0) = c(140) = 1
because there is only one way to have all the variables be zero and
there is only one way to have all the variables be twenty.
c(1) = c(139) = 7
because there are seven ways to choose a variable to be one (with the
rest being zero) and there are seven ways to choose a variable to be
nineteen (with the rest being twenty). Similarly, c(2) = c(138), c(3)
= c(137), etc. So instead of calculating Sum[c(k), 100 < k <= 140],
we can calculate Sum[c(k), 0 <= k < 40].
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 100 < k <= 140]
= 1800430741 - Sum[c(k), 0 <= k < 40]
This is nice because we already have a formula c(k) as long as k <> 20. We are limited to k <= 20 because when we developed this formula,
we didn't limit individual variables to 20. As long as k <= 20, we
are safe because if the sum of the variables is no more than 20, each
of the variables is no more than 20. When k = 21, the formula c(k) > ch(k+6,6) no longer holds. because ch(k+6,6) includes the seven extra
combinations: (21,0,0,0,0,0,0), (0,21,0,0,0,0,0), etc.
So c(21) = ch(27,6) - 7.
All the values of c(k) for 21 <= k < 42 can be developed by letting
c(k) = ch(k+6,6) - d(k)
where d(k) is the number of illegal combinations, i.e. the number of
combinations which sum to k, but have a variable which is more than
20. In fact, for k < 42, one and only one of the variables will have
the value 21 or more. You can therefore count these illegal
combinations by looking at all the legal combinations which sum to
(k-21). For each one of these, you can create seven different unique
combinations which sum to k by adding 21, in turn, to each of the
seven variables.
So d(k) = 7 * c(k-21) for 21 <= k < 42
We can now write:
Sum[c(k), 0 <= k < 40] = Sum[ch(k+6,6), 0 <= k < 40] -
Sum[d(k), 21 <= k < 40]
= Sum[ch(k+6,6), 0 <= k < 40] -
7*Sum[c(k), 0 <= k < 19]
= Sum[ch(k+6,6), 0 <= k < 40] -
7*Sum[ch(k+6,6), 0 <= k < 19]
= ch(46,7) - 7*ch(25,7)
= 50159780
The answer to your problem is:
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 0 <= k < 40]
= 1800430741 - 50159780
= 1750270961
To summarize the arithmetic which produced this number:
21^7 - ch(26,7) - ch(46,7) + 7*ch(25,7) = 1750270961
Scott
--
Scott Hemphill hemph... at (no spam) alumni.caltech.edu
"This isn't flying. This is falling, with style." -- Buzz Lightyear
Well my thanks, I will have to wake up before I can comprehend much
more than 1+2=3 but ummm, looks good at the moment. And I guess I was
wrong about the billion, but correct in that it was not going to be
tremendous in length (in terms of math I have accidently done in the
past ;P) |
|
|
| Back to top |
|
| Scott Hemphill... |
Posted: Wed Jun 25, 2008 1:49 pm |
|
|
|
Guest
|
Horseman <michaelhh at (no spam) gmail.com> writes:
Quote: Well the answer lies inside 20 per 5 all combinations, then
20,20,20,20,19,1 in all tank combinations, 20,20,20,20,18,2 and
20,20,20,20,18,1,1 and so forth. It can be worked out. There is most
assuredly a finite number to this, and I suspect it's less than a
billion total outcomes, therefore it is eminently solvable. Do not
assume units can be decimalled out, they are full units of 1. Just as
ships in real life wont worry about a drop, or a pound of water in a
ballast tank for being to small to worry about measuring for purposes
of staying afloat, we need not count the individual water atoms in an
unknown sized ship :P
Instead we can merely worry about a vague measure called a unit which
is always a whole number
Phil has already shown you how to solve this problem. It's just that
he started doing it with increments of 10 units. You just have to do
the same thing with increments of 1 unit.
To recap:
You have seven variables which can take on the integer values between
0 and 20 inclusive. You ask how many combinations there are, such
that the sum of the seven variables is between 20 and 100, inclusive.
Let c(k) be the number of combinations of the seven variables whose
sum is k. So the answer to your problem is:
Sum[c(k), 20 <= k <= 100]
Sums of combinations generally have simple forms when you count all
the cases. For example,
Sum[c(k), 0 <= k <= 140] is 21^7 = 1801088541
because each of the seven variables has 21 possible values. This
number is larger than the answer to your problem because it counts the
cases where k < 20 or k > 100. Still, most of these combinations have
20 <= k <= 100, so this is the first hint that your suspicion that the
number of combinations is less than a billion is incorrect. (I'm
using the U.S. definition of 1 billion = 10^9 = 1000000000. I note
that you are posting from the state of Oregon.)
Rather than count the cases 20 <= k <= 100, it is easier to start with
all the cases 0 <= k <= 140 and subtract the cases 0 <= k < 20 and 100
< k <= 140.
First, lets subtract the cases where 0 <= k < 20:
Sum[c(k), 20 <= k <= 140] = 1801088541 - Sum[c(k), 0 <= k < 20]
Let's look at c(k) for small values of k:
c(0) = 1
c(1) = 7
c(2) = 28
For c(2), there are 7 ways of choosing the same variable, and 21 ways
of choosing two different variables (7*6, divided by two because
you've counted them twice).
c(3) = 84
Compare with Pascal's triangle. Do you see the pattern that's
developing? These numbers are coming from a diagonal row. As long as
k <= 20, c(k) = ch(k+6,6). (Here ch(n,m) = n!/((n-m)!m!) is the
binomial coefficient which is the number of combinations of "n"
objects, taken "m" at a time. I chose "ch" as an abbreviation for
"choose".)
It turns out that there is a simple formula for summing terms like
ch(k+6,6):
Sum[ch(k+6,6), 0 <= k <= t] = ch(t+7,7)
So our first calculation is:
Sum[c(k), 20 <= k <= 140] = 1801088541 - Sum[c(k), 0 <= k < 20]
= 1801088541 - Sum[ch(k+6,6), 0 <= k <= 19]
= 1801088541 - ch(26,7)
= 1800430741
Now lets subtract the cases where 100 < k <= 140:
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 100 < k <= 140]
First, notice that c(k) is symmetric:
c(0) = c(140) = 1
because there is only one way to have all the variables be zero and
there is only one way to have all the variables be twenty.
c(1) = c(139) = 7
because there are seven ways to choose a variable to be one (with the
rest being zero) and there are seven ways to choose a variable to be
nineteen (with the rest being twenty). Similarly, c(2) = c(138), c(3)
= c(137), etc. So instead of calculating Sum[c(k), 100 < k <= 140],
we can calculate Sum[c(k), 0 <= k < 40].
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 100 < k <= 140]
= 1800430741 - Sum[c(k), 0 <= k < 40]
This is nice because we already have a formula c(k) as long as k <=
20. We are limited to k <= 20 because when we developed this formula,
we didn't limit individual variables to 20. As long as k <= 20, we
are safe because if the sum of the variables is no more than 20, each
of the variables is no more than 20. When k = 21, the formula c(k) =
ch(k+6,6) no longer holds. because ch(k+6,6) includes the seven extra
combinations: (21,0,0,0,0,0,0), (0,21,0,0,0,0,0), etc.
So c(21) = ch(27,6) - 7.
All the values of c(k) for 21 <= k < 42 can be developed by letting
c(k) = ch(k+6,6) - d(k)
where d(k) is the number of illegal combinations, i.e. the number of
combinations which sum to k, but have a variable which is more than
20. In fact, for k < 42, one and only one of the variables will have
the value 21 or more. You can therefore count these illegal
combinations by looking at all the legal combinations which sum to
(k-21). For each one of these, you can create seven different unique
combinations which sum to k by adding 21, in turn, to each of the
seven variables.
So d(k) = 7 * c(k-21) for 21 <= k < 42
We can now write:
Sum[c(k), 0 <= k < 40] = Sum[ch(k+6,6), 0 <= k < 40] -
Sum[d(k), 21 <= k < 40]
= Sum[ch(k+6,6), 0 <= k < 40] -
7*Sum[c(k), 0 <= k < 19]
= Sum[ch(k+6,6), 0 <= k < 40] -
7*Sum[ch(k+6,6), 0 <= k < 19]
= ch(46,7) - 7*ch(25,7)
= 50159780
The answer to your problem is:
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 0 <= k < 40]
= 1800430741 - 50159780
= 1750270961
To summarize the arithmetic which produced this number:
21^7 - ch(26,7) - ch(46,7) + 7*ch(25,7) = 1750270961
Scott
--
Scott Hemphill hemphill at (no spam) alumni.caltech.edu
"This isn't flying. This is falling, with style." -- Buzz Lightyear |
|
|
| Back to top |
|
| Allen McIntosh... |
Posted: Wed Jun 25, 2008 10:16 pm |
|
|
|
Guest
|
Scott Hemphill wrote:
Quote: The answer to your problem is:
21^7 - ch(26,7) - ch(46,7) + 7*ch(25,7) = 1750270961
Here is a somewhat less elegant solution to the problem. More details
of the underlying math can be found in Fryer & Berman, Introduction to
Combinatorics, Academic Press 1972, especially chapter 4. AFAIK it's
out of print, but maybe it's available on the web somewhere.
1) The number of positive integral solutions to
x1 + x2 + ... + xr = m
is
ch(m-1,r-1)
To see this, think of m objects in a row. Partition them into
r groups by choosing r-1 of the m-1 gaps between them
2) The number of non-negative integral solutions to
x1 + x2 + ... + xr = m
is
ch(m+r-1, r-1)
To see this, let yi - 1 = xi and apply (1)
3) If A and B are subsets of some universe U, with A' and B' being the
appropriate compliments, then
A'B' = U - A - B + AB
and if n(S) is the size of the set S
n(A'B') = n(U) - n(A) - n(B) + n(AB)
To see this, note that U-A-B subtracts the elements of AB twice.
More generally if Ai i=1...r are subsets of some universe U,
n(A1'A2'...Ar') = n(U) - sum(n(Ai)) + sum(n(AiAj)) ...
+ (-1)^r * n(A1A2...Ar)
4) The number of non-negative integral solutions to
x1 + x2 + ... + xr = m
where
xi <= bi
is
n(U) - sum(n(Ai)) + sum(n(AiAj)) - ... + (-1)^r * n(A1A2...Ar)
where
Ai is the set of non-negative integral solutions to
x1 + x2 + ... + xr = m, xi > bi
To see this, the solutions we want are those in A1' and A2' and A3' and
.... Ar', i.e. those in the set A1'A2'...Ar' Apply (3) to find
n(A1'A2'...Ar')
The original problem is the same as the number of non-negative integral
solutions to
x1+x2+...+x8 = 100
where
xi <= 20 i=1...7
x8 <= 80
(Adding x8 is a standard trick to turn the inequality into an equality.)
Application of (2) and (4) leads to
ch(107,7) - [7*ch(86,7)+ch(26,7)] + 21*ch(65,7) -
35*ch(44,7) + 35*ch(23,7)
= 1750270961
To see where ch(86,7) comes from, consider the case where
x1 is overbudget, i.e. x1>20 which is the same as x1>=21 since x1 is an
integer.
Put y1=x1-21 (so that y1 >=0) and yi=xi for i=2...8.
Applying (2) with m=100-21 gives n(A1)= ch(86,7). There are 7 ways for
this to happen. ch(26,7) corresponds to the case where x8 is
overbudget. ch(65,7) corresponds to the case where two of x1...x7 are
overbudget, which can happen ch(7,2) ways, and so on. (If x8 is
overbudget, no other xi can be overbudget at the same time.) |
|
|
| Back to top |
|
| Scott Hemphill... |
Posted: Thu Jun 26, 2008 4:22 pm |
|
|
|
Guest
|
Allen McIntosh <nospam at (no spam) mouse-potato.com> writes:
Quote: Scott Hemphill wrote:
The answer to your problem is:
21^7 - ch(26,7) - ch(46,7) + 7*ch(25,7) = 1750270961
Here is a somewhat less elegant solution to the problem. More details
of the underlying math can be found in Fryer & Berman, Introduction to
Combinatorics, Academic Press 1972, especially chapter 4. AFAIK it's
out of print, but maybe it's available on the web somewhere.
[elegant solution snipped]
There is some commonality in our methods, but my solution was ad hoc,
geared to the specific problem, and I tried to use a minimum of
mathematical verbiage to communicate with the OP. Yours is much
more general, and I consider that more elegant. In fact, it inspired
this Mathematica snippet:
(* define extraneous binomial terms to be zero *)
In[1]:= ch[m_,n_] := 0 /; (n < 0 || n > m);
(*
calculate the number of combinations of tank ballast, given:
b: a list of tank sizes,
min: the minimum total ballast permitted,
max: the maximum total ballast permiited.
*)
In[2]:= ballast[b_, min_, max_] := Block[{ans,n,x},
x = Append[b,max-min];
n = Length[x];
ans[m_,n_,{}] := ch[m,n];
ans[m_,n_,x_] := ans[m,n,Rest[x]] - ans[m-x[[1]]-1,n,Rest[x]];
ans[max+n-1,n-1,x]
];
(* calculate solution to OP's problem *)
In[3]:= ballast[Table[20,{7}],20,100]
Out[3]= 35 ch[23, 7] - ch[26, 7] - 35 ch[44, 7] + 21 ch[65, 7] -
Quote: 7 ch[86, 7] + ch[107, 7]
(* evaluate solution numerically *)
In[4]:= % /. ch->Binomial
Out[4]= 1750270961
Scott
--
Scott Hemphill hemphill at (no spam) alumni.caltech.edu
"This isn't flying. This is falling, with style." -- Buzz Lightyear |
|
|
| Back to top |
|
| Horseman... |
Posted: Fri Jun 27, 2008 2:59 pm |
|
|
|
Guest
|
I am going to admit I am a bit lost... What is c representing here?
Quote: Let c(k) be the number of combinations of the seven variables whose
sum is k. So the answer to your problem is:
Sum[c(k), 20 <= k <= 100]
So that when I do this math in excel, how do I represent Sum[ch(k
+6,6), 0 <= k < 40] - Sum[d(k), 21 <= k < 40] ??
Sums are easy enough, and k is easy enough, but ch? Less than equals
to is easy also... just representing c and ch is making me scratch my
head (admittedly poor sleep last few days, hence my lack of replies)
Quote: We can now write:
Sum[c(k), 0 <= k < 40] = Sum[ch(k+6,6), 0 <= k < 40] -
Sum[d(k), 21 <= k < 40]
= Sum[ch(k+6,6), 0 <= k < 40] -
7*Sum[c(k), 0 <= k < 19]
= Sum[ch(k+6,6), 0 <= k < 40] -
7*Sum[ch(k+6,6), 0 <= k < 19]
= ch(46,7) - 7*ch(25,7)
= 50159780
The answer to your problem is:
Sum[c(k), 20 <= k <= 100] = 1800430741 - Sum[c(k), 0 <= k < 40]
= 1800430741 - 50159780
= 1750270961
This formula does look promising, but I admit that it's a bit past my
skills. I have yet to use (#,#) expressions and I do not know how to
use these properly. Could you assist in my understanding?
Quote: To summarize the arithmetic which produced this number:
21^7 - ch(26,7) - ch(46,7) + 7*ch(25,7) = 1750270961
Sorry if I seem ignorant.. I grew up in a poor area and have no formal
math education, so sometimes there is a glaring difference between
what I know and what I would like to know, as well as a difference
between what I can work out and write versus how others work out and
write math  |
|
|
| Back to top |
|
| Scott Hemphill... |
Posted: Mon Jun 30, 2008 3:13 pm |
|
|
|
Guest
|
Horseman <michaelhh at (no spam) gmail.com> writes:
Quote: I am going to admit I am a bit lost... What is c representing here?
Let c(k) be the number of combinations of the seven variables whose
sum is k. Â So the answer to your problem is:
 Sum[c(k), 20 <= k <= 100]
"c(k)" is the number of ways to fill the seven tanks so that the total
ballast is "k" units. When we write this, it doesn't mean that we
have already figured out how to calculate it.
For example, c(0) is 1, because there is only one way to have 0 units
of water, and that is to have all the tanks empty. c(1) is 7, because
there are seven ways to have a total of 1 unit: you could have 1 unit
in the first tank, or 1 unit in the second tank, etc. You are only
interested in the cases where the total is at least 20 units, but not
more than 100. There are c(20) ways to have 20 units total in the
seven tanks (if only you could figure out what c(20) is) and there are
c(21) ways to have 21 units total, etc. So what you want is the total
number of ways you can have at least 20 units and at most 100 units,
which is c(20)+c(21)+c(22)+...+c(100). This is what I mean by
"Sum[c(k), 20 <= k <= 100]".
Quote: So that when I do this math in excel, how do I represent Sum[ch(k
+6,6), 0 <= k < 40] - Sum[d(k), 21 <= k < 40] ??
Sums are easy enough, and k is easy enough, but ch? Less than equals
to is easy also... just representing c and ch is making me scratch my
head (admittedly poor sleep last few days, hence my lack of replies)
We can now write:
 Sum[c(k), 0 <= k < 40]  =  Sum[ch(k+6,6), 0 <= k < 40] -
               Sum[d(k), 21 <= k < 40]
             =  Sum[ch(k+6,6), 0 <= k < 40] -
               7*Sum[c(k), 0 <= k < 19]
             =  Sum[ch(k+6,6), 0 <= k < 40] -
               7*Sum[ch(k+6,6), 0 <= k < 19]
             =  ch(46,7) - 7*ch(25,7)
             =  50159780
The answer to your problem is:
Sum[c(k), 20 <= k <= 100] Â = Â 1800430741 - Sum[c(k), 0 <= k < 40]
              =  1800430741 - 50159780
              =  1750270961
When you are responding to something I've written, please put what you
write *below* what you are repsonding to. Otherwise I have to read up
the page to figure out what you mean. Also, it would help if you
would ask questions about the first thing you don't understand, so I
don't have to repeat myself. By the time you've reached the above
text, I had already explained what ch(#,#) is and what d(#) was. I
guess you didn't understand me then, but you've clipped out that
explanation.
Quote: This formula does look promising, but I admit that it's a bit past my
skills. I have yet to use (#,#) expressions and I do not know how to
use these properly. Could you assist in my understanding?
To summarize the arithmetic which produced this number:
 21^7 - ch(26,7) - ch(46,7) + 7*ch(25,7)  =  1750270961
"(#,#)" is not an expression by itself. The expression is "ch(#,#)",
which just indicates that "ch" is a function which takes two numbers
and produces a result. This isn't really very mysterious, since
addition, subtraction, multiplication and division also take two
numbers and produce a result. In this case, "ch(n,m)" is defined as
the number of combinations of "n" objects, taken "m" at a time.
Another way of defining "ch(n,m)" is the number in Pascal's triangle
in row "m" at column "n". (Rows and columns are numbered starting
with zero.)
Pascal's Triangle:
row 0: 1
row 1: 1 1
row 2: 1 2 1
row 3: 1 3 3 1
row 4: 1 4 6 4 1
So ch(4,2) is the number in row 4 at column 2, which is 6. (Remember
that the first column is column 0.)
To show that this is is the same as the number of combinations of 4
elements taken 2 at a time:
Four elements: A B C D
Ways to take two of them:
AB AC AD BC BD CD
Total number of ways = 6.
There is a formula for calculating ch(n,m). It is:
n!
ch(n,m) = -----------
(n-m)! * m!
I am using "*" to mean multiplication, the horizontal bar to mean
division, and "!" to mean factorial. Perhaps you're not familiar with
factorial notation? It is a shorthand for multplying a bunch of
numbers together. For example, 4! = 4*3*2*1 = 24. 5! = 5*4*3*2*1 =
120. 0! is defined to be 1. Using this shorthand,
4! 24 24
ch(4,2) = ------- = ----- = ---- = 6
2! * 2! 2 * 2 4
I don't use Excel very much, but I can Google for ways to calculate
things. For example, factorial is already built into Excel. If you
enter =FACT(4) into a cell, it will give you 24. Even better than
that, the number of combinations of "n" objects taken "m" at a time is
already built into Excel. If you enter =COMBIN(4,2) into a cell, you
will get 6. So "COMBIN" is the Excel way of calculating the function
I call "ch".
I know I haven't explained everything yet, but take a look at my
original post and see if it makes any more sense. If something
doesn't make sense, or you're not sure about it, feel free to ask
again.
Quote: Sorry if I seem ignorant.. I grew up in a poor area and have no formal
math education, so sometimes there is a glaring difference between
what I know and what I would like to know, as well as a difference
between what I can work out and write versus how others work out and
write math
Everybody's ignorant. It's just a question of degree.
Scott
--
Scott Hemphill hemphill at (no spam) alumni.caltech.edu
"This isn't flying. This is falling, with style." -- Buzz Lightyear |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Fri Dec 05, 2008 9:56 am
|
|