We’re rewarding the question askers & reputations are being recalculated! Read more.
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 17408

Questions related to combinatorics and discrete mathematical structures

3
votes
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
1
vote
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
-1
votes
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
2
votes
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
1
vote
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
2
votes
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
1
vote
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