Possible Duplicate:
Biased Random Number Generator
for once I need a random number generator with at least two numbers that have higher probabality than the others.
i.e for example: random 1->10 in a sequence of 1000. Numbers A=3 and B=7.
A - should repeat approx. at least 20% of the time. B - should repeat approx. at least 30% of the time.
That should cover at least 50% of the 1000 sequence. Also the insertion of A and B should be somewhat probable/random in themselves. Not just add A and B every Nth step. Total/exact control isn't needed.
Any Ideas?
I'm a noob - c++ style code would be greatly appreciated!