Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The odds in favor of event E are \" a : b \" , i.e. \" a to b \" and the probabi

ID: 3776653 • Letter: T

Question

The odds in favor of event E are " a : b " , i.e. " a to b " and the probability of E occurring is the fraction a ÷ ( a + b ) .

            Write pseudo - code that uses a function which accepts two integer arguments and then converts the odds to a probability.

          Use the provided skeletal function definition.

(1) Pseudocode Function to Convert odds to a Probability) The odds in favor of event Enare a b i.e. a to b an the probability of E occurring is the fraction a a b Write pseudo code that uses a function which accepts two integer arguments and then converts the odds to a probability. Use provided skeletal function definition. Function OddsToProbability integer a integer b) End Function

Explanation / Answer

odds in favour

   P(A) =    Number of favorable outcomes / Number of unfavorable outcomes

Probability of the event= Number of favorable outcomes / Number of favorable outcomes + Number of unfavorable outcomes

pseudo code:

Function oddstoprobability(integer a,integer b)

float probability=a/(a+b);

return probability;

end function

NOTE:if you specify the programming language i will write the appropriate code for your language,but u said pseudo code so i'm sending u this,feel free to comment.thank you

as you said the function in c++ willbe

float oddtoprobability(int a,int b)

{

float prob;

prob=a/(a+b);

return prob;

}