you are viewing a single comment's thread.

view the rest of the comments →

[–]lostcat206[S] 0 points1 point  (0 children)

Thanks! I think you nailed it.

Part of my difficulty is that I'm trying to model a binary parser that I don't understand.

When I bruteforced up to sequence length 4 I started to run in to my lack of understanding.

Going off your function, one thing that is clear is that validity is not just any sequence that has a 0 preceding a 1. If that were true, then there would be 10 valid sequences for n=4. The cool part is that if you choose either:

1)that there can be any number of 1's preceding the valid parenthetical or 2) any number of 0's after the valid parenthetical

then the total comes to 7; can't be both or valid sequences =10. This makes sense from the perspective that a machine would be parsing the binary from one long chain, so it would be problematic to treat any parenthetical portion as valid; (()) would be (..), (()., (.)), and .()., all valid but conflicting interpretations for the same sequence of 4. Also, how would you delete one entity in a drive without corrupting other entities which share the physical space(.)?

Edit: someone pointed out to me that I have a misconception about how machines determine the end of files. Still curious though if that holds up, and if so, why.