We’re rewarding the question askers & reputations are being recalculated! Read more.

# Search Results

Results tagged with Search options user 17408
7 results

Questions related to combinatorics and discrete mathematical structures

You can sort the five items and simultaneously check for duplicates without any comparisons on some processors: Assume a processor has a fast instruction which determines the position of the highest b …
answered Apr 6 '17 by gnasher729
There is one algorithmic improvement if $n$ is large and you want to express this number for example as a decimal or binary number without any rounding errors: Let's say you have $n$ equals one billio …
answered Jul 1 '16 by gnasher729
Simple. Throw a coin to decide who moves first. In a single game, white has a distinctive advantage. Usually you play tournaments where each side plays white and black equally often.
answered Oct 16 '17 by gnasher729
Finding all collections will generally take exponential time since there is an exponential number of solutions. For example, take { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } and sum = 1000: Take any number of t …
answered Jul 21 '18 by gnasher729
Let's look at two algorithms: Best Fit Ordered, and First Fit Ordered. Both take the items in descending order and put them into a non-empty bin if possible, or into a new empty bin if they don't fit …
answered May 25 '18 by gnasher729
It's trivial to do in O (n), using the obvious formula $F_{i+1} = 2F_i - F_{i-k}$. Just write down the definition of $F_{i+1}$ and note that it is mostly (but not quite) the same as the definition of …
answered Mar 11 '18 by gnasher729
Interesting problem. As noted, you can easily turn this into an integer programming problem. But if your numbers are small and nobody buys a warehouse full of goods an easy algorithm may work. All y …
answered Jun 23 '16 by gnasher729