I want to run a function that has 2 different outcomes, but I want each outcome to be truly 50%. I am assuming rand(0,1) is the way to go, but I am curious if that could possibly favor one over the other. What is the best way to get a 50/50 outcome?
Thanks.
EDIT: thanks guys I don't want it to be random though, I want the outcome to be 101010101 not 111001101. Maybe I should just update a data-base with the last value output and then return the opposite?
EDIT2: OK I am sorry my last edit was misleading. I am only calling the function once per user and assigning that value as a cookie to the user. I want each visiting user to receive a 1 or a 0 in the order 1010101.