Mathematica:are nonrepeatative random numbers possible?

In summary, Mathematica uses various algorithms to generate random numbers that are truly random and not predictable. It can also generate nonrepeatative random numbers by setting a different seed value each time. The range of numbers generated depends on the data type used, and specific distributions can be specified with built-in functions. Additionally, Mathematica can be used for statistical analysis of random data through its powerful built-in functions.
  • #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
 
Physics news on Phys.org
  • #2
list1=RandomInteger[{1, 7}, 10];
list2=Sort[RandomSample[Range[30],10]];
Transpose[{list1,list2}]
 

1. How does Mathematica generate random numbers?

Mathematica uses a variety of algorithms and methods to generate random numbers, including the Mersenne Twister algorithm and the Ziggurat algorithm. These algorithms ensure that the generated numbers are truly random and not predictable.

2. Can Mathematica generate nonrepeatative random numbers?

Yes, Mathematica has the ability to generate nonrepeatative random numbers. By setting the seed value to a different number each time, the generated numbers will be different and not repeat in a predictable pattern.

3. What is the range of random numbers that Mathematica can generate?

The range of random numbers that Mathematica can generate depends on the data type used. For example, the built-in function RandomInteger can generate random integers within a specific range, while the function RandomReal can generate random real numbers within a specified range.

4. Can Mathematica generate random numbers with specific distributions?

Yes, Mathematica has built-in functions for generating random numbers with specific distributions, such as NormalDistribution, BinomialDistribution, and PoissonDistribution. These functions allow for more control over the type of random numbers generated.

5. Can I use Mathematica for statistical analysis of random data?

Yes, Mathematica has powerful built-in functions for statistical analysis, such as Mean, StandardDeviation, and Histogram. These functions can be used to analyze data generated by Mathematica's random number functions or imported from external sources.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
10
Views
958
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
946
  • Linear and Abstract Algebra
Replies
2
Views
394
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
905
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Replies
1
Views
947
  • General Math
Replies
24
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Back
Top