- #1
Sarah rob
- 16
- 0
I am trying to create 2 list of random numbers of the same length
The 1st list random list i can do
RandomIntegerRandomInteger[{1, 7}, 10]
to get {6, 5, 4, 7, 2, 1, 5, 5, 2, 6}
the 2nd list however i want 10 numbers from 1-30 that are all different and in order,
what do i need to add to Sort[RandomInteger[{1, 30}, 10]]
at the moment i am getting list such as
{5, 7, 10, 21, 21, 22, 22, 25, 28, 30}
Also is there a way to then join the 2 list so that they appear in a list of pairs
e.g. {{6,5},{5,7},{4,10}}
ive tried to use Table but not having much success
The 1st list random list i can do
RandomIntegerRandomInteger[{1, 7}, 10]
to get {6, 5, 4, 7, 2, 1, 5, 5, 2, 6}
the 2nd list however i want 10 numbers from 1-30 that are all different and in order,
what do i need to add to Sort[RandomInteger[{1, 30}, 10]]
at the moment i am getting list such as
{5, 7, 10, 21, 21, 22, 22, 25, 28, 30}
Also is there a way to then join the 2 list so that they appear in a list of pairs
e.g. {{6,5},{5,7},{4,10}}
ive tried to use Table but not having much success