Logically Easy Equation

If known as :
f(1) = 1;
f(3) = 11;
f(5) = 101;
f(16) = 10000; and
f(28) = x;
So what is y if y = (x mod 28) + f((x mod 27)-1) ?


The answer is 22.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Krisna Attayendra
Mar 20, 2014

This problem is about binary equation so f(X) = to change X from base 10 to base 2.. in the question x = f(28). so we change 28 into base 2 and we got 11100. -> f(28) = 11100 = x. so we can get y = (11100 mod 28) + f((x mod 27) - 1) = 12 + f(3-1) = 12 + 10 = the answer -> y = 22

@Krisna Attayendra Can you please explain to me how did you get (11100 mod 28) = 12 & (11100 mod 27) = 3

Syed Pervez - 7 years, 2 months ago

Log in to reply

Just divide 11100 by 28 as you would while doing decimal division and calculate the quotient and remainder. The remainder is the answer for "x mod 28". 11100 / 28 quotient = 396 remainder = 12 Similarly is the case with 11100/27 only this time you have to divide it by 27 to get quotient as 411 and remainder as 3.

gaurav pathak - 7 years, 2 months ago

sorry for late response, but @gaurav pathak true..

Krisna Attayendra - 7 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...