From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id D3BB1BC0A for ; Wed, 23 May 2007 19:10:25 +0200 (CEST) Received: from sdmx1.scea.com (sdmx1.scea.com [160.33.44.36]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4NHAO4p021907 for ; Wed, 23 May 2007 19:10:25 +0200 Received: from edenfox.989studios.com (edenfox.989studios.com [160.33.45.60]) by sdmx1.scea.com (8.13.6/8.13.1) with ESMTP id l4NHAKQj012036; Wed, 23 May 2007 10:10:20 -0700 X-Envelope-From: X-Envelope-To: X-Envelope-To: Received: from postal1-dog.naughtydog.com (testmail.naughtydog.com [10.15.0.5]) by edenfox.989studios.com (8.13.7/8.13.7/SCEAint-1.0) with ESMTP id l4NHAIPw023245; Wed, 23 May 2007 10:10:19 -0700 Received: from [127.0.0.1] ([150.0.6.116]) by postal1-dog.naughtydog.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 23 May 2007 10:09:13 -0700 Message-ID: <46547446.2000408@naughtydog.com> Date: Wed, 23 May 2007 10:05:10 -0700 From: Pal-Kristian Engstad User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Vincent Aravantinos Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: Re: Teaching bottomline, part 3: what should improve. References: <20070523100002.6B193BC73@yquem.inria.fr> <3A6A724D-68A1-4D21-8EF8-7B39F64110E6@yahoo.fr> In-Reply-To: <3A6A724D-68A1-4D21-8EF8-7B39F64110E6@yahoo.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 23 May 2007 17:09:13.0746 (UTC) FILETIME=[16725720:01C79D5D] X-Scanned-By: MIMEDefang 2.48 on 160.33.44.36 X-Scanned-By: MIMEDefang 2.62 on 160.33.45.60 X-BorderEnvelope-To: X-BorderEnvelope-To: X-Miltered: at discorde with ID 46547580.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; inputs:01 pke:01 dog:98 closures:01 wrote:01 caml-list:01 functions:01 computation:01 computation:01 yellow:97 essentially:02 graphics:02 match:02 output:02 treating:02 Vincent Aravantinos wrote: > Those are typically the comments of a "used-to-functional-programming" > guy. > It certainly doesn't match what a beginner would think (no beginner > will call a > function a "value"). This reminds me of a "game" I used to teach my math students the concept of a function. I think it should be able to be used for an introductory computer science class as well. Essentially, the game involves having person A come up with a rule. Person B will have to provide an input value, and A has to faithfully give the result of the rule/computation. Examples of functions could be \x->x+2, \x->2*x, etc. More interesting examples involves the function that returns the first letter of the name of the input (f "one" = "o"), or the successor of a "red, yellow, green" traffic light symbol. When doing this, A and B will quickly have to agree on the allowed input values (the domain) and in order to have a chance it is also helpful if B knows the range of output values (the image). And for sure - they will have to agree that the rule x = y => f(x) = f(y) has to hold in order to be able to guess what "f" is. [I would also disallow closures for this game - otherwise it would be too hard to guess.] The reason this exercise is good is that it teaches the students (in a fun way) the important concepts behind a function. It will make them understand that a function is just a computation, but also point out the importance of defining the types (sets) of inputs and outputs. I think that after playing this game, you can venture to talk about the "name" of the function, and they will realize that it does not matter what the name of the function is - just what it does. Perhaps after this, you can teach the concept of treating a function as a value, or input to another function? Person A makes a function that takes person B's function, etc. Thanks, PKE -- Pål-Kristian Engstad (engstad@naughtydog.com), Lead Graphics & Engine Programmer, "Uncharted"-team, Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North, Santa Monica, CA 90404, USA. Ph.: (310) 633-9112. "Most of us would do well to remember that there is a reason Carmack is Carmack, and we are not Carmack.", Jonathan Blow, 2/1/2006, GD Algo Mailing List