#N canvas 0 22 578 440 10; #X msg 73 87 bang; #X text 359 406 updated for Pd version 0.35; #X text 14 11 You can generate weighted random numbers from uniformly distributed ones. If you just want two possible outcomes with a varying probability for each one \, you can do as shown:; #X obj 73 113 random 100; #X obj 72 166 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 139 166 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X floatatom 175 140 3 0 100 0 - - -; #X text 220 140 <-- change probablilty; #X obj 73 141 moses 80; #X text 122 85 <-- click to test; #X text 31 211 This outputs a number at left 80% of the time \, otherwise at right \, unless you override the "80" using the number box. You may extend this to more than two possible outcomes \, for instance like this:; #X msg 76 297 bang; #X obj 76 323 random 100; #X obj 75 376 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 165 379 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 125 295 <-- click to test; #X obj 76 351 moses 10; #X obj 166 352 moses 30; #X obj 233 379 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 73 401 10%; #X text 163 402 20%; #X text 235 401 70%; #X connect 0 0 3 0; #X connect 3 0 8 0; #X connect 6 0 8 1; #X connect 8 0 4 0; #X connect 8 1 5 0; #X connect 11 0 12 0; #X connect 12 0 16 0; #X connect 16 0 13 0; #X connect 16 1 17 0; #X connect 17 0 14 0; #X connect 17 1 18 0;