RE: Reducing a function to one argument
- To: mathgroup at smc.vnet.net
- Subject: [mg36169] RE: [mg36155] Reducing a function to one argument
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 26 Aug 2002 04:15:46 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
From: Bob Harris [mailto:nitlion at mindspring.com] To: mathgroup at smc.vnet.net Bob, It is so easy to forget that you need an & at the end of a pure function. NestList[Machine[10,7,#]&, 3, 22] Don't you also want to specify the base? David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ Howdy, I'm trying to figure out the correct syntax to do the following. I have some function with three arguments, and I want to syntactically describe the single-argument function that holds two of those arguments constant (i.e. without creating that single-argument function). More specifically, I have defined Machine[radix_,multiplier_,state_] := Module [{c,s}, c = Floor[state/base]; s = Mod[state,base]; multiplier*s + c ] where I have a generalize 'machine', defined by the radix and multiplier, which converts one state into another state. So I'd like to be able to do something like this: NestList[Machine[10,7,#], 3, 22] to get the series of states that the radix-10 multiplier-7 machine runs through (starting with state 3). However, this syntax doesn't seem to do what I want. I hope that description makes sense. It seems like there must be a syntax to describe the function Machine[10,7,#]. Anyone have any ideas? Thanks, Bob H