MathGroup Archive 2009

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

Search the Archive

Strange behavior: random and plot

Hi group.  I am new here and discovered some strange behavior (to me.) 
Hope someone can help.

I will be teaching a course on programming with Mathematica this 
semester and so you may hear from me some more.

I define


If I evaluate ran[3]-ran[3] I get a non-zero result as expected.

But if I do

Plot[ ran[x]-ran[x] ,{x,0,3}]

  I get an empty axes system.  I assume it is the plot of the zero function.

I also know that if I set


then I get a non-zero plot as expected when I do

Plot[ ran2[x]-ran[x] ,{x,0,3}]

I am guessing the plot command is evaluating things in a strange way 
that forces the two instances of ran to be the same.

Can anyone explain why?


Don Krug
Northern Kentucky U

  • Prev by Date: Re: Incongruence? hmm...
  • Next by Date: Re: Viewing packages in mathematica
  • Previous by thread: Re: Re: Viewing packages in mathematica
  • Next by thread: Re: Strange behavior: random and plot