MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Table of Values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109563] Re: Table of Values
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 5 May 2010 06:06:45 -0400 (EDT)

numbercontracts[
   totalcost_, 
   tradecomission_,
   pricepercontract_,
   feepercontract_] = Floor[
   (totalcost - tradecomission)/
    (pricepercontract*100 + feepercontract)];

With[{
  tradecomission = 9.99,
  feepercontract = .75,
  totalcost = 8484},
 Join[{{"pricepercontract", "numbercontracts"}},
   Table[{pricepercontract, numbercontracts[
      totalcost, tradecomission,
      pricepercontract, feepercontract]},
    {pricepercontract, .73, .84, .01}]] // Grid]


Bob Hanlon

---- Nicholas Kormanik <nkormanik at gmail.com> wrote: 

=============
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?

Thanks,

Nicholas



  • Prev by Date: Re: Table of Values
  • Next by Date: Re: Table of Values
  • Previous by thread: Re: Table of Values
  • Next by thread: Re: Table of Values