If I generate a number from 1 to 100, there is an equal chance to hit any number, but how do I get an exact % chance
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am creating a game, and I feel like I am going about the random generation of a number wrong. I have a set plan that the user has a 5% chance to win prize A, and a 10% chance to win prize B. 40% to win prize C, exc.
With that said, a random number is generated from 1-100 that lets me know what prize the person will be winning before they even know. An example would be, if the random number generated was 14. My logic tells me there was a 1/100 chance of hitting 14 just like there is a 1/100 chance of generating any number between 1-100.
What I would like to do is be able to have a realistic 5% chance of winning something, and a realistic %10 chance of winning something, and a realistic %40 chance of winning something without it feeling like really, every chance is 1% chance.
random percentages
add a comment |Â
up vote
0
down vote
favorite
I am creating a game, and I feel like I am going about the random generation of a number wrong. I have a set plan that the user has a 5% chance to win prize A, and a 10% chance to win prize B. 40% to win prize C, exc.
With that said, a random number is generated from 1-100 that lets me know what prize the person will be winning before they even know. An example would be, if the random number generated was 14. My logic tells me there was a 1/100 chance of hitting 14 just like there is a 1/100 chance of generating any number between 1-100.
What I would like to do is be able to have a realistic 5% chance of winning something, and a realistic %10 chance of winning something, and a realistic %40 chance of winning something without it feeling like really, every chance is 1% chance.
random percentages
What makes you think the answer is not obvious?
â Christian Blatter
Sep 8 at 12:38
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am creating a game, and I feel like I am going about the random generation of a number wrong. I have a set plan that the user has a 5% chance to win prize A, and a 10% chance to win prize B. 40% to win prize C, exc.
With that said, a random number is generated from 1-100 that lets me know what prize the person will be winning before they even know. An example would be, if the random number generated was 14. My logic tells me there was a 1/100 chance of hitting 14 just like there is a 1/100 chance of generating any number between 1-100.
What I would like to do is be able to have a realistic 5% chance of winning something, and a realistic %10 chance of winning something, and a realistic %40 chance of winning something without it feeling like really, every chance is 1% chance.
random percentages
I am creating a game, and I feel like I am going about the random generation of a number wrong. I have a set plan that the user has a 5% chance to win prize A, and a 10% chance to win prize B. 40% to win prize C, exc.
With that said, a random number is generated from 1-100 that lets me know what prize the person will be winning before they even know. An example would be, if the random number generated was 14. My logic tells me there was a 1/100 chance of hitting 14 just like there is a 1/100 chance of generating any number between 1-100.
What I would like to do is be able to have a realistic 5% chance of winning something, and a realistic %10 chance of winning something, and a realistic %40 chance of winning something without it feeling like really, every chance is 1% chance.
random percentages
random percentages
asked Sep 8 at 12:21
Ugleh
1034
1034
What makes you think the answer is not obvious?
â Christian Blatter
Sep 8 at 12:38
add a comment |Â
What makes you think the answer is not obvious?
â Christian Blatter
Sep 8 at 12:38
What makes you think the answer is not obvious?
â Christian Blatter
Sep 8 at 12:38
What makes you think the answer is not obvious?
â Christian Blatter
Sep 8 at 12:38
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
You can just used buckets. If you generate a 1, 2, 3, 4, or 5 they get prize A. If you generate a 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15 they get prize B. Etc.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
You can just used buckets. If you generate a 1, 2, 3, 4, or 5 they get prize A. If you generate a 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15 they get prize B. Etc.
add a comment |Â
up vote
2
down vote
You can just used buckets. If you generate a 1, 2, 3, 4, or 5 they get prize A. If you generate a 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15 they get prize B. Etc.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You can just used buckets. If you generate a 1, 2, 3, 4, or 5 they get prize A. If you generate a 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15 they get prize B. Etc.
You can just used buckets. If you generate a 1, 2, 3, 4, or 5 they get prize A. If you generate a 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15 they get prize B. Etc.
answered Sep 8 at 12:24
Stella Biderman
26.2k63175
26.2k63175
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2909569%2fif-i-generate-a-number-from-1-to-100-there-is-an-equal-chance-to-hit-any-number%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What makes you think the answer is not obvious?
â Christian Blatter
Sep 8 at 12:38