Re: Table of Values

*To*: mathgroup at smc.vnet.net*Subject*: [mg109567] Re: Table of Values*From*: Albert Retey <awnl at gmx-topmail.de>*Date*: Wed, 5 May 2010 06:07:29 -0400 (EDT)*References*: <hrot0s$5te$1@smc.vnet.net>

Am 04.05.2010 12:30, schrieb Nicholas Kormanik: > The Mathematica mini-program below has been useful for solving for x, > given the other inputs. It is analogous to a single-shot rifle: > > > x =. > > tradecomission := 9.99 > feepercontract := .75 > > pricepercontract := .73 > numbercontracts := x > > totalcost := 8484 > > Solve[numbercontracts == (totalcost - > tradecomission)/(pricepercontract*100 + feepercontract), x] > > > > What I'd like to somehow obtain now, however, is a rifle with a clip > or magazine --- in other words, a TABLE of values. Below would be an > example of such a table: > > pricepercontract numbercontracts > ..73 114 > ..74 113 > ..75 111 > ..76 110 > ..77 108 > ..78 107 > ..79 106 > ..80 104 > ..81 103 > ..82 102 > ..83 101 > ..84 99 > > > Does anyone know if there is a fairly easy and straightforward way of > setting this up? tradecomission = 9.99 feepercontract = .75 totalcost = 8484 results = Table[ {pricepercontract, numbercontracts /. First[Solve[ numbercontracts == (totalcost - tradecomission)/(pricepercontract*100 + feepercontract), numbercontracts]]}, {pricepercontract, 0.71, 0.84, 0.01} ] Grid[Prepend[results, {"price per contract", "number of contracts"}], Dividers -> All] hth, albert