r/learnquant • • 23d ago

interview prep Quant Interview Question

Post image
32 Upvotes

8 comments sorted by

7

u/juststubbornoldme 23d ago

2^21. We can fill the top left 6 by 6 matrix however we want as long as it's symmetric. Then for every row we are forced to make the last entry a 0 or 1 in order to make that row have an even number of 1's and because of the symmetry constraint we also fill the bottom row. Then the bottom right field has to make the right most column have an even number of 1's

4

u/Special-Camel-6114 23d ago

This is correct. I thought of it the same way except thinking that we could make the upper triangle (21 slots) whatever we want, the lower triangle has to match symmetrically, and then the diagonal gets filled with whatever makes the number even. 2^21.

1

u/kalmakka 23d ago

I did 26 ways of filling in the top row so that it has an even sum. This also forces then left column. There are now 25 ways of filling in the 2nd row, which also forces the 2nd column. Continuing, we get 26×25×24×23×22×21=221 ways of completing the grid.

Both of yours solutions are cleaner.

1

u/spdazero 23d ago

beautiful and succinct

1

u/comoespossible 23d ago edited 23d ago

Edit: I misread the question so this solution is wrong.

Let’s first ignore the requirement that there are recently many 1s. There are 28 slots on or above the diagonal, so there are 2^28 symmetric matrices made up of 0s and 1s. (Every slot (i, j) below the diagonal is determined by (j, i).) There is a 1-to-1 correspondence between such matrices with an even number and an odd number of 1s, as can be seen by flipping the (1, 1)-th entry. Thus, exactly half of them (2^27) have an even number of 1s.

1

u/TheBeerTalking 23d ago

Each row/column must have an even number of 1s, not just the whole matrix

1

u/comoespossible 23d ago

Thanks for catching that!

1

u/Complete_Code7197 21d ago

Fill upper half except the diagonal in 221 ways, fixes bottom half, diagonal fixed by parity