# Weight RandomSample with multiple lists

**URL:** <https://community.wolfram.com/t/weight-randomsample-with-multiple-lists/5249>\
**Category:** Questions\
**Tags:** mathematica, statistics-and-probability\
**Created:** [March 26, 2015, 9:23pm UTC](https://community.wolfram.com/t/weight-randomsample-with-multiple-lists/5249 "2015-03-26T21:23:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juswalsh](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@juswalsh](https://community.wolfram.com/u/juswalsh)\
**Post date:** [March 26, 2015, 9:23pm UTC](https://community.wolfram.com/t/weight-randomsample-with-multiple-lists/5249/1 "2015-03-26T21:23:58Z")

</div>

RandomSample[{0.5,0.5}-\>{2,4},1]

commands Mathematica to select either 2 or 4 with a 50:50 chance of either number. How can I use this if I have multiple lists, like this:

```
RandomSample[{{0.5,0.5},{0.4,0.6}}->{{2,4},{3,5}},1] except this command returns an error

```

I don’t want to combine the lists because I want to select one number from each list with separate probabilities.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![karstenpotrick1](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/karstenpotrick1/32/41421_2.png) [@karstenpotrick1](https://community.wolfram.com/u/karstenpotrick1)\
**Post date:** [March 27, 2015, 3:22pm UTC](https://community.wolfram.com/t/weight-randomsample-with-multiple-lists/5249/2 "2015-03-27T15:22:00Z")

</div>

Probably

```
RandomSample[{0.5, 0.5} -> {2, 4}, 1]~Join~RandomSample[{0.4, 0.6} -> {3, 5}, 1]

```

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [March 27, 2015, 6:35pm UTC](https://community.wolfram.com/t/weight-randomsample-with-multiple-lists/5249/3 "2015-03-27T18:35:07Z")

</div>

Could use `MapThread`.

```
MapThread[
 RandomSample[Rule[##], 1] &, {{{0.5, 0.5}, {0.4, 0.6}}, {{2, 4}, {3, 5}}}]

```
