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

Re: LOGO-L> Logical Puzzle



Olga Tuzova wrote:
> 
> On  Mon, 12 Jan 1998  George Mills  wrote:
> 
> > This is Brian's cup of tea, if you will.
> >
> > Check out MSWLogo\Examples\UCBLogo\Math.LGO
> >
> > This is also what Prolog is all about (that was discussed a while back).
> > Note that you can define Math itself as logic problems as well.
> 
> Thank you, George, somehow I've missed this. The "Brian's cup of
> tea" is really very powerful, it's great, but it's power costs
> some complexity. I should look at it more attentively, but I don't
> think, I could use it for my students, or at least begin with it.
>

The approach you took is fine and I suspect Brian or others can give
you other suggestions. I did not expect your (on the young side)
students to understand Brians code. It was an FYI for you and others.

> 
> As to Prolog, it's out of our curriculum. I'm just interested in how
> Logo could be implemented there. I agree to the principle -- right
> tool in the right place, but I think, Logo fits this problem well.
>

Just giving you and others background and other areas to explore
in the Computer Science realm. Your message may of sparked an interest
in Logic problems for some (Logo or No Logo) and if such is the case
Prolog is worth a look. And as someone mentioned a while back you can
write a simplified prolog engine in Logo. I believe the prototype
version
of Prolog was done in Lisp (which is what Logo Language is based on).

As a teacher the study of Prolog is also helpful in understanding and
solving Logic problems as well. As you mentioned the solution approach
you chose was to try all possibilities. That's basically what Prolog
does but also allows you to quickly "Prune" down the search area to
speed up the search (called "Cuts"). Cuts are like "make" for Prolog
purists (you try to avoid them if you can).

Also studying other languages sometimes helps you better understand
languages you think you already know :-).

> 
> Regards,
> Olga.
> 
> >
> > Olga Tuzova wrote:
> > >
> > > Hello everybody,
> > >
> > > I'm intruding on your recursion discussion with very different problem.
> > > I haven't seen this kind of problems there, but may be somebody is
> > > interested, or has had an experience in solving them.
> > > The problem is from a "logical field".
> > >
> > > For example let's formulate it as follows.
> > >
> > > Three experts are having discussion about an ancient cup.
> > >
> > > Expert A: This is a China cup from the 5th century,
> > > Expert B: This is a Japan cup from the third century,
> > > Expert C: This is not a China cup, it was made in the 4th century.
> > >
> > > It turned out, only one of two statements of each expert was right, the
> > > other was wrong.
> > >
> > > What country and what century does the cup belong?
> > > ----------------
> > >
> > > I think, the main idea of the solution is standart.
> > >
> > > Le's denote with C the statement "the cup is from China",
> > >             J - "from Japan",
> > >             T - "it was made in the third century",
> > >             F - " in the 4th century",
> > >             V - " in the 5th century".
> > >
> > > We should find such boolean values of C J T F V, which make the
> > > following statements  "true":
> > >     or (and C not V)(and not C V)
> > >     or (and J not T)(and not J T)
> > >     or (and not not C F)(and not C not F)
> > > Also:
> > >     not and T F
> > >     not and T V
> > >     not and F V
> > >     not and C J.
> > >
> > > The solutions that I've seen, all use looking over(?) all the possible
> > > combinations of values of C, J, T, F, V. It doesn't look great. I tried
> > > to present these combination as a binary code (binary representation of
> > > the number from 0 through 31), but not sure it improves the solution
> > > much.
> > > Would be greatful for any ideas and suggestions. Also, does anybody work
> > > on such problems this way or other with the school children?
> > >
> > > The solution presented below, says, that the cup was from Japan and was
> > > made in the 5th century.
> > >
> > > Thanks,
> > > Olga.
> > > ---------------------------------
> > > to logic.main
> > > for [i 0 31][if (and bool1 c :i v :i ~
> > >                      bool1 j :i t :i ~
> > >                      bool2 c :i f :i ~
> > >                      bool3 c :i j :i ~
> > >                      bool3 t :i f :i ~
> > >                      bool3 t :i v :i ~
> > >                      bool3 f :i v :i)~
> > >             [(pr c :i j :i t :i  f :i v :i)]]
> > > end
> > >
> > > to c :i
> > > op int :i/16
> > > end
> > >
> > > to j :i
> > > op remainder int :i/8 2
> > > end
> > >
> > > to t :i
> > > op remainder int :i/4 2
> > > end
> > >
> > > to f :i
> > > op remainder int :i/2 2
> > > end
> > >
> > > to v :i
> > > op remainder :i 2
> > > end
> > >
> > > to bool1 :c :v
> > > output or (and l :c not l :v) (and l :v not l :c)
> > > end
> > >
> > > to bool2 :c :f
> > > output or (and not not l :c l :f)(and not l :c not l :f)
> > > end
> > >
> > > to bool3 :c :j
> > > output not and l :c l :j
> > > end
> > >
> > > to l :a
> > > ifelse :a=1 [op "true][op "false]
> > > end
> > > -------------------------------
> > >
> ---------------------------------------------------------------
> Please post messages to the Logo forum to logo-l@gsn.org.  Mail
> questions about the list administration to logofdn@gsn.org.  To
> unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.

-- 
===============================================================
George Mills
email: mills@softronix.com
http://www.softronix.com
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



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