Thursday, September 29, 2011

Pigs Theory

Hello World,
I'm going to start off this b-log with an attempt to discover what this blog will be about. I would just like to say that I will be writing how I speak, so I will not be writing with good grammar. Lets go through a list of things I would be interested in writing about: Programming/CS stuff, Relationships, God relationships, Random interesting things, Sports, Video games. This is the order of things that came to my mind, so I'm sure this says something about my priorities or what I've been thinking about recently. Those sound pretty good to me. I'm not sure I'll pick much of a focus for the entire b-log (b-log is pronounced bee-log), but I will try and pick a topic or two for each posting. About the b-log thing, I'm not sure why I decided to say it like that but I like it and I'll probably be using it from now on, just so you know. Alright so lets decide a topic and move on to something more interesting.... Alright I have one.

Pigs Theory
          So there is this game called "Pass the Pigs", where you roll these two rubber pig figures and the points you get depend on what position they both land in. Its a game of strategy,risk, and chance. Each turn a player can continue to roll and amass points until her or she get a "pig out"(end of turn and you get no points) or decides to end his or her turn and save the points he or she acquired. The game continues this way until one player reaches 100 points or more, then every other player has one more turn to try and beat that high score. The person with the highest score at the end wins. The risk of this games come down to you don't really know how likely any roll is with pig figures. At least with dice its all even, pigs are not even. My family started playing this game a while ago and I kind of got addicted to trying to see how high you can get on one turn. So I've often just sat at a table and rolled pigs over and over again trying to get a high score. But this constant rolling just for a high score seems so wasteful. I could be getting data from these rolls. So I decided to log every roll and turn in a text file. So I could get the average score I got on a turn. Very recently, I was wanting to procrastinate on homework so I found my pigs and decided to log some rolls. Now here is were the programming/CS comes into play. I had the idea that i could simply write a java program to read this text file and with that I could get a lot more out of the numbers and it would be way easier to get. So that's what I did. I programmed for about an hour and there I had a wonderful little statistics finding program. I've added more statistics since that first hour though. Now I have logged over 300 turns. Here is my latest statistics output:
The average turn score is: 31.093093093093092
The average turn length is: 4.678678678678678 rolls
The average roll score is: 6.645699614890886

The highest roll is: 20
The highest total is: 259
The longest turn length is: 39
The percentage that you will pigout on first roll is: 16.816816816816818%

Number of 1's rolled/percentage: 339, 21.00371747211896%
Number of 5's rolled/percentage: 847, 52.478314745972746%
Number of 10's rolled/percentage: 145, 8.983890954151178%
Number of 15's rolled/percentage: 42, 2.6022304832713754%
Number of 20's rolled/percentage: 185, 11.462205700123915%
Number total rolls: 1614.0

Ranges
0-10: 36.63663663663664%
11-20: 13.513513513513514%
21-35: 17.117117117117118%
36-50: 14.414414414414415%
51-75: 7.807807807807808%
76-100: 4.804804804804805%
101+: 5.105105105105105%
Out of 333.0 turns
The most consistent numbers I have found throughout this program have been the Number of *'s rolled part. So from that I can guess that the percentages I have are pretty close to what they really are and can be relied upon when playing the game, the average turn score and average turn length would also be helpful in playing the game, but the rest are more for fun and knowing the numbers of it all. This what I call Pigs Theory. Please look over the numbers more if you want, I didn't talk much about them. I hope this wasn't too boring for most people, but I really enjoy doing things like this. If anyone wants a similar program like this that reads information from a text file for stats I would love to write it for you, so just let me know. I would also love to send you a version of this program if you would like. Someday i would like to have a website where I can direct you to where you can find all my work, someday. I really kinda know how but I just haven't done it. Well Yucheng wants to go to bed and I really need to go to bed, since I wrote this instead of doing homework or sleeping. I'm kinda excited to be writing about something I enjoy so I suspect I will be doing this again sometime soon. So see you then.

No comments:

Post a Comment