MathGroup Archive 2007

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

Search the Archive

Re: Button Question



Hi John,

you entered the probabilities as strings not as numbers.

hope this helps, Daniel



John wrote:

> The cell, pasted below, is in my notebook. When the cell is evaluated,

> It prints a button, labeled simulate, but clicking on the button does

> not  print the six simulated integers that RandomInteger  computed.

> 

> The error message says that the list of probabilities, entered as

> shown below, is not a probability distribution recognized by the

> system, but {1/6,1/6,1/6,1/6,1/6,1/6} is a valid multinomial

> distribution.

> 

> ButtonEvaluator, not mispelled, is printed in red. The color red must

> be an indication of an error of some kind, but I have no idea what it

> is.

> 

> Cell[ButtonBox["Simulate", Active -> True,

>    ButtonFunction ->

>     Print[RandomInteger[

>       MultinomialDistribution[

>        100, {"1", "/", "6", "1", "/", "6", "1", "/", "6", "1", "/",

>         "6", "1", "/", "6", "1", "/", "6"}], 1]],

>    ButtonEvaluator -> Automatic] // DisplayForm, "Output"],

> 

> In one example, I saw, the arrow between ButtonFunction and Print is

> short and preceded by a colon. If if that notation is necessary, I

> don't know how to do it.

> 

> Helpful advice will be appreciated .

> 

> John

> 

> 

> 

> 

> 

> 




  • Prev by Date: Re: pattern
  • Next by Date: Re: is it possible to solve Matrix Equations?
  • Previous by thread: RE: Button Question
  • Next by thread: Re: Button Question