YouKn0wWho's blog

By YouKn0wWho, 6 years ago, In English

Find the number of ways to select $$$k$$$ non-intersecting edges from a linear graph with $$$n$$$ nodes. In a linear graph every $$$i$$$ and $$$(i - 1)$$$ is connected by an undirected edge for each $$$i$$$ from $$$2$$$ to $$$n$$$.

Two edges intersect if they share some node. Two ways are different if there is some edge which is selected in one way but in the other.

Constraints: $$$1 \leq k \lt n \leq 10^5$$$

  • Vote: I like it
  • +22
  • Vote: I do not like it

»
6 years ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

$$$\binom{n-k}{k}$$$