You cannot choose an "optimal" quantum of time as long as you don't have any information beforehand about
how long each of your processes will run
how many new processes you have to expect within a given time frame
how quick each of your processes has to start / continue / respond
In a real system, you typically don't have those parameters beforehand, since this would mean to predict the future. Therefore, you will have typically have to make assumptions about those parameters, adapt the quantum dynamically to the environment, or choose a different kind of algorithm.