For maximum efficiency, a good rule of thumb in an OR decision is to ____.?
For maximum efficiency in an OR decision, what is a good rule of thumb to follow? Should one first ask the question that is more likely to be true, or the question that is more likely to be false? Alternatively, is it more effective to restructure the decision as an AND decision and ask the question that is more likely to be true or the one that is more likely to be false?
3 Answers
Depends on the language. Many languages use short circuit evaluation so you could pick up some efficiency -- but typically the compiler is smart enough to perform such an optimization for you.
Jan 10, 2025
If you first ask the question that is more likely to be true then you're less likely to even need to ask any more questions.
Eg.
A true 80 percent
B true 50 percent
If you ask B first then there are more times in which you'd need to ask A.
Another,
Let's say you want the value of R where
R = A or B or C or...
most languages evaluate this left to right. If you evaluate A and it's true the R is true regardless of the values of the other variables. In fact, some language don't even evaluate the other variables.
Related Questions
Question 1 (Yes/No Worth 1 point): Another expression for "it is raining" is "Está nublado." (Yes/No) Question 3 (Fill-i...
What does CSS stand for: Cybernet Slash Support or Cybernet Software Systems? I came across a company located in T. Naga...
I need assistance with an Algebra 2 problem. The question states that the variable ( r ) varies directly with ( s ) and...
I hope this message finds you well. I have a few questions regarding Frank Garza’s Jockey School. I want to clarify that...
I'm in 12th grade, and I have my physics board exam tomorrow. How can I effectively cover the entire course material in...
A rescue pilot needs to drop a survival kit while flying at an altitude of 2,000.0 meters with a forward velocity of 100...
Hi everyone, I’m trying to make a decision between enrolling my child in a preschool or a Montessori program. He’s curr...
What is the hybridization of the phosphorus atom in PCl3? Additionally, could you please provide an explanation of the s...
I just got hired for a part-time sales job at Home Depot, and I have my orientation tomorrow. I've never had a job where...
What view in a presentation program allows you to display your slides in full-screen mode?