Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you have n nodes, each one needs to connect to n-1 other nodes. But the connection from A to B is the same as the one from B to A. Therefore, there are n(n-1)/2 total connections.


Sure, that's true for single connections, the state of the switchboard when you have exactly one patch plugged in. If there are 5000 phones, there would be 5000 possible starting points and 4999 possible ending points, and as you say, A-B and B-A being equivalent, there are two ways to get there, so divide by 2.

But what if you then connect a second pair of phones, leaving the first patch in place? 4998 choices for A by 4997 for B again divided by two. And so on, until you place the 2500th patch on the board. But then there's more division to do, because there are 2500! different sequences to fill the board with that exact same pattern. It's a fun little combinatorics exercise.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: