Sort by

recency

|

20 Discussions

|

  • + 0 comments

    These types of questions are kinda weird to me, you basically don't code.

    # 1/2 + 3/5 - 1/5
    # 1/2 + 2/5
    # 5 + 4 / 10
    # 9/10
    print("9/10")
    
  • + 0 comments
    import fractions
    probM = fractions.Fraction(1,2) #prob of reading M
    probE = fractions.Fraction(3,5) #prob of reading E
    probB = fractions.Fraction(1,5) #prob of reading both
    
    print(probM + probE - probB)
    
  • + 0 comments

    Four possibilities: (1) read morning (2) read evening (3) read both (4) not read both

    Given not reading morning = 1/2 => read morning =1/2 not reading evening = 2/5 => read evening =3/5 read both =1/5

    According to venn diagram: prob read newspaper - prob read both paper =(1/2+3/5-1/5) - 1/5 = 0.7

  • + 0 comments
    p(not reading morn) = 1/2
    i.e p(reading morn) = 1/2
    
    p(not reading even) = 2/5
    i.e p(reading even) = 3/5
    
    P(reading both) = 1/5
    
    p(reading morn or even) = p(reading morn) + p(reading even) - p(reading both)
                            = 1/2 + 3/5 - 1/5
    
  • + 0 comments

    Again a quite misleading question from HR.

    If the question is "read evening only OR read morning only OR reading both" the answer would be: 1/2 + 3/5 - 1/5 = 9/10.

    If the question is "read evening only OR read morning only (but not both!)" the answer would be: 1/2 + 3/5 - 2*1/5 = 7/10.