Received: from PSUVM.PSU.EDU (psuvm.psu.edu [128.118.56.2]) by locke.ccil.org (8.6.9/8.6.10) with SMTP id PAA12310 for ; Sat, 16 Sep 1995 15:21:24 -0400 Message-Id: <199509161921.PAA12310@locke.ccil.org> Received: from PSUVM.PSU.EDU by PSUVM.PSU.EDU (IBM VM SMTP V2R2) with BSMTP id 7551; Sat, 16 Sep 95 15:01:23 EDT Received: from PSUVM.PSU.EDU (NJE origin LISTSERV@PSUVM) by PSUVM.PSU.EDU (LMail V1.2a/1.8a) with BSMTP id 3271; Sat, 16 Sep 1995 15:00:56 -0400 Date: Sat, 16 Sep 1995 14:59:51 EDT Reply-To: jorge@PHYAST.PITT.EDU Sender: Lojban list From: jorge@PHYAST.PITT.EDU Subject: Re: algorithms X-To: lojban@cuvmb.cc.columbia.edu To: John Cowan Status: OR X-From-Space-Date: Sat Sep 16 15:21:29 1995 X-From-Space-Address: <@PSUVM.PSU.EDU:LOJBAN@CUVMB.BITNET> la stivn cusku di'e > How are algorithms expressed in lojban? Of course, one could just describe > them, but the concepts seem a little rich for the syntax of mathematical > expression. > It would be interesting if one could say: > > man=Array[mana, manb, manc] > dog=Array[doga, dogb, dogc] > For i taking values from one to three > For j taking values from one to three > man[i] pets dog[j] > End For > End For Well, you can do something similar: ko'a goi lu'i le nanmu kuxipa e le nanmu kuxire e le nanmu kuxici ko'e goi lu'i le gerku kuxipa e le gerku kuxire e le gerku kuxici i ro da poi cmima ko'a ku'o ro de poi cmima ko'e zo'u da satre de > or to avoid implying a specific order: That one doesn't imply a specific order. Using {vu'i} instead of {lu'i} would imply a specific order, although who knows what order. (Temporal?) > or to mean a different thing > > For i taking values from one to three > j=Random[integer on closed interval (1,3)] > man[i] pets dog[j] > End For I'm not sure when you would want to say something like that. saying: i ro da poi cmima ko'a ku'o su'o de poi cmima ko'e zo'u da satre de tells you that each man pets one of the three dogs, without saying which. But that is different from saying that each man touches one dog selected at random. The computer language is probably used to give an order, rather than to give information. > I believe that handling of problems involving statements about the dogs and > men might benefit from some algorithmic thinking. By the way, the example > algorithmic expression was chosen for clarity of expressing the idea. There > are some powerful operaters in J and Mathematica which would handle these > types of expressions with elegant precision and compactness. There is a difference in saying that each man pets a dog, and giving an order to the computer to assign a dog to each man. Jorge