more card play

13 messages
Open this post in threaded view
|

more card play

Open this post in threaded view
|

Re: more card play

Open this post in threaded view
|

Re: more card play

 In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >Cards: You are right on the merits for combinatory math, but you will >run into strong cultural aversions. Why?  Especially when _dice_ seem to be the preferred way to teach this stuff?  (Or is this only here?) Laura _______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

 In reply to this post by Mokurai On Mon, Nov 2, 2009 at 8:27 PM, Edward Cherlin wrote: Cards: You are right on the merits for combinatory math, but you will run into strong cultural aversions. Yes, anticipated.  However, the Python subculture has done the necessary work to publish a Diversity Statement, which has an antibiotic effect against puritanical bigots (assuming you mean some people have moral hangups about gambling?).  The State of Oregon funds its education system with inputs from video poker machines whereas the various tribal sovereignties in this area earn a living from their resort casinos.  So it's integral to our way of life to teach "casino math" (we don't necessarily call it "combinatorics" at first, as that just scares people away, makes 'em think we're only into academic applications whereas of course nothing could be further from the truth).   Reverse string in place with new iterator: There is a great deal more of this. In the 1980s Hewlett-Packard built an APL system around suchYes, the idea of an iterable goes hand-in-hand with the Pythonic notion of a generator.  Both support the "next" API, a keyword you might assign another name to if you like.  I've recommended "kick" as in "kick the can down the road", with each use generating a next term in some famous (or not famous) sequence: >>> def cubocta():    n = 0    while True:  # infinite loop OK!        if n == 0:            yield 1        else:            yield 10 * n * n + 2        n += 1        >>> kick = next >>> can = cubocta()>>> kick(can)1>>> kick(can)12>>> kick(can)42>>> kick(can)92>>> kick(can)162>>> See:  http://www.research.att.com/~njas/sequences/A005901 (note link to virus morphology) In the example below, I'm showing how "nexting" through an iterable is a lazy evaluation affair in that I'm changing the first member of the list *after* assigning a name to the iterator.  By the time the iterator reaches the first member of the list, the value has changed from when it started. >>> some_list = [1,2,3,4,5]>>> iterable = reversed(some_list)>>> next(iterable)5>>> some_list[0] = "Joker!">>> next(iterable)4>>> next(iterable) 3>>> next(iterable)2>>> next(iterable)'Joker!'Notice that two iterators have their separate journeys through the target object i.e. advancing one of them doesn't have any affect on the other: >>> some_list = [1,2,3,4,5]>>> iterableA = reversed(some_list)>>> iterableB = reversed(some_list)>>> next(iterableA)5>>> next(iterableA)4>>> next(iterableA) 3>>> next(iterableA)2>>> next(iterableA)1>>> some_list[0] = "Joker!">>> next(iterableB)5>>> next(iterableB)4>>> next(iterableB) 3>>> next(iterableB)2>>> next(iterableB)'Joker!'>>> Of course strings are immutable so you can't play quite the same trick, of messing with the target string before the reversed iterator reaches the beginning. In the case of my Deck and Card classes, the cloned deck had its own complete list in reversed order (an option), however the underlying Card objects were identical across lists, as I was showing by using the "is" operator.   transformations in place and lazy evaluation rules, including matrix/table transpose, take, drop, catenate, laminate, and a number of other transformations and combinations. I can probably dig out Harry Saal's paper on the subject. Indeed, that and several others. http://portal.acm.org/citation.cfm?id=801218&dl=GUIDE&coll=GUIDE&CFID=59626041&CFTOKEN=28525913 An APL compiler for the UNIX timesharing system http://portal.acm.org/citation.cfm?id=586034&dl=GUIDE&coll=GUIDE&CFID=59626133&CFTOKEN=77609109 Considerations in the design of a compiler for APL http://portal.acm.org/citation.cfm?id=804441 A software high performance APL interpreter I've always thought Python had a lot in common with APL, especially in terms of how it organizes a lot of highly orthogonal built-in primitives to inter-operate in logically consistent ways.  I was privileged to collaborate a little with Kenneth Iverson on my 'Jiving in J' paper.  To this day, I recommend J as a second language, as I think a competent CS0/CS1 would never feature just a single programming language (too narrowing), even if it makes one primary and the other secondary.  A more traditional option is to feature one agile and one system language, e.g. Python and C, or Jython and Java. Kirby4D  On Sun, Nov 1, 2009 at 19:55, kirby urner <[hidden email]> wrote: > I'm becoming more enamored of the idea of using playing cards as a > standard feature in my Python pedagogy and andragogy (means teaching > adults).  Not only do we have the standard deck, but also Tarot which > could get us more into text files, string substitution > (string.Template) and so forth. > > Cards have all the elements... -- Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/ _______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

 On Nov 3, 2009, at 10:04 AM, kirby urner wrote:On Mon, Nov 2, 2009 at 8:27 PM, Edward Cherlin wrote: Cards: You are right on the merits for combinatory math, but you will run into strong cultural aversions. Yes, anticipated.  However, the Python subculture has done the necessary work to publish a Diversity Statement, which has an antibiotic effect against puritanical bigots (assuming you mean some people have moral hangups about gambling?).  I was rather assuming that the hangups would be about the more cringe-worthy aspects of tarot cards.  The fact that people of faith may not get a good feeling about using a tool whose logo is a snake, introductory examples are using tarot cards, and whose theme music might be construed to be the rather irreverent creations of the Monty Python players, says less about the presence of puritanical bigotry and more about a complete lack of sophistication in marketing.I love a good example (and a good joke) as much as the next guy, but let's not lean on a diversity statement as an excuse to not attend to some basic tenets of marketing.  If we had examples that incorporated the various "Stations of the Cross" it would likewise go over like a lead balloon.Introducing Python as a unifying tool in early education (by some definition of early) calls for a particular discretion in the choice of examples.Best,Travis_______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

 In reply to this post by Laura Creighton-2 On Mon, Nov 2, 2009 at 10:20 PM, Laura Creighton <[hidden email]> wrote: > In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>Cards: You are right on the merits for combinatory math, but you will >>run into strong cultural aversions. > > Why?  Especially when _dice_ seem to be the preferred way to teach > this stuff?  (Or is this only here?) > > Laura > Yeah, dice are the perfect math object in that they unify polyhedra and randomness (chaotic sequences) in a single artifact. That we have all the Platonic solids as dice these days is a cool development, suitable for translating into software.[0] from random import choice class Die:         def __init__(self, number_of_sides = 6):             self.facets = number_of_sides         def roll(self):             return choice(range(1, self.facets+ 1))  # eliminate 0         def __str__(self):             return "{0} sided die".format(self.facets)         def __repr__(self):             return "Die({0})".format(self.facets) >>> thedie = Die(20) >>> thedie.roll() 14 >>> thedie.roll() 10 >>> thedie.roll() 7 >>> thedie Die(20) >>> str(thedie) '20 sided die' Here's a more complicated version (not by me) that rolls a sum as triggered by the __rmul__ rib. http://code.activestate.com/recipes/573437/Of course it might make a lot more sense to write this as a two line generator, could then go roll = next to assign the next keyword another name. >>> from random import randint >>> def die(sides):         while True:  yield randint(1, sides)                 >>> icosa_die = die(20) >>> roll = next >>> roll(icosa_die) 10 >>> roll(icosa_die) 18 >>> roll(icosa_die) 8 >>> roll(icosa_die) 4 Speaking of Open Education standards, the Boston Globe is finally getting into print what many have seen as the writing on the wall: mass published wood pulp textbooks are taking a back seat to digital distribution mechanisms.[1] USG stimulus money is helping to fuel the transition, ironically by funding proprietary initiatives versus creating more FOSS of by and for the people. Also ironic is the fact that use US military is a leading proponent of FOSS [2] given its already socialized mindset (i.e. its assets are communally owned and operated).[3] The White House recently switched to Drupal in a symbolic gesture. Kirby [0] http://www.dice.co.uk/poly_re.htm[1] http://mybizmo.blogspot.com/2009/11/not-following-detroit.html[2] http://controlroom.blogspot.com/2009/10/open-source-dot-gov.html[3] http://controlroom.blogspot.com/2009/11/socialist-victory-satire.html_______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

