wu :: forums
« wu :: forums - Probabilities... »

Welcome, Guest. Please Login or Register.
Apr 25th, 2024, 8:03pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   easy
(Moderators: Icarus, william wu, Grimbal, Eigenray, SMQ, towr, ThudnBlunder)
   Probabilities...
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Probabilities...  (Read 664 times)
hendrik
Newbie
*





   


Posts: 9
Probabilities...  
« on: May 4th, 2009, 7:44am »
Quote Quote Modify Modify

Hello there,
 
I have a mathematics(actually computer programming task)..
 
Here is the problem..
 
I have N apples and M oranges. These fruits(N apples and M oranges) are in a box.. Outside this box there are infinite number of apples and oranges. So you must subsequently take 2 fruits from this box.
Criteria:
1. If you get 2 apples you must put 1 apple from outside (inf number of fruits) to this box
2. If you get 2 oranges you must put 1 apple to this box
3. If you get 1 orange and 1 apple you must put 1 orange to this box.
 
So the task is to find largest probabilities of the last fruits.
 
Let say Apples=1 and Oranges=1
The output should be: Orange
 
Because once you pick..you will certainly get 1 Apple and 1 Orange. This means you should put 1 Orange to this box.
Box now : 1 Orange 0 Apple
Means Orange is the last ball so Output Orange..
 
Thx for helping..  Grin
« Last Edit: May 4th, 2009, 7:47am by hendrik » IP Logged
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2084
Re: Probabilities...  
« Reply #1 on: May 4th, 2009, 8:16am »
Quote Quote Modify Modify

Hint 1: there is no probability involved: the outcome is a certainty.
 
Hint 2: what is the net effect of each possible selection?
 
Hint 3: how many oranges are in the box?
 
Answer: no outcome can change the parity (odd/even) of the number of oranges in the box.
  - If you pull two apples and put one apple back you've not changed the number of oranges.
  - If you pull an apple and an orange and put an orange back you've not changed the number of oranges.
  - If you pull two oranges and put an apple back you've reduced the number of oranges by two.
  So if you start with an even number of oranges the last fruit in the box will always be an apple.  Likewise if you start with an odd number of oranges the last fruit in the box will always be an orange.

 
--SMQ
IP Logged

--SMQ

hendrik
Newbie
*





   


Posts: 9
Re: Probabilities...  
« Reply #2 on: May 4th, 2009, 9:44am »
Quote Quote Modify Modify

wow great analysis...
Thx a lot... Grin
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board