Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5568
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Interesting problem looking for a solution. |
| Date | 2011-10-10 08:29 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j6uadn$f1r$1@smc.vnet.net> (permalink) |
| References | <j6rk1f$1nr$1@smc.vnet.net> |
"Church, Gary" <churchg@smccd.edu> schrieb im Newsbeitrag
news:j6rk1f$1nr$1@smc.vnet.net...
> 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
>
Are you looking for something like this?
To begin with, define the list lf of possible functions.
Then select a definition for f[x] at random from the list, and finally
plot it.
Repeat the second step (In[219]) as often as you (and your students)
like.
In[221]:=
lf = {x^2, Sin[x], Exp[-x]};
In[219]:=
f[x_] = lf[[Random[Integer, {1, 2}]]];
Plot[f[x], {x, 0, 5}];
If you wish to keep the list secret your can hide it from being viewed
using the option inspector of the cell (right click > General
Properties > Cell Open set to false > Apply).
Hope this helps
Wolfgang
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Interesting problem looking for a solution. "Church, Gary" <churchg@smccd.edu> - 2011-10-09 07:55 +0000 Re: Interesting problem looking for a solution. "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-10-10 08:26 +0000 Re: Interesting problem looking for a solution. "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-10 08:29 +0000 Re: Interesting problem looking for a solution. Murray Eisenberg <murray@math.umass.edu> - 2011-10-11 08:23 +0000 Re: Interesting problem looking for a solution. Murray Eisenberg <murray@math.umass.edu> - 2011-10-11 08:31 +0000 Re: Interesting problem looking for a solution. Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-10-12 07:43 +0000 Re: Interesting problem looking for a solution. "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-10-12 07:46 +0000 Re: Interesting problem looking for a solution. DrMajorBob <btreat1@austin.rr.com> - 2011-10-12 07:49 +0000
csiph-web