[Date Index] [Thread Index] [Author Index]
Re: Interesting problem looking for a solution.
I used just such a method in several courses some years ago, including linear algebra and discrete math. Some of that was described in a presentation I gave at the 1998 Mathematica Conference in Chicago. Briefly: 1. You write a Mathematica package, let's call it prep.m, that prepares the data -- in your case, that somehow randomly creates the function f (selecting randomly from a list of function types, for that type selecting from values for various parameters), and then creates the graph and writes it to the evaluation notebook. More about prep.m in a moment. 2. You prepare a notebook, let's call it problem.nb, in which the package prep.m is called by a Get. 3. You distribute both prep.m and problem.nb to the students. 3. The student evaluates the Get cell in problem.nb (or you make the Get cell an initialization cell). When Get is called, it writes the randomly created output to the notebook problem.nb. Now to deal with the issue of keeping the data generation method secret: In the package, you need to do all the work inside a context that, at the end of the package, gets deleted from $ContextPath and $Packages lists; Remove various stuff defined along the way. And finally, after you're sure it all works, encrypt the package via Encode. (I don't recall whether you need to run Encode on the same platform as the target platform students will be using.) If you wish, you can even do such fancier things as condition the package's random choices upon, say the student's name: in problem.nb, the student types her name into a global variable, to which prep.m will therefore have access. On 10/9/11 3:52 AM, Church, Gary wrote: > Hello, > > I have an (I think) interesting problem for you Mathematica gurus. > > I'm trying to create a worksheet for my students and want to be able to display the plot of a randomly generated function f[x], without them being able to access the expression which defines f; In other words, I don't want them to be able to evaluate f[x]. > > The idea is that each student will get a different function f[x] and will see a different graph and they have to determine the expression which defines f. They then have to plot the function they think is f against the actual function f[x] and turn in the two plots (or the one plot with the two graphs.) > > Is this possible? > > Thanks much, > Gary > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305