[Haskell-cafe] Harder Question - Chapter 4 - 4.12 - haskell the craft of functional programming - Second Edition
manoel.menezes.jr at gmail.com
Tue Jul 9 04:17:41 CEST 2013
I am trying to solve the question for a long time:
[*4.12 Harder] Find out the maximum number of pieces we can get by making a
*number of flat (that is planar) cuts through a solid block. It is not the
*answer as we calculated for straight-line cuts of a flat piece of paper.*
I find out that this function has the following results:
f 0 = 1
f 1 = 2
f 2 = 4
f 3 = 8
That is, from 0 to 3, the flat cuts all the pieces in two other pieces, so
the number of pieces is doubled.
But, starting from f 4, the flat can not cuts all the pieces, in case of f
4, the flat can cut 6 out of the 8 pieces, resulting
in 12 pieces plus 2 pieces 2 = 14 pieces.
But I can not reach a general case.
Can anybody help me to find out the solution?
Thank you very much!
Manoel Messias da Silva Menezes Jr
M.Sc.in Computer Science
Federal University of Pernambuco
System Analyst - Petrobras
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe