Maths Question

Page may contain affiliate links. Please see terms for details.

hoopdriver

Guru
Location
East Sussex
You're doing this at 3:07am?
 

Tim Hall

Guest
Location
Crawley
[QUOTE 2271461, member: 9609"]I was struggling with the following problem and cheated and worked it out in excel. But I am still really curious how I would work it out on a bit of paper. (it is vaguely cycling related so probably allwed on the forum :-))

If you could imagine the number 6 and all the numbers that lead to it add up to add upto 21
1+2+3+4+5+6=21
the equation for this is quite easy (n+1) / 2 x n

but what I need to know is how to work it out for all the numbers that lead up to 6
1+2+3+4+5+6
1+2+3+4+5
1+2+3+4
1+2+3
1+2
1
=56

now I needed to do this when 'n' was in excess of 400,000 - clearly not practical on a bit of paper, the answer was something like 10^16

So how would I create a equation for this problem?[/quote]
Don't know. But your original formula is wrong. It should be n(n+1)/2.
 

srw

It's a bit more complicated than that...
[QUOTE 2271955, member: 9609"]No it wasn't, It was as correct as yours ![/quote]
No. To a mathematician, (n+1) / 2 x n is the same as (n+1)/2n. You need to multiply by n, not divide.

[QUOTE 2271962, member: 9609"]Many thanks for that, quite a simple little equation.

Could I ask you to explain how you created it?[/quote]
It feels combinatorial. I suspect the general answer is
(n+1)! / (n-m)! . m!

It's been a very very long while since I did combinatorics, but it's something like the number of ways of selecting m things from n. You're asking for the number of ways of selecting 3 from n. The proof will be by induction - prove true for n=1 and that if true for n, also true for n+1.
 

vernon

Harder than Ronnie Pickering
Location
Meanwood, Leeds
[QUOTE 2272095, member: 9609"]I didn't write (n+1)/2n , that would be the same as (n+1) / (2 x n) which would be wrong.
I wrote (n+1) / 2 all multiplied by n

try typing =(9+1)/2*9 into a cell in excel and see what happens, then try the same experiment in a module. It works the way it is intended!

I'm sure if I said the sky was blue you would be along to tell me it was sometimes grey.[/quote]

I'm afraid that you did type (n+1)/2n

if you wanted (n+1)/2 all multiplied by n you should have typed

n(n+1)/2

Just because Excel parses your expression to give you a 'correct' answer does not mean that your expression is correct. It could be a case of two wrong making a right.
 

vernon

Harder than Ronnie Pickering
Location
Meanwood, Leeds
[QUOTE 2272130, member: 9609"]No, you have edited what I typed[/quote]

(n+1)/2n is the same as (n+1)/2 x n

You are correct I have removed the surplus and redundant symbol.
 
Top Bottom