alice in summerland

learning and teaching math in alice

Can I get your number?

Oops I forgot to write a blog post yesterday! Yesterday was the second day of the 2-day teacher workshop, and there was much more free time for the teachers to reacquaint themselves with Alice and experiment with some new worlds. Instead of rehashing all the details, you can see what happened on this page.

One of the teachers I helped was a high school AP history teacher who wanted to make a world that would animate random digit dialing. We easily did the basics of this in about two lines of code, and then added some more fluffy animation to get it to about 8 lines.

PJ been chosen for the second time in the random dialing process.

Today I built off of that concept and made a random digit dialing world that randomly calls a number in the 919 area code in North Carolina and associates that number with a person. There are 10 types of people in this population: aliceLiddells, bobs, randomGuy2s, randomGirl1s, etc., and each of them makes up 10 percent of the true 919 population. Since I’m not going to add 10^7 people to Alice to represent all of the possible 919 numbers, I just use these people. If the player specifies that he wants to choose 100 people from the population, for example, there will obviously be repeats, so I account for this by having each person object say how many of them there are when we choose them. In the image to the left, you’ll see that the first number after the 919- is a 7. I associate the number 7 with the 7th person in my allPeople visual list (the list structure is hidden, but the people are standing on it). Similarly, aliceLiddell is called when that number is a 0, bikeKid1 is called when that number is a 1 (he hasn’t been called yet, so he’s currently invisible), etc. At the end of the sample, each character says how many times they have been chosen, i.e. PJ in the picture has just been called for the second time. The programmer is encouraged to remember that it’s not really that character that has been chosen this many times, but instead all people of PJ’s demographics who he is representing in the population. It would be nice if I could use the bar chart that Liz made in one of her tutorials last year, but I don’t think it’s currently available as a single, glued-together object, so I don’t want to have to deal with all the confusing parts in this program, since it’s meant to be short and concise (teachers in the workshop had commented that tutorials were too long for kids to do and pay attention to in a 45-minute period).

My high school AP Statistics teacher would use his calculator to generate random numbers to choose people in the class to do something, like turn in homework or rearrange seats, and each person was assigned a number that he had to remember. Since the random(1, 20) command on the calculator will obviously repeat itself, he often has to click for a while until he gets all the unique numbers he wants. Similar to the random digit dialing world I’ve made, I want to create a short program for him with 20 (or however many people he has in his class for next year) people objects with his future students’ faces on them and use Alice to speed up this process and make it more fun and visual.

I also started building the tutorial for my random digit dialing program, and I have gotten through the adding objects section which didn’t take very long. The methods are short, so I definitely expect to be done the next time I work on it, which could be Monday or this weekend (I’ll need to make up for next Friday when I’ll be missing work to go home for the fourth of July weekend).

No comments yet»

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: