Output: gates[1] = true if p > 0.5 else gates[1] = false gates[2] = true if n > 0.5 else gates[2] = false