Weighted randomness

Hi guys,
I was searching on the forum, but could not find a solution…
I need help with such a thing:
Let’s assume that we have three items on the list, and we want to draw them, so that each of them has a different probability of being drawn.
1 item = 60%
2 item = 30%
3 item = 10%
Is it possible to program this probability?
kind regards
SaneFungus

It is possible. This code will make the job done
image
-Roumak

2 Likes

Thank you very much Roumak!

This is exactly what I meant :grinning:
I am glad that this problem can be solved in such a simple and elegant way!

Best regards!

hlo roumak-coder
i have understood this coding a bit not totally
can u do this coding without using viarables
u can use a,b,c…z
and can u send the photo of the design and blocks
if u can , u do a video of it and send it to my mail id : devanathravi25@gmail.com
i am waiting for your kind reply
gratitude…

This topic is a year old so I don’t know if you’re going to get an answer from @roumak-coder (it helps to notify a user this way). But typically when something is done using variables, it’s either because it requires variables or because it’s so much easier/quicker with variables. Since you have the blocks in the screenshot above, why not try them and then ask specific questions if you still need help?

1 Like