All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Supreme Red Sox Surmise (Posted on 2014-11-06) Difficulty: 3 of 5
A drawer contains a mixture of red socks and blue socks, at most 2014 in total. It so happens that, when two socks are selected randomly without replacement, there is a probability of precisely 2/3 that both are red or both are blue.

What is the maximum possible number of red socks in the drawer that is consistent with this data?

See The Solution Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 2 of 3 |
From highest to lowest total, each line is the total number of socks, the smaller color count and the larger color count (either could be red or blue):


1350 285 1065
361 76 285
96 20 76
25 5 20
6 1 5

so the maximum number of red socks is 1065 (out of 1350 socks, 285 of them blue).

from 

 For n = 2014 To 3 Step -1
   r = Int(n / 2)
   b = n - r
   Do
     pdiffnum = 2 * r * b
     pdiffden = (n * (n - 1))
     ' p = 1/3 of red then blue or blue then red
     If 3 * pdiffnum = pdiffden Then
       Text1.Text = Text1.Text & n & Str(r) & Str(b) & crlf
       DoEvents
       Exit Do
     ElseIf 3 * pdiffnum < pdiffden Then
       Exit Do
     Else
       r = r - 1: b = b + 1
       If r < 1 Then Exit Do
     End If
   Loop
 Next

  Posted by Charlie on 2014-11-06 11:05:58
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information