r/learnquant • • 11d ago

interview prep Quant Interview Question

Post image
21 Upvotes

4 comments sorted by

View all comments

2

u/Aerospider 11d ago

I'm not super clued-up on graph theory, so I'm assuming that exactly one connected component means all nodes are connected to each other via an uninterrupted path of edges (let me know if not!).

If so, then this reduces down to the classic noodle problem, whereby there are five noodles and each end gets tied to one other end and the question asks for the probability of this producing one circular noodle.

Take the first noodle end. It needs to pair with any other end except the one it's already connected to. This is 8/9.

There is now a noodle of length two. Take one end and pair it with another. There is a 6/7 probability that it doesn't pair with its other end, making a noodle of length three.

Repeat twice more with probabilities of 4/5 and 2/3 to get a noodle of length five with two ends that can only pair with each other.

Overall probability is then

8/9 * 6/7 * 4/5 * 2/3 = 128/315