Probabilities in PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
jefepwnzer
Forum Newbie
Posts: 1
Joined: Thu Oct 09, 2008 3:33 pm

Probabilities in PHP

Post by jefepwnzer »

I'm developing a basic baseball application where I'm going to match a pitcher vs. a hitter and the only answer I want to know is if the result of the matchup is a hit, a walk, a strikeout or a fly out/ground out. Basically I want to take the sum of the pitchers attributes, compare it to the sum of the hitters attributes and establish a probability of a hit, walk, etc occurring.


i.e. in a very basic sense if the sum of the pitchers attributes is 90 and the sum of the hitters attributes is 80 I want to give the hitter a 25% chance of getting a HIT and a 75% chance of making an OUT.

Is this possible with PHP?

I have a few books on PHP but none cover this type of thing.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Probabilities in PHP

Post by onion2k »

It's just maths, so yeah, it's entirely possible with PHP.
Post Reply