Systems programmer with an interest in cybersecurity
Here's a potential winning strategy: take a coin out of your pocket and flip it 100 times. If it lands heads 51 or more times, take both boxes; otherwise, just take the one. Provided the computer had anticipated you being the kind of person that would do this, it would anticipate you are probabilistically more likely to take the single box exclusively and put the million dollars in it. Regardless of the outcome of the coin tosses, you get that million dollar box, and you still get the added $1000 in the first box 49% of the time.
Not commenting on the quad tree specifically but I know a lot of reasoning that goes into non-binary tree structures comes down to performance gains from exploiting cache entry size. When each node lookup in the tree is going to trigger an 64-byte load from L1, it's often much better performance to have your tree have 4 or 8 pointers to children in that cache entry rather than two if it means you do on average half or quarter as many traversals.
> prince Fëanor
> one of the good guys
Uhhhh...
Feanor drew his sword on his half-brother and threatened to kill him because he was paranoid Fingolfin was trying to usurp his power. He compelled all of his sons to swear an oath to slay any man, elf or being in possession of the silmarils (which led to subsequent needless bloodshed).
Then he ordered and carried out the mass-murder of relatively unarmed Teleri in order to rob them of their ships.
Such actions does not a good guy make.
The simplest example is `memcpy(dst, src, len)` and similar iterative byte copying operations. If the function did not use noalias, the compiler wouldn't be free to optimize individual byte read/writes into register-sized writes, as the destination may overlap with the source. In practice this means 8x more CPU instructions per copy operation on a 64-bit machine.
Note that memcpy specifically may already be implemented this way under the hood because it requires noalias; but I imagine similar iterative copying operations can be optimized in a like manner ad-hoc when aliasing information is baked in like it is with Rust.
This project is an enhanced reader for Ycombinator Hacker News: https://news.ycombinator.com/.
The interface also allow to comment, post and interact with the original HN platform. Credentials are stored locally and are never sent to any server, you can check the source code here: https://github.com/GabrielePicco/hacker-news-rich.
For suggestions and features requests you can write me here: gabrielepicco.github.io