Open this post in threaded view
|

Re: more card play

 In reply to this post by Laura Creighton-2 On Mon, Nov 2, 2009 at 22:20, Laura Creighton <[hidden email]> wrote: > In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>Cards: You are right on the merits for combinatory math, but you will >>run into strong cultural aversions. > > Why?  Especially when _dice_ seem to be the preferred way to teach > this stuff?  (Or is this only here?) I'm including the rest of the world, not just the US. I expect issues to be raised by Evangelical Christians, Muslims and others in various countries. Dice might be easier, because casting lots is mentioned with approval in the Bible. Certainly we can come up with equipment that is not associated with common taboos. > Laura > -- Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/_______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

 In a message of Tue, 03 Nov 2009 18:37:54 PST, Edward Cherlin writes: >On Mon, Nov 2, 2009 at 22:20, Laura Creighton <[hidden email]> wrote: >> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>>Cards: You are right on the merits for combinatory math, but you will >>>run into strong cultural aversions. >> >> Why? Â Especially when _dice_ seem to be the preferred way to teach >> this stuff? Â (Or is this only here?) > >I'm including the rest of the world, not just the US. I expect issues >to be raised by Evangelical Christians, Muslims and others in various >countries. Dice might be easier, because casting lots is mentioned >with approval in the Bible. Certainly we can come up with equipment >that is not associated with common taboos. > >> Laura I wasn't clear, sorry.  Around here (Sweden), when you want to teach probability, you get out the dice.  That's how it is taught, and how all the exercises are set up, etc.  I'm really surprised at the notion that cards would be unacceptable, while dice would be fine. I know some people who would be strongly against both, seeing both as gambling devices, and I know some people who every year are opposed to the dice and who would find cards unobjectionable. I hadn't thought that people who like dice but hate cards exist. Do you know some?  Or are you guessing that they must exist?  And if the latter, why? Do you use something else to teach probability? still puzzled, Laura _______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

 > On Tue, Nov 3, 2009 at 9:44 PM, Laura Creighton <[hidden email]> wrote: > Do you use something else to teach probability? Drawing colored rocks from a bag was one thing I recall, which wikipedia noted as the primary type of drawing lots. I'm still trying to figure out why my chemistry teacher was using Dominos to teach unit conversion... - Dean p.s. Lost Cities is a great card game with a light explorer theme. _______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig
