Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Let an an-1 ... a1 a0 be the binary represent... Start Learning for Free
Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 if
  • a)
    The number of one’s is divisible by 3
  • b)
    The number of one’s divisible by 3, but bof by 9
  • c)
    The number of zeroes is divisible 3
  • d)
    The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Let an an-1 ... a1 a0 be the binary representation of an integer b. Th...
Binary representation of 12 is 110 D
So, (q0 + q2)-{q1 + q3)
= (0 + 1)- ( 0 + 1) 
= 1 - 1 
= 0
0 is divisible by 3 so, true.
View all questions of this test
Most Upvoted Answer
Let an an-1 ... a1 a0 be the binary representation of an integer b. Th...
The integer b is divisible by 3 if the number of ones in its binary representation is divisible by 3.

In other words, we need to count the number of ones in the binary representation of b and check if this count is divisible by 3.

Let's denote the number of ones in the binary representation of b as k. Then, b = 2^k + a, where a is the binary representation of b without the leftmost bit (an-1).

To check if k is divisible by 3, we can use the property that 2^3 ≡ 1 (mod 3). Therefore, if k ≡ 0 (mod 3), then 2^k ≡ 1 (mod 3), and if k ≡ 1 (mod 3), then 2^k ≡ 2 (mod 3), and if k ≡ 2 (mod 3), then 2^k ≡ 1 (mod 3).

So, we need to compute the remainder when k is divided by 3 and check if the remainder is 0.

If the remainder is 0, then the number of ones in the binary representation of b is divisible by 3, and therefore, b is divisible by 3.

If the remainder is not 0, then the number of ones in the binary representation of b is not divisible by 3, and therefore, b is not divisible by 3.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer?
Question Description
Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer?.
Solutions for Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Let an an-1 ... a1 a0 be the binary representation of an integer b. The integer b is divisible by 3 ifa)The number of one’s is divisible by 3b)The number of one’s divisible by 3, but bof by 9c)The number of zeroes is divisible 3d)The difference of alternate sum, i.e., (a0,+a2+...) - a1+a3+...) is divided by 3Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev