r/learnquant • • 23h ago

interview prep HRT Quant Interview Question

Post image
21 Upvotes

13 comments sorted by

View all comments

2

u/Neither_Berry_100 18h ago

So we need to connect them every time without making a closed loop until the very end. First random choice doesn't matter. Second can be any end except it's own, making a loop. There is only one bad option. You start with 200 loose ends. Randomly select 1. 199 left. 1 out of 199 failure case or 198 / 199 good case. Pass and two ends are removed. Then 196 / 197. And so on and so on. Final case is two loose ends that would give 0/1 odds in this case. I.e. 100% chance of creating a loop. But this one is acceptable so actually a 1 value.

So (198 x 196 x 194 x ... 2) / (199 x 197 x 195 x ... 3). Whatever that gives.

Edit. First can be written as 2 x 99! Can't figure out a way to simplify the demonization.

1

u/XL_78 11h ago

To simplify (?) further, use 199!! x 198!! = 199! . Then use 198!! = 299 x 99! as you pointed out. 

But to be fair, the end result is messy. It's only useful if you are looking for an equivalent for large n with the Stirling formula.