February 17th, 2005

Skeleton T 1

Percentage-based outcomes

I'm in need of a program that will take a number as input and use said input to determine the percentage of time it will return true. Just off the top of my head, without looking at google or even the PHP manual, I'm thinking something simple like generating a random number from 1-100 and subtracting the input number from it. The result would then be tested to if it is equal to or less than 0, at which point it would return false - else, it would return true.

Of course, I already see an obvious problem: if looking for say a 99% chance of success, and the random number is anything less than 99 the function would return false and would actually have only a 2% chance of returning true.

Any thoughts a good way to accomplish this?
  • z_lord

First post(php not working)

alright first post, mysql ver 4.1 installed, running off of a winxppro operating system.

I have phpmyadmin-2.6.0-pl1 on my home computer, and whenever I try to logon as root using the password I specified it says "Error
#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client"