Optimal Two and Three Stage Designs for Single-Arm and Two-Arm