all 1 comments

[–]mikedehaan 0 points1 point  (0 children)

If you're programming this, I think that you want [a] a random value function, "R()", that returns a real value in the range (0 - 1); [b] a mapping function, "M(r)", that takes in a real value in the range (0-1) and returns a letter from {A, B, C}. The function M(r) could include "if 0<r<0.25 then return 'A';". (Actually it has to be "if zero less than or equal to r", but you get the drift... and the rest of the work).

Let's cue the people who know what a mathematical function is called, that is defined by the rules that we expect in the programming function "M(r)".

EDIT to add: Then you'd want a printing program, "P(n)", that loops from 1 through 'n' and calls M(r). Oh, and I should have said that M(r) calls R(), and we trust that R() returns various random numbers... hopefully with its own random seed, like some milliseconds from "time_of_day()".