# Weighted randomness

**URL:** <https://community.thunkable.com/t/weighted-randomness/869597>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [October 3, 2020, 2:23am UTC](https://community.thunkable.com/t/weighted-randomness/869597 "2020-10-03T02:23:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaneFungus](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sanefungus/32/66893_2.png) [@SaneFungus](https://community.thunkable.com/u/SaneFungus)\
**Post date:** [October 3, 2020, 2:23am UTC](https://community.thunkable.com/t/weighted-randomness/869597/1 "2020-10-03T02:23:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [October 3, 2020, 2:29am UTC](https://community.thunkable.com/t/weighted-randomness/869597/2 "2020-10-03T02:29:24Z")

</div>

It is possible. This code will make the job done  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/e/7e9d0a66d966adcef691185abbf7de7fdb0a20a5.png)  
-Roumak

---

<div class="post-metadata">

**Author:** ![SaneFungus](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sanefungus/32/66893_2.png) [@SaneFungus](https://community.thunkable.com/u/SaneFungus)\
**Post date:** [October 3, 2020, 3:51pm UTC](https://community.thunkable.com/t/weighted-randomness/869597/3 "2020-10-03T15:51:19Z")

</div>

Thank you very much Roumak!

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

Best regards!

---

<div class="post-metadata">

**Author:** ![devanathravi255s](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@devanathravi255s](https://community.thunkable.com/u/devanathravi255s)\
**Post date:** [September 28, 2021, 2:56pm UTC](https://community.thunkable.com/t/weighted-randomness/869597/4 "2021-09-28T14:56:59Z")

</div>

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](mailto:devanathravi25@gmail.com)  
i am waiting for your kind reply  
gratitude…

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [September 28, 2021, 3:15pm UTC](https://community.thunkable.com/t/weighted-randomness/869597/5 "2021-09-28T15:15:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:23pm UTC](https://community.thunkable.com/t/weighted-randomness/869597/6 "2024-11-08T12:23:36Z")

</div>


