[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: "Dale R. Reed" <dale-reed@worldnet.att.net>, neuwirth@smc.univie.ac.at, dajoy@hoy.net*Subject*: Re: LOGO-L> Solving a Max Problem Using Logo*From*: Yehuda <yehuka@softhome.net>*Date*: Tue, 13 Oct 1998 10:52:18 +0200*Cc*: LOGO forum <logo-l@gsn.org>*References*: <001701bdf590$3a276d00$a260490c@321138723worldnet.att.net>*Reply-To*: Yehuda <yehuka@softhome.net>*Sender*: owner-logo-l@gsn.org

Dale R. Reed wrote:

Now if I was a little mathematician that had not yet had too muchHi,

book-larning I would write down the formula for the volume and start

filling in the numbers. Make a table of the dimension x vs the

volume.But Yehuda wanted me to use Logo. So I would write the following

simple little formula and let it do its thing. Daleto box

for [x 15 0] [(print :x (30-2*:x)*(30-2*:x)*:x)]

endbox

15 0

14 56

13 208

12 432

11 704

10 1000

9 1296

8 1568

7 1792

6 1944

5 2000 The value of x for maximum box volume is 5.

4 1936

3 1728

2 1352

1 784

0 0

Dale's solution is a good one, but has 3 points that can be improved:

* It goes on running even after the max point was reached;

* Most of the printed numbers are a "waste", as you use only one (pair)
of them.

* The learner has to search by himself for the max among the output
numbers.

The following program overcomes those inconveniences. For this he have
to observe, that the maximal volume is reached, when any additional **increase**
in x causes a **decrease** in the volume.

In order to make the search as fine as needed, I introduced a variable
:delta. To run my solution say:`
`

` max_vol .1`

(or use some other value for :delta)

I taught this to kids of 14 years old, with no difficulty.to max_vol :deltafor[x 0 15 :delta][if (vol :x)>vol :x+:delta[(pr :x vol :x) stop]]end

to vol :xop(30-2*:x)*(30-2*:x)*:xend

Attached is a Logo graphic solution that shows clearly that the max volume is reached when x=5.

Regards...

[[Yehuda]

http://www.geocities.com/CollegePark/lab/2276/

e-mail: yehuka@softhome.net

**References**:**Re: LOGO-L> Solving a Max Problem Using Logo***From:*"Dale R. Reed" <dale-reed@worldnet.att.net>

- Prev by Date:
**Re: LOGO-L> http://www.crynwr.com/lego-robotics/** - Next by Date:
**Re: LOGO-L> Solving a Max Problem Using Logo** - Prev by thread:
**Re: LOGO-L> Solving a Max Problem Using Logo** - Next by thread:
**Re: LOGO-L> Solving a Max Problem Using Logo** - Index(es):

**Global SchoolNet Foundation**** - **
*Linking Kids Around the World!*

Copyright GSN - All Rights Reserved
- Comments
& Questions

Visit GSN's Global
Schoolhouse for more exciting learning resources!

**Search our Site**
**
- **
**Home**