Use the If command in Mathematica: If[condition, output if true, output if false]. Hint, though: Mathematica doesn't understand , so you have to either use nested If statements, or use logical connectives (&&, I think) to get both conditions correct.