# Question:How to translate from Maple to Maple TA?

## Question:How to translate from Maple to Maple TA?

I know how to solve a problem in Maple, but can't translate into Maple TA. I'm teaching elementary statistics, and want students to estimate a median using a cumulative frequency distribution.

In Maple, I randomly generate some intervals and frequencies. Then I define the CFD by giving the end points and the cumulative frequency, like;
(1) XY:= Array([[x0,cf0],[x1,cf1],[x2,cf2],[x3,cf3],[x4,cf4]]);

Then I use the endpoints to define a spline (the ogive or CFD). Then I invert it, and find the value of x that is equal to the y4/2:
(2) solve(CurveFitting[Spline](XY, x, degree=1)=(cf4)/2,x);

So, now I want to write a Maple TA question that gives the student random frequencies and asks them to estimate the median from the CFD. How do I write an algorithm to generate (2) as an answer? I've tried:
(3)  \$med=maple("map(x->solve(CurveFitting[Spline](\$XY, y, degree=1)=x,y),\$cf5/2)");
but I just get a message saying: Warning, solutions may have been lost

I'm using Maple TA 3.01 and therefore I've written the above in Maple 11.