Open this post in threaded view
|

Re: more card play

 In reply to this post by Laura Creighton-2 On Tue, Nov 3, 2009 at 19:44, Laura Creighton <[hidden email]> wrote: > In a message of Tue, 03 Nov 2009 18:37:54 PST, Edward Cherlin writes: >>On Mon, Nov 2, 2009 at 22:20, Laura Creighton <[hidden email]> wrote: >>> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>>>Cards: You are right on the merits for combinatory math, but you will >>>>run into strong cultural aversions. >>> >>> Why?  Especially when _dice_ seem to be the preferred way to teach >>> this stuff?  (Or is this only here?) >> >>I'm including the rest of the world, not just the US. I expect issues >>to be raised by Evangelical Christians, Muslims and others in various >>countries. Dice might be easier, because casting lots is mentioned >>with approval in the Bible. Certainly we can come up with equipment >>that is not associated with common taboos. >> >>> Laura > > I wasn't clear, sorry.  Around here (Sweden), when you want to teach > probability, you get out the dice.  That's how it is taught, and > how all the exercises are set up, etc.  I'm really surprised at > the notion that cards would be unacceptable, while dice would be > fine. > > I know some people who would be strongly against both, seeing both > as gambling devices, and I know some people who every year are > opposed to the dice and who would find cards unobjectionable. > I hadn't thought that people who like dice but hate cards exist. > Do you know some?  Or are you guessing that they must exist? Guessing that they might exist. Certainly there are people who like ordinary cards and dice, but not Tarot. I'm one of them. The cards themselves normally don't bother me, but I have had issues with people who got into the practice. > And > if the latter, why? > > Do you use something else to teach probability? All sorts of things. Coins, Othello pieces, dice (4-30 sides), cards from various decks, dreidls, wheels of fortune, spinners, socks in a bag, colored balls, pseudo-random number generators, random number generators, letter distribution in texts,... > still puzzled, > Laura > -- Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/_______________________________________________ Edu-sig mailing list [hidden email] http://mail.python.org/mailman/listinfo/edu-sig