What is this?
The Inefficient Fibonacci Challenge is a competition to compute the nth Fibonacci number in the worst possible way, without cheating using artificial delays. The winning submission will win a £5 Amazon gift card.
Rules
- Your submission must be written in Python
- Your submission must define a function called
fib(n) fib(n)must return the exact value ofFib(n)nis a non-negative integer- No sleeps, waits, or timing tricks
- No memoization or caching
- Must terminate and be correct
- Inefficiency must be algorithmic
- Submissions may not make external network requests; code will be executed with networking disabled for evaluation.
- We will evaluate all submissions on a single integer
nchosen uniformly at random from 10 to 50 (inclusive) - The fibonacci sequence is defined as:
Fib(n) = Fib(n−1) + Fib(n−2) for n ≥ 2
Ideas
- Redundant recomputation
- Terrible asymptotic complexity
- Re-deriving constants like φ and √5
- Random search that eventually works
- Virtual machines, interpreters, or simulators
- Mathematical overkill
Submit Your Abomination
Paste your code below.
Scoring
- Slowest runtime (for fixed n)
- Judges' Choice: Overall stupidity
Evaluation & Prize
For each round we will pick a single integer n at random from 10 to 50 (inclusive) and run all submitted programs on that same n. The submission with the slowest correct runtime for the chosen n wins. If two or more submissions tie, a secondary random number will be used as the tiebreaker.
Each submission will be executed twice during evaluation: first as a short warm-up run (not timed) and then once for the timed run. The timed run is used for ranking.
Prize: a £5 Amazon gift card.
We will run submissions in an isolated sandbox for evaluation with networking disabled. By submitting code you consent to your code being published on YouTube and other social media.