[Edu-sig] Topics for CS2

Scott David Daniels Scott.Daniels at Acm.Org
Fri Jan 23 01:01:37 CET 2009


David MacQuigg wrote:
> I've added a few more topics to http://ece.arizona.edu/~edatools/CS2/P4SE.txt, including Black Hole, and Wave-Particle Paradox.  Any physicists on the list?  I'll do the programming if you can advise me on the physics.
> 
> H Bomb - start with a bowling ball of LiDT.  Squeeze til it goes boom.  How much compression is needed?  Try smaller balls.
>     
> Black Hole - start with a bowling ball of neutrons.  Squeeze til it collapses.  How big is the black hole (the radius at which photons get sucked in)?
>     
> Wave-Particle Paradox - two detectors with equal probability of detecting any particle from a specific source.  Prior to detection, the particle exists only as a wave function with equal intensity at both detectors.  When the particle appears at detector A, how does detector B know instantly not to detect the same particle?
>    Model the problem with two slits generating an interference pattern on a screen.  Slow the simulation down until you can observe individual particles.  Make sure you delete the wave, once its particle has been detected.  That avoids the wave-particle problem, at least in the virtual reality of your simulation.
>    Could the universe be a computer, and all we see of it is a virtual reality?  The gods who wrote the program had everything worked out except the problem of what happens to the wave after it turns into a particle.  So they just added an instruction to delete the wave.  That seems to me more plausible than an infinite number of parallel universes, or the crazy story about Schrodinger's cat being nothing but a wave function that decides if it is dead or alive only when the box is opened.  What about the guy opening the box?  Is he also a wave function, waiting for someone to open the door to the lab?
> 
> -- Dave
> 
> 
> At 04:09 PM 1/15/2009 -0700, David MacQuigg wrote:
>> I'm putting together a list of topics for a proposed course entitled "Programming for Scientists and Engineers".  See the link to CS2 under http://ece.arizona.edu/~edatools/index_classes.htm.  This is intended as a follow-on to an introductory course in either Java or C, so the students will have some exposure to programming, but the Java students won't know machine-level programming, and the C students won't have any OOP.  For the proposed course, we will use the example programs as a way to introduce these topics.
>>
>> As you can see from the very few links to completed examples, this is just a start.  Many of the links are only to discussions on this list, and I really appreciate the suggestions I have received so far.  Also, it is far from a representative survey or optimum sample, rather just a random sample of topics that I found interesting.  Some of the topics may be out of reach for students at this level, but that is the challenge.  Figure out a way to present a complex or theoretically difficult topic in a way that is simple and intuitive and will whet the students appetite for further study.
>>
>> Additional suggestions are welcome.
>>
>> -- Dave 

In PythonOOP.doc (page 4) you say:

 > There are two pieces of "magic" that make line 3 work.  First, the
 > interpreter has to find the method set_vars.  It's not in cat2.  Then,
 > the instance cat2 has to be inserted as the first argument to et_vars.
 > The method is found by a search starting at cat2 ( the instance on
 > which the method is called ).  The search then proceeds to the parent
 > class, then to the grandparent, and so on up to object, the ancestor
 > of all Animal classes.  In this case, we find set_vars in Cat.

For instances of subclasses of object (such as Cat), method lookups
start in Cat, not cat2.  If you try to set cat2.set_vars, you cannot
(because a method is a property stored in he class), and you will try
the set method of that property which will fail.  Simple class variables
are over-ridden by assignments to the instance values, but properties
are not.

--Scott David Daniels
Scott.Daniels at Acm.Org

the property,



More information about the Edu-sig mailing list