thanks to Hongkun Yang's help, I have fixed the java bug, which is because you need to initialize the Random object outside the binaryDraw method