when q <0.5 and q ≥0.5,the equations seem to have been written backwards
when q <0.5 and q ≥0.5,the equations seem to have been written backwards