We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Artificial Intelligence
- Probability & Statistics - Foundations
- Day 2: Basic Probability Puzzles #3
- Discussions
Day 2: Basic Probability Puzzles #3
Day 2: Basic Probability Puzzles #3
Sort by
recency
|
22 Discussions
|
Please Login in order to post a comment
p1= (4/7) * (5/9) * (4/8)
p2 = (4/7) * (4/9) * (4/8)
p3 = (3/7) * (5/9) * (4/8)
p_total=p1+p2+p3
numerator = 80+64+60 denominator=504
def gcd(a,b): while b !=0: a,b =b, a%b return a
g=gcd(numerator,denominator)
numerator //=g denominator //=g
print(f"{numerator}/{denominator}")
check out the link for solution in python with explanation, https://youtu.be/S8OPaYOUC6s?si=-6XHBgwJUrl_BqL7
from fractions import Fraction temp_X=7 temp_Y=9 temp_Z=8 RED_X,RED_Y,RED_Z=4,5,4 BLACK_X,BLACK_Y,BLACK_Z=3,4,4 P_R_X = RED_X/temp_X P_B_X=BLACK_X/temp_X P_R_Y=RED_Y/temp_Y P_B_Y=BLACK_Y/temp_Y P_B_Z=BLACK_Z/temp_Z P_R_Z=RED_Z/temp_Z P1 = P_R_X * P_R_Y * P_B_Z P2 = P_R_X * P_B_Y * P_R_Z P3 = P_B_X * P_R_Y * P_R_Z
temp = P1+P2+P3 print(Fraction(temp).limit_denominator(), temp)
java
public class Solution{
}