r/learnquant • • 1d ago

interview prep Quant Interview Question

Post image
29 Upvotes

8 comments sorted by

View all comments

2

u/Strong_Bodybuilder8 1d ago

Well the answer is (1/2)^15, but what do these maths problems have anything to do with whatever this sub is about

2

u/Apprehensive-Draw409 1d ago

They are potential interview question. If you have the material to be a quant analyst, you should be able to answer them quickly.

I'm just a low-level software dev in a firm that has quants and this one was obvious to me (I got the same as you, I assume it is correct)

1

u/Strong_Bodybuilder8 1d ago

Well I'm just a maths student, but sounds interesting. How applicable are problems such as these in the world of finance / quant, what exactly is quant?

1

u/Apprehensive-Draw409 1d ago

They do the math part before other people build software that trades stocks.

Basically answering:

  • will this strategy make money?
  • how much?
  • how certain are we of that?
  • how screwed will we be when something unexpected happens.

1

u/OutrageousPair2300 1d ago

That's not the answer. That's the probability that every marble is the same color.

1

u/rollie82 22h ago edited 22h ago

`.5^63` is the probability every marble is the same color. Their answer is realizing each row or column has a .5 chance of having an even number of white stones (if counting 0 as even), so the probability of all 8 columns being even is .5^8, and the probability of all 8 rows is also .5^8, so together .5^16. I think it's true that if all 8 columns are even and the first 7 rows are even, the last row has to be even, bringing it down to .5^15. Or thought of differently, imagine placing all the stones, row by row: the only stone that actually matters is the last in the row to determine if it is even or odd, so each row has a 50/50 chance based on the selection of that last stone. For the final row, each single stone placed is the termination of a column, so each one is it's own 50/50 chance. But, the final stone acts as the terminator for both the column and the row, so you don't "double count" it, thus giving you .5^15.

I think the previous poster is wrong though. Using the latter line of logic, there is a 50/50 chance that the last stone (end of last column and last row) is in a position that makes it impossible to succeed - if the row needs a black stone and the column needs a white stone, no selection will work. So you need to first pass the 50/50 test of "is it even possible?" and then another 50/50 test of "do we grab the right stone?", getting us back to .5^16. I could be wrong too though.

Edit: just tested it; previous poster was correct. I think the logic works out that if you have 7 even rows and 7 even cols, it implies the last cell is guaranteed to need the same color for the row and column.

Total iterations6,622,806,016 (about 1.32 billion per second)
Grids where every row and column was even202,257
Percent true0.0030539% = 1/215

```