<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 30, 2015 at 8:52 AM, Roelof Wobben wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Let's say f is a recursive function which calculates the fac. <br></div>
    <br>
    So f 0  = 0 <br>
    f1 = 1<br>
    f2 = 2 <br>
    f3 = 6 <br>
    <br>
    so im my oponion g1 = the answer of f1 which is also the max<br></div></blockquote><div><br></div><div>But recall the problem definition:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">4.21 Given a function f of type Integer -> Integer give a recursive definition of a<br>function of type Integer -> Integer which on input n returns the maximum<br>of the values f 0, f 1, ..., f n.</blockquote><div><br></div></div><div>It doesn't say anything about f, which means you are not allowed to make assumptions about the definition of f.</div><div><br></div><div>f could be defined as:</div><div><br></div><div>  f :: Integer -> Integer</div><div>  f 42 = 100</div><div>  f x  = 0</div><div><br></div><div>Since you don't know anything about f, you must look at all values from f 0 to f n in order to find the maximum.</div><div><br></div><div>Regards,</div><div>Sean</div></div></div></div>