Avatar of xenium
xenium
 asked on

Easy maths question

In a network with N nodes, what's the maximum number of connections you can make?

eg N=2, gives 1 connection, N=3 gives 3, N=4 gives 6, N=5 gives 10, N=6 gives lots etc

I think it's sum of N-i from i=1 to N-1

How many when N=100?

Can I simplify this in terms of N only and what's the function called in maths and/or in Excel or google sheets?

Probably easy but it's been years since i did maths.

Thanks!
Math / Science

Avatar of undefined
Last Comment
hypercube

8/22/2022 - Mon
SOLUTION
Shaun Vermaak

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
xenium

ASKER
Thanks, I'm looking for a formula that gives the answer straight off.

Just guessing it seems to be N choose 2, that googles to the right answer for 100

Is that right?
Shums Faruk

In excel you can use below formula assuming  your data starts from A1:
=SUMPRODUCT(LARGE(A1:A100,ROW(INDIRECT("2:100"))))

Open in new window

xenium

ASKER
I assume we don't need arrays.

If N choose 2 is the right answer then i can just use that formula, i assume Excel has the function, else a factorial version
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
xenium

ASKER
eg
=FACT(100)/(2*FACT(100-2))
xenium

ASKER
or
=COMBIN(100,2)
xenium

ASKER
Now i think about it, it all makes sense. THe number of connections is the number of ways you can choose two nodes from the whole set.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
xenium

ASKER
Thanks all for your input and helping me get to an answer quickly.
Shums Faruk

Are you asking a question or testing us? If you already did your homework.
Why you need to send close request? right away accept Shaun's solution and it will close automatically.
hypercube

In a network with N nodes, what's the maximum number of connections you can make?

 eg N=2, gives 1 connection, N=3 gives 3, N=4 gives 6, N=5 gives 10, N=6 gives lots etc

 I think it's sum of N-i from i=1 to N-1
Consider this:
Starting with "n" nodes, each node added gets N nodes.
Each node added, adds "n" connections.
So the formula is a sum of added connections.
The number of connections is a sequence: 1,2,3,6,12,
1 to 2 adds 1 for 1 total
2 to 3 adds 2 for 3 total
3 to 4 adds 3 for 6 total
4 to 5 adds 4 for 10 total
99 to 100 adds 99 >> so we will call M=N-1 as the sequence ends at N-1
SUM over k=1:M (1:k-1) which is done with a well-known formula M*(M+1)/2
Check:
M=1>>1*(1+1)/2=1
M=2>>2*(2+1)/2=3
M=3>>3*(3+1)/2=6
M=4>>4*(4+1)/2=10
.
M=99>>99*(99+1)/2=4,950

In this case, you have to be careful because there are N nodes and N-1 added connections.  Thus M=N-1
How many when N=100?
4,950

Can I simplify this in terms of N only
Yes. As above.
what's the function called in maths
Partial sum of integers
and/or in Excel or google sheets? SUM
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
hypercube

Incomplete answer
xenium

ASKER
Thanks Fred, that's a good point. I will request to defer closing so I can re-assign points.
xenium

ASKER
n-choose-i.jpgNice formula btw, i see now how it's equivalent to the general case attached.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
hypercube

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
hypercube

I rather hate to do this but it seems technically proper if not socially proper....