Skip to main content
Commonmark migration
Source Link

Let's see how good your language of choice is at selective randomness.

Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities:

  • A should have a 1/8 (12.5%) chance to be chosen
  • B should have a 3/8 (37.5%) chance to be chosen
  • C should have a 2/8 (25%) chance to be chosen
  • D should have a 2/8 (25%) chance to be chosen

This is in-line with the following Plinko machine layout:

   ^
  ^ ^
 ^ ^ ^
A B \ /
     ^
    C D

Your answer must make a genuine attempt at respecting the probabilities described. A proper explanation of how probabilities are computed in your answer (and why they respect the specs, disregarding pseudo-randomness and big numbers problems) is sufficient.

##Scoring

Scoring

This is so fewest bytes in each language wins!

Let's see how good your language of choice is at selective randomness.

Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities:

  • A should have a 1/8 (12.5%) chance to be chosen
  • B should have a 3/8 (37.5%) chance to be chosen
  • C should have a 2/8 (25%) chance to be chosen
  • D should have a 2/8 (25%) chance to be chosen

This is in-line with the following Plinko machine layout:

   ^
  ^ ^
 ^ ^ ^
A B \ /
     ^
    C D

Your answer must make a genuine attempt at respecting the probabilities described. A proper explanation of how probabilities are computed in your answer (and why they respect the specs, disregarding pseudo-randomness and big numbers problems) is sufficient.

##Scoring

This is so fewest bytes in each language wins!

Let's see how good your language of choice is at selective randomness.

Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities:

  • A should have a 1/8 (12.5%) chance to be chosen
  • B should have a 3/8 (37.5%) chance to be chosen
  • C should have a 2/8 (25%) chance to be chosen
  • D should have a 2/8 (25%) chance to be chosen

This is in-line with the following Plinko machine layout:

   ^
  ^ ^
 ^ ^ ^
A B \ /
     ^
    C D

Your answer must make a genuine attempt at respecting the probabilities described. A proper explanation of how probabilities are computed in your answer (and why they respect the specs, disregarding pseudo-randomness and big numbers problems) is sufficient.

Scoring

This is so fewest bytes in each language wins!

Tweeted twitter.com/StackCodeGolf/status/887088314276126720
added 4 characters in body
Source Link
Mayube
  • 11.7k
  • 2
  • 48
  • 93

Let's see how good your language of choice is at selective randomness.

Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as inputas input, output one of the characters with the following probabilities:

  • A should have a 1/8 (12.5%) chance to be chosen
  • B should have a 3/8 (37.5%) chance to be chosen
  • C should have a 2/8 (25%) chance to be chosen
  • D should have a 2/8 (25%) chance to be chosen

This is in-line with the following Plinko machine layout:

   ^
  ^ ^
 ^ ^ ^
A B \ /
     ^
    C D

Your answer must make a genuine attempt at respecting the probabilities described. A proper explanation of how probabilities are computed in your answer (and why they respect the specs, disregarding pseudo-randomness and big numbers problems) is sufficient.

##Scoring

This is so fewest bytes in each language wins!

Let's see how good your language of choice is at selective randomness.

Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities:

  • A should have a 1/8 (12.5%) chance to be chosen
  • B should have a 3/8 (37.5%) chance to be chosen
  • C should have a 2/8 (25%) chance to be chosen
  • D should have a 2/8 (25%) chance to be chosen

This is in-line with the following Plinko machine layout:

   ^
  ^ ^
 ^ ^ ^
A B \ /
     ^
    C D

Your answer must make a genuine attempt at respecting the probabilities described. A proper explanation of how probabilities are computed in your answer (and why they respect the specs, disregarding pseudo-randomness and big numbers problems) is sufficient.

##Scoring

This is so fewest bytes in each language wins!

Let's see how good your language of choice is at selective randomness.

Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities:

  • A should have a 1/8 (12.5%) chance to be chosen
  • B should have a 3/8 (37.5%) chance to be chosen
  • C should have a 2/8 (25%) chance to be chosen
  • D should have a 2/8 (25%) chance to be chosen

This is in-line with the following Plinko machine layout:

   ^
  ^ ^
 ^ ^ ^
A B \ /
     ^
    C D

Your answer must make a genuine attempt at respecting the probabilities described. A proper explanation of how probabilities are computed in your answer (and why they respect the specs, disregarding pseudo-randomness and big numbers problems) is sufficient.

##Scoring

This is so fewest bytes in each language wins!

edited tags
Link
Mr. Xcoder
  • 42.5k
  • 9
  • 81
  • 214
Source Link
Mayube
  • 11.7k
  • 2
  • 48
  • 93
Loading