BrainDen.com - Brain Teasers

# m00li

Members

71

1

4. ## Unique Codes

I still think the correct answer for n digit string is given by = nC0f(n) + n-1C1f(n-1) + n-2C2f(n-2) + n-3C3f(n-3) + ...... + n-[n/2]C[n/2]f(n-[n/2]) putting n = 10, we get F(10) = 3349507; where f(n) = (subfactorial(n+1))/n I wrote a vba code to do the simulation and it confirms the answer too. The values for first few n's are: n F(n) 3 5 4 21 5 106 6 720 7 4547 8 36696 9 332769 10 3349507 Here's the vba code: Dim arrlen As Integer Dim counter As Long Sub randomd() j = 1 position = 1 counter = 0 Dim i_arr As Variant i_arr = Array(1, 3, 7, 4, 10, 6, 8, 2, 9, 5) arrlen = UBound(i_arr) + 1 ReDim Preserve i_arr(1 To arrlen) Call perm(ByVal i_arr, j, ByVal position) Sheet2.Cells(1, arrlen + 1) = counter End Sub Sub perm(ByVal i_arr, ByRef j, ByVal position) For i = position To arrlen temp = i_arr(position) i_arr(position) = i_arr(i) i_arr(i) = temp If position = arrlen Then 'For k = 1 To position: Sheet2.Cells(j, k) = i_arr(k): Next k satisfies = True k = 3 While satisfies And k <= arrlen If i_arr(k) - i_arr(k - 1) = 1 And i_arr(k - 1) - i_arr(k - 2) = 1 And satisfies Then satisfies = False k = k + 1 Wend If satisfies Then counter = counter + 1 j = j + 1 End If Call perm(ByVal i_arr, j, ByVal position + 1) Next i End Sub

6. ## Central Area

awesome problem and solution
7. ## Mutual relations

I proved that if there is a group which does not satisfy your condition, then its population CANNOT be more than 5. Hence, if the population is more than 5 (6,7,8,...) it HAS to satisfy your condition. My proof doesnt state that mutual acquaintances and mutual strangers are the only two possibilities, rather it states that we cannot have a group of more than 5 ever, where the size of both mutual acquaintances and mutual strangers is less than 3.

9. ## Dentist's agree

I think it also depends on what the remaining fifth of dentists think too. e.g. they might think that the BMAD formula is effective on 100% of plaque buildups (case A extreme) or totally ineffective (case B extreme) whether a person has or doesn't have plaque buildup. case A extreme: probability that the person has plaque = P(has plaque) = 10/17 P(effectively treated) = P(BMAD's formula behaves as 4/5 dentists predict)*[P(has gingivitis and is effectively treated) +P(doesnt have gingivitis and is eff. treated)] + P(BMAD's formula behaves as 1/5 dentists predict)*[P(has gingivitis and is effectively treated) +P(doesnt have gingivitis and is eff. treated)] + P(BMAD's formula doesnt behave as any of the dentist's predict)*[P(has gingivitis and is effectively treated) +P(doesnt have gingivitis and is eff. treated)] Another Assumption (the last summand in the above sum is 0) therefore, P(eff. treated)= 0.8(0.5*0.95 + 0.5*0.85) + 0.2(1) = 0.4(1.8) + 0.2 = 92% case B extreme: Under similar assumptions P(eff. treated)= 0.8(0.5*0.95 + 0.5*0.85) + 0.2(0) = 0.4(1.8) + 0.2 = 72%
10. ## Central Area

I second Bonanova's first response.

12. ## Unique Codes

EDIT: the last term for F(n) should read n-[n/2]C[n/2]f(n-[n/2]) where [k] is the max integer <=k

15. ## Two Squares

I couldn't understand the question. every pair of odd squares and every pair of even square should qualify (e.g. 25-9=4*4, or 16-4=4*3)
16. ## Random cuts form a quadrilateral

but then the answer for triangle will be = 1/2. isnt it 1/4?
17. ## two pawns

Really sorry for showing the approach here, but this was my first post immediately after joining and I didnt know I could hide spoilers or how to hide them.
18. ## order of the cards

Very nice indeed! But the poster (or is it poser) has mentioned that " By just examining the order of these numbered five cards, your friend will be able to know the card youve selected." I think we cannot use any other hints but just the order. (e.g. you can increase binary to ternary by handing some cards with your left. So an extra dimension is added by virtue of whether you touched a card with your left hand or right).
19. ## order of the cards

can you please explain how your encoding scheme would work? Suuppose you chose the following cards [generated randomly]: 103 89 86 46 54 74 which card would you keep and how would your friend know the identitiy of the one you kept?

5 + 5! = 125
21. ## two pawns

there are 8 pawns, 2 rooks, 2 knights, 2 bishops, 1 king and 1 queen in white. similarly we have 8,2,2,2,1,1 sets of unique pieces in black. Method 1: A = number of ways of selecting 5 out of the above B = number of ways of selecting 5 such that no pawn is selected C = number of ways of selecting 5 such that only 1 or 0 white pawn is selected then Answer = (A-C)/(A-B) A = coeff of x5 in (1-x9)2(1-x3)6(1+x)4(1-x)-8 = 2540 B = coeff of x5 in (1-x3)6(1+x)4(1-x)-6 = 876 C = coeff of x5 in (1+x)(1-x9)(1-x3)6(1+x)4(1-x)-7=2230 Answer = 310/1664 = 0.186298 Method 2 A = no. of ways of selecting 5 such that 2 or 3 or 4 or 5 white pawns are selected B = no. of ways of selecting 5 C = no. of ways of selecting 5 without any pawns Answer = A/(B-C) B = (all 5 pieces are similar) + (4 similar and 1 different) + (3 sim, 2 sim) + (3 sim,2 different) + (2 sim, 2 sim, 1 diff) + (2 sim, 3 diff) + (5 diff) = (2C1) + (2C1*11C1) + (2C1*7C1) + (2C1*11C2) + (8C2*10) + (8C1*11C3) + (12C5) = 2540 C = (2 sim, 2 sim, 1 diff) + (2 sim, 3 diff) + (5 diff) = (6C2*8C1) + (6C1*9C3) + (10C5) = 876 A = (5 white pawn) + (4 WP, 1 different) + (3 WP, 2 similar pieces) + (3 WP, 2 different) + (2 WP, 2 sim,1 diff) + (2 WP, 3 diff) = 1 + (11C1) + (7C1 + 11C2) + (7C1*10C1) + (11C3) = 310 Answer = 310/1664 = 0.186298
×

• #### Activity

• Riddles
×
• Create New...