English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

For example, if a=7 and b=12, then the equation I want will give me the product of 7*8*9*10*11*12.

2006-08-01 13:52:29 · 6 answers · asked by Bob 3 in Science & Mathematics Mathematics

I like what I see so far, but is there away to do it for negative numbers to? As in: a=-4 and b=-2 so I get (-4)*(-3)*(-2). My calculator wouldn't let me do "-x!".

2006-08-01 15:07:34 · update #1

6 answers

b!/(a-1)!

So your example would be 12!/6!

Edit: to expand this to cases where a and b are both negative, just compute this as though a and b are both positive and then multiply by (-1)^(b-a+1). In cases where b is positive and a is negative, your answer is always zero (since zero is one of the numbers you're multiplying).

2006-08-01 13:57:21 · answer #1 · answered by Pascal 7 · 1 1

Just do it for positive numbers. Then if there are an odd number of terms, the answer will be negative.

2006-08-01 22:16:41 · answer #2 · answered by genericman1998 5 · 0 0

ishaqkhan got it right. You're limiting yourself to integers. If you wanted the numbers, including fractions, etc., you could do a "double integral" on the product xy, each going from a to b.

2006-08-01 21:52:11 · answer #3 · answered by bpiguy 7 · 0 0

Assume |a| ≤ |b|
Then P = [|b|!/(|a|-1)!] * (|a|/a)^(|b|-|a|+1) if ab>0
and P=0 if ab≤0

where |x| is the absolute value of x

2006-08-01 22:47:06 · answer #4 · answered by Scott R 6 · 0 0

There is no sort cut fomula you have to multiply

2006-08-01 20:59:17 · answer #5 · answered by Mein Hoon Na 7 · 0 0

(b!)/(a-1)!

where ! = factorial

2006-08-01 21:26:47 · answer #6 · answered by Da Sahar SToRaY 2 · 0 0

fedest.com, questions and answers