Генерируем случайное число:
int y = 10000; Random rand = new Random(); x = (rand.nextInt() >>> 1) % y;