One important aspect of software engineering is also the proper specification of the intended project by the customer. A mistake in the initial specification is crucial, so it is important to state a task in a clear unambiguous manner. In practice, unfortunately, a software engineering team often has to guess what the customer really wants. This was the case for problem AA at IEEE Xtreme 2012:
In a forest, there were 'x' bunnies, 50% male, and 50% female, all adults. Bunnies doubles every 15 days, 10% of the baby rabbits dies at birth. They mature after 30 days, 30% leave the forest, and rest becomes rabbits. In every 30 days , 25% dies off due to flu. If every bunny dies off, the bunny world ends. Calculate the final number of bunnies alive after 1 year for any number of initial bunnies, x.
The problem is very interesting since it defines a simulation of an ecologic system. See for comparison the description of the Lotka Volterra system featuring rabbits and foxes. However, the problem specification is unclear in many aspects. What is the essential difference between an "adult bunny", a bunny, a "baby bunny" and a rabbit? It is not mentioned how to handle rounding, if the leaving of the forest happens once for a group that just matured or if an adult rabbit is tempted to leave the forest every time.
The problem had been complemented by these two test cases:
So a group of 444 dies out after one year, while a group of 30000 almost doubles. Given that the described effects are all linearly superimposable (except for possible rounding errors), it seems odd how the two groups yield so different results. 30000 is around 68 times as much as 444, so the results just also differ by that factor. The following python program implements one possible interpretation of this problem:
Test Case 1 444 (input) 0 (output) Test Case 2 30000 (input) 56854 (output)
b0=0 #newborn bunnies b15=0 #15 day old bunnies b30=input() #30 day old, read from stdin for i in range(25): #one year print "t:",(i*15)," bunnies:",(b0+b15+b30) oldb0=b0 b0=int(b30*0.9) # babies, 10% die b30=int(b30+b15*0.7) # maturing, 30% leave forest b15=int(oldb0) b0=int(b0*0.75) # 25% die off by the flue b15=int(b15*0.75) # 25% die off by the flue b30=int(b30*0.75) # 25% die off by the flue
Running the program gives us 772 bunnies after one year with a starting population of 444 and 54816 for a starting population of 30000, both in contradiction to the test cases. Obviously the specification is unclear or wrong. Among all 1900 participating teams, not a single one was able to find the correct solution. Poor bunnies :-)
- W. Elmenreich, R. D'Souza, C. Bettstetter, and H. de Meer. A survey of models and design methods for self-organizing networked systems. In Proceedings of the Fourth International Workshop on Self-Organizing Systems. Springer Verlag, pages 37-49, 2009.