top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Minimum bits required to locate both kings in chess board ?

+3 votes
601 views

There is a 8 x 8 standard chess board. How many minimum bits one requires to locate both kings in the board at any point of time?

posted Nov 7, 2013 by Pankaj Agarwal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
What is the meaning of a bit here i.e. is it represent a location?
Yes, bits will be used to represent locations.
One solution may be using one byte for each king as 1 byte can address 256 combinations.
So total possible ways are 2*64C2 i.e. 2*64*63/2 = 4032
so answer is 12 bits which can represent app possible ways to locate two kings.

I hope I understood the question.
You got the question and answer both right :).. I was hoping to get smaller number using symmetry or some other means.

2 Answers

+1 vote

So total possible ways are 2*64C2 i.e. 2*64*63/2 = 4032
so answer is 12 bits which can represent app possible ways to locate two kings.

answer Nov 7, 2013 by Salil Agrawal
0 votes

I think 6 bits are enough.

For first King
first three is for row 0-7
Next three for column 0-7

Same for second King.

So total bit required is 12.

answer Nov 8, 2013 by Vikas Upadhyay
Similar Questions
+1 vote

Given an array of denominations and array Count , find minimum number of coins required to form sum S.

for example:

  coins[]={1,2,3};
  count[]={1,1,3};

i.e we have 1 coin of Rs 1 , 1 coin of Rs 2 , 3 coins of Rs 3.

Now if we input S = 6 then output should be 2 with possible combination : 3+3 = 6

+5 votes

Given 2 strings s1, s2 and s1 is equal to s2 if they are lexicographically sorted, Find minimum number of swaps required to transform s1 to s2?

Swap Definition:
Problem 1 : we can transform index i with i+1 where 0<=i< s1.length()-1
Problem 2 : we can transform index i with i+1 where 0<=i< s1.length()-1 and other operation we can swap first character of string with last

example: s1="abc", s2="cba"
In problem1 3 swaps required abc ---> bac ---> bca ---> cba
In problem2 1 swaps required abc ---> cba [swap first and last element]

...