Fix bug

Fix bug in optimal trial.m
- correct condition for random perturbation