You could probably use a table lookup (using 1D texture, or in DX10 maybe a constant buffer). Say you create a 100x1 RGBA texture, fill the first 60 pixels with (1.0,0,0,0), the next 40 with (0,0,0,1.0). Since your random function gives you a number in [0..1] you can use that as the 's'...