Programming language used in Berry Nelson's (Stochastic modeling) book

113 Views Asked by At

If anyone has read the book "Stochastic Modeling : Analysis and Simulation by Berry L. Nelson", can you tell me in what programming language are the algorithms written in the book? Here is an example of one of the algorithm -

$U\leftarrow random()$

i $\leftarrow$ 1

$until \space U$ $\le$ $F_x(a_i)$

do

$i \leftarrow i + 1$

enddo

$X \leftarrow a_i$

return $X$

3

There are 3 best solutions below

0
On BEST ANSWER

I suspect it's pseudocode. R uses <- for assignment, and return(X) for returns. Programming languages typically stick to the ASCII characters (32-127), and $\leftarrow$ isn't one of them, whereas professors are inordinately fond of $\leftarrow$ for assignment and pseudo-Algol block delimiters. If the intent were to actually use R, I'd think he would... actually use R. Further evidence that the book is language-agnostic: the Preface to the Solutions Manual states:

This manual contains solutions to the problems in Stochastic Modeling: Analysis and Simulation that do not require computer simulation. For obvious reasons, simulation results depend on the programming language, the pseudorandom-number generators and the random-variate-generation routines in use. The manual does include pseudocode for many of the simulations, however. A companion disk contains SIMAN, SLAM, Fortran and C code for the simulation “cases” in the text.

0
On

I have not read the textbook in question, however this looks like R syntax. Namely, I am telling this from the use of the until-do-end structure and the <- for variable assignment.

It's also likely since R is a very useful language for this kind of application.

0
On

It's surely pseudocode very close to Math Notation (as it uses math typesetting) and using R syntax for the assignment case. Transforming this into actual code seems not difficult as I can see a pretty straightforward mapping between pseudocode and many actual programming languages (C++, Python, R, ...) is possible. To realize this proficiency with both math notation and target programming language is required