random number generator

Hi,

using the java built-in random number generator, I generated from an original dataset 100 pseudo-datasets of the same size of my original dataset

How likely it is that the pseudo-datasets are similar/ the same?

(original dataset contains data for 600 cases, each case have data associted with, so I generated 100 datasets from my original dataset, each one contain 600 cases. are the 100 generated datasets expected to be similar in composition?)

i would really appreciate your help

thanks

[530 byte] By [sali_dia] at [2007-10-3 11:48:45]
# 1

Without seeing your code and what you mean by "datasets" and "similar or the same," it's impossible to say for sure.

Try this though:

import java.util.Random;

public class Rand {

public static void main(String[] args) throws Exception {

System.out.println("Test1:");

for (int ix = 0; ix < 20; ix++){

Random rand1 = new Random();

System.out.print(rand1.nextInt(100) + " ");

}

System.out.println();

System.out.println();

System.out.println("Test2:");

Random rand2 = new Random();

for (int ix = 0; ix < 20; ix++){

System.out.print(rand2.nextInt(100) + " ");

}

}

}

If you're on 1.5, you should see okay behavior in both cases. For <= 1.4 however, you might not like what happens in Test 1.

jverda at 2007-7-15 14:22:03 > top of Java-index,Other Topics,Algorithms...