## 118 Reputation

11 years, 200 days

## @Preben Alsholm    So if I u...

So if I understand properly. You're actually imbedding images of worksheets into your Latex? This would not be an option for me as there will be a LOT of maple code include in what i'm preparing. Plus this will inflate the size of the .pdfs quite a bit.

PV

## @Preben Alsholm    So if I u...

So if I understand properly. You're actually imbedding images of worksheets into your Latex? This would not be an option for me as there will be a LOT of maple code include in what i'm preparing. Plus this will inflate the size of the .pdfs quite a bit.

PV

There is no Maple 14/etc folder (at least on OS X).

I should mention that I *do* have the maple*.sty files in the folder along with the tex-file. That is, the latex is compiling fine, and despite this is producing blank output.

There is no Maple 14/etc folder (at least on OS X).

I should mention that I *do* have the maple*.sty files in the folder along with the tex-file. That is, the latex is compiling fine, and despite this is producing blank output.

## @John May    I'm inclined to...

I'm inclined to agree with you John.

## @John May    I'm inclined to...

I'm inclined to agree with you John.

## @Robert Israel  Completely agree. ...

Completely agree. However, this is a stochastic process course (for non-programmers and non-mathematicians) and most of the students will only be able to use maple as a "symbolic calculator". We're trying to be very verbose with our code so they know exactly what happens. Although I think functional (or semi-functional in the case of maple) is more elegant; it is notoriously difficult to decipher.

I did something like this instead:

interface(quiet=true):with(Statistics):states := [ "S", "C", "R" ]:
#The probability distributions from transitioning OUT of a state
dist["S"] := ProbabilityTable([0.6, 0.3, 0.1]):
dist["C"] := ProbabilityTable([0.4, 0.5, 0.1]):
dist["R"] := ProbabilityTable([0.3, 0.4, 0.3]):
TransitionFrom := state -> states[ Sample( dist[state], 1)[1] ];
#starting from the 'sunny' state is arbritrary
TodaysWeather := "S";
WeatherHistory := NULL;
for i from 1 to 50 do
    NextWeather := TransitionFrom( TodaysWeather );
    WeatherHistory := WeatherHistory, NextWeather;
    TodaysWeather := NextWeather;
end do:
cat(WeatherHistory);

As a side note. I'm having a lot of difficulty posting code into these windows. It doesn't format properly, and everything seems to want to double space. Advise?

## @Robert Israel  Completely agree. ...

Completely agree. However, this is a stochastic process course (for non-programmers and non-mathematicians) and most of the students will only be able to use maple as a "symbolic calculator". We're trying to be very verbose with our code so they know exactly what happens. Although I think functional (or semi-functional in the case of maple) is more elegant; it is notoriously difficult to decipher.

I did something like this instead:

interface(quiet=true):with(Statistics):states := [ "S", "C", "R" ]:
#The probability distributions from transitioning OUT of a state
dist["S"] := ProbabilityTable([0.6, 0.3, 0.1]):
dist["C"] := ProbabilityTable([0.4, 0.5, 0.1]):
dist["R"] := ProbabilityTable([0.3, 0.4, 0.3]):
TransitionFrom := state -> states[ Sample( dist[state], 1)[1] ];
#starting from the 'sunny' state is arbritrary
TodaysWeather := "S";
WeatherHistory := NULL;
for i from 1 to 50 do
    NextWeather := TransitionFrom( TodaysWeather );
    WeatherHistory := WeatherHistory, NextWeather;
    TodaysWeather := NextWeather;
end do:
cat(WeatherHistory);

As a side note. I'm having a lot of difficulty posting code into these windows. It doesn't format properly, and everything seems to want to double space. Advise?

## Thanks!...

Thanks Robert,

That's exactly what I needed to know.

It's for the undergrads though; so I may put the for loop back in (although your version is definitely more efficient).  In this case exposition is more important than speed.

Thanks again,

Paul

## Thanks!...

Thanks Robert,

That's exactly what I needed to know.

It's for the undergrads though; so I may put the for loop back in (although your version is definitely more efficient).  In this case exposition is more important than speed.

Thanks again,

Paul

## "literal"ly going insane....

This is nice, but how does one typset something like \MapleInput{x^2;} without Latex complaining? putting \verb|x^2| will not work, nor will any of the \text{} variants. I'm not even exactly sure how one inserts a "^"; \^ is a foreign character.

## "literal"ly going insane....

This is nice, but how does one typset something like \MapleInput{x^2;} without Latex complaining? putting \verb|x^2| will not work, nor will any of the \text{} variants. I'm not even exactly sure how one inserts a "^"; \^ is a foreign character.
 1 2 3 Page 3 of 3
﻿