Sort by

recency

|

28 Discussions

|

  • + 0 comments

    Puzzle #5 was simple at first glance but required careful attention to details—exactly the kind of mental workout that's fun and useful. Looking forward to tomorrow’s! Gold365 Sign Up

  • + 0 comments

    Since the tables are in a circle, there are 10 adjacent pairs of seats that can be chosen, 2 ways to order the particular people in that pair and 8! ways to seat the remaining 8 people. There are 10! ways to seat the people without restrictions.

  • + 0 comments

    Suppose we want person A and person B to sit together. The only way that the 2 people sit together is if person B either sits to either the right or left of person A (& vice versa, considering one situation is enough) Person B has 9 seats to choose but can only sit next to Person A if they choose the 2 seats right next to them so its 2/9

  • + 0 comments

    can someone say what is wrong in this:

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    from fractions import Fraction
    
    table=['r','r']+['b' for i in range(8)]
    table2 = list(table)
    print(table)
    
    count=0
    total=0
    
    for i in table:
        table2 = list(table)    
        table2.remove(i)
        for j in table2:
            table3 = list(table)    
            table3.remove(i)
            table3.remove(j)
            for k in table3:
                draw=i+j+k
                #print(draw)
                if any([m in draw for m in ['rrb','brr']]):
                    print(draw,[m in draw for m in ['rrb','brr']])
                    count+=1
                total+=1
                
    print(Fraction(count, total))
    
  • + 0 comments
    from fractions import Fraction
    from math import comb
    
    print(Fraction(10, comb(10, 2)))