[Verba] Meeting summary
Stuart D. Gathman
stuart at gathman.org
Thu Mar 2 00:08:40 EST 2006
Rebecca and Jillian worked some more on the robots game in python.
(Attached.) You can now move around a black dot on the screen with the
keyboard! While considering edge mappings, we very briefly discussed
"topology" - the properties of shape that are invariant under stretching.
The wrap around edge mapping we chose is topologically a torus (donut
shape). We will have to investigate that more, because it is closely
related to - you guessed it - group theory.
Speaking of which, I mentioned using group theory to chose a spouse. :-)
(Disclaimer - the assumptions in this model are vastly over simplified and
are for instructional purposed only. In particular, I would question the
assumption that candidates can be rank ordered. And, of course, the goal
of the "courtship" movement is by careful preparation to have only one
proposal which you accept.)
It works like this (taken from "The Equation that Couldn't be Solved"):
Assume you will get 4 marriage proposals, and that if you could consider
all the proposals at once, you could rank them from worst to best.
However, you get only one proposal at a time in random order. And you
must accept or reject each in turn. Your strategy is to reject k - 1
proposals, then accept the first proposal that is better than any previous
proposal. What is the optimal value of k?
There are 24 permutations of the rank order in which your proposals may
come:
1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2413, 2431,
3124, 3142, 3214, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321
For k == 1, you accept the first proposal. 6 of the 24 permutations have
the best proposal come first. So your chances are 6/24 or 1 in 4 of getting
the best match.
For k == 2, you get the best match for cases 1423, 1432, 2143, 2413, 2431,
3124, 3142, 3214, 3241, 3412, 3421. That makes your chances of getting the
best 11/24.
For k == 3, your chances are 10/24. For k == 4, you are back down to 6/24.
So, for 4 expected proposals, the optimum strategy is to turn down the first,
then accept the first that is better than any previous proposal.
For 5 to 8 expected proposals, the k == 3 is optimum (turn down the first 2,
the accept the first that is better than any previous).
For a large number, 'n', of proposals, k == 1 / e is optimum.
--
Stuart D. Gathman <stuart at bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
-------------- next part --------------
from livewires import *
def place_player():
global player_x,player_y
player_x = random_between(0,63)
player_y = random_between(0,47)
return circle(player_x*10+5, 10*player_y+5, 5, filled=True)
def move_by(x,y):
global player_x,player_y
player_x += x
if player_x < 0: player_x = 63
if player_x > 63: player_x = 0
player_y += y
if player_y < 0: player_y = 47
if player_y > 47: player_y = 0
move_to (player, player_x * 10 + 5, player_y * 10 + 5)
def move_player(k):
if k == "1":
move_by(-1,-1)
if k == '2':
move_by(0,-1)
if k == '3':
move_by(1,-1)
if k == '4':
move_by(-1,0)
if k == '5':
move_by(0,0)
if k == '6':
move_by(1,0)
if k == '7':
move_by(-1,1)
if k == '8':
move_by(0,1)
if k == '9':
move_by(1,1)
if k == 'q':
finished = True
#teleport()
begin_graphics()
allow_moveables()
player = place_player()
finished = False
while not finished:
for k in keys_pressed():
move_player(k)
sleep(0.25)
end_graphics()
More information about the Verba
mailing list