my dog learned polymorphism*
The moose likes Programming Diversions and the fly likes weird IQ question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "weird IQ question" Watch "weird IQ question" New topic
Author

weird IQ question

Myke Enriq
Ranch Hand

Joined: Feb 13, 2012
Posts: 109
Hi all ,

I figure this is an inteersting (yet weird in my opinion) question:


Ralph likes 25 but not 24; he likes 400 but not 300; he likes 144 but not 145. Which does he like:
a)10
b)50
c)124
d)200
e)1600

Any ideas ?
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3528
    
  15
I would guess Ralph likes numbers with a whole number square root.


Joanne
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11308
    
  16

yup...i pick 'e'.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3

Ryan, much like Ralph, likes 25 but not 24, and he likes 144 but not 145. However, unlike his friend Ralph, Ryan likes 300 but not 400. Which one (and only one) of the following does he like?
a) 37
b) 64
c) 200
d) 1024
e) 65535

(...and why?)
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

This reasoning might be non sense . even though would like to give a try :

here is my Observation :
Lets consider 1 to 10*

Ralphs like:
25 => 2+5 = 7 odd number
144 => 1+4+4 = 9 odd number
300 => 3+0+0 = 3 odd number

Ralph's dislike:
24 => 2+4 = 6 even
145 = > 1+4+5 = 10 even
400 => 4+0+0 = 4 even

Options:
37 => 3+7 = 10 even
64 => 6+4 = 10 even
200 => 2+0+0 = 2 even
1024 => 1+0+2+4 = 7 odd
65535 => 6+5+5+3+5 => 11+8+5 => 19+5 => 2+4 => 6 even

So my guess would be 1024 .




Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3
Given the information presented so far, that seems like a perfectly reasonable explanation, Seetharaman. You even came up with the correct answer (where "correct" is defined as "what I was thinking"), but for a different reason.

We already know that 25, 144, 300 and 1024 are "likable" but 24, 145, 400, 37, 64, 200 and 65535 are "unlikable". However, I'm going to declare that 8889 is likable while 97 unlikable. How can that possibly be?
Anubrato Roy
Greenhorn

Joined: Mar 22, 2010
Posts: 3
My take is that Ryan likes numbers where the difference of sum of the alternate digits is odd.

Here is my logic -

Ryan's likes:
25 => 5 – 2 = 3 Odd
144 => (1+4) – 4 = 1 Odd
300 => (3+0) – 0 = 3 Odd

Ryan's dislikes:
24 => 4 – 2 = 2 Even
145 => (1+5) – 4 = 2 Even
400 => (4+0) – 0 = 4 Even

Also, as already declared,
8889 => (8+9) – (8+8) = 1 Odd
97 => 9 -7 = 2 Even

So given all the above, the available options are:
37 => 7 – 3 = 4 Even
64 => 6 – 4 = 2 Even
200 => (2+0) – 0 = 2 Even
1024 => (4+0) – (1+2) = 1 Odd
65535 => (6+5+5) – (3+5) = 8 Even

That leaves 1024 as the only option
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3
Anubrato Roy wrote:My take is that Ryan likes numbers where the difference of sum of the alternate digits is odd.


I would say that qualifies as "humorously correct". Yes, I do indeed like 1024. Also, the rule you stated will correctly identify numbers I like versus the ones I don't like. However, the statement of the rule is more complicated than the one I had in mind.

If we know that the difference between two numbers is either even or odd, what can we say about the sum of those same numbers?

If two numbers have an even sum, how even numbers did we start with? How many odd?

(Addition is associative and commutative.)

Is there a simpler rule that is equivalent to the "odd difference of sums of alternate digits" one given above?

Anubrato Roy
Greenhorn

Joined: Mar 22, 2010
Posts: 3
Hi Ryan,

It was amusing to realize that I have stated the rule in a complicated manner.
Taking your hint, if the difference of 2 numbers is odd, then one of them is even and the other odd - which implies that their sum is also odd.
That combined with my logic simply means that the sum of all the digits in the number must be odd.

So here is the revised version -
You like numbers where the sum of digits of the numbers is Odd.

That makes me realize that this is almost identical to Seetharaman's logic, except that I stop only at the first pass of summing up the digits; and not summing up the digits of the sum itself.

Regards,
Anubrato
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3
Anubrato Roy wrote:
So here is the revised version -
You like numbers where the sum of digits of the numbers is Odd.


As it turns out, that's correct as well as now being relatively succinct. What I really like about the "likable" numbers is that they have an odd number of odd digits. ...which turns out to be equivalent to liking numbers where the sum of digits is odd.
Anurag Kumar Dubey
Greenhorn

Joined: Sep 10, 2012
Posts: 8


1600 because 25 is the square of 5 ,400 is the square of 20 and 144 is the square of 12.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: weird IQ question