First, I would like to divide the intergers from 1 to n equally into m groups.
Second, I want to generate random intergers without replacement in each group by Julia.
Third, I would like to combine all the random integers.
For example, n=10000, m=2. Then the julia code would be
using Distributions
n=10000
order1 = sample(1:5000, 5000, replace = false)
order2 = sample(5001:10000, 5000, replace = false)
order=[order1;order2]
For example, n=10000, m=5. Then the julia code would be
using Distributions
n=10000
order1 = sample(1:2000, 2000, replace = false)
order2 = sample(2001:4000, 2000, replace = false)
order3 = sample(4001:6000, 2000, replace = false)
order4 = sample(6001:8000, 2000, replace = false)
order5 = sample(8001:10000, 2000, replace = false)
order=[order1;order2;order3;order4;order5]
I am just wondering if I can improve the julia code above. If m=100. then my code will be extremely long. There must be an eaiser way to do this.