Tech

Indiana Jones and the Knapsack Problem

If Indiana Jones was escaping a collapsing treasure dungeon with a limited capacity knapsack, how would he decide what to take with him? Rationally, you would want to get the most value for what you can carry, much like eating the most expensive food at a buffet to get your…

Primes Under 1 Million

Finding all primes under 1 million. Sounds easy…but maybe a little more demanding than it appears. Depending on the algorithm, all the primes may or may not be generated in a timely manner. Generally, a number n is checked for primality by iterating through all the numbers from 1…