Prove that in a self-complementing code the sum of the
weights must be 9?
Answers were Sorted based on User's Feedback
Answer / aamod joshi
Lets assume that the weights are w1,w2,w3 and w4.
Assume the first code is X1X2X3X4 and second number is
Y1Y2Y3Y4 where X1X2X3X4 + Y1Y2Y3Y4 = 9. e.g. if the weights
are 2,4,2,1 then 1011 = (1*2)+(0*4)+(1*2)+(1*2) = 5 and
0100 = (0*2)+(1*4)+(0*2)+(0*2)= 4 i.e. 1011+0100=4+5=9.
Putting this in mathematical equation,
(W1X1 + W2X2 + W3X3 + W4X4)
+ (W1Y1 + W2Y2 + W3Y3 + W4y4)
= 9
Which means
W1(X1+Y1) + W2 (X2+Y2) + W3 (X3+Y3) + W4 (X4+Y4) = 9
Now, as X1X2X3X4 and Y1Y2Y3Y4 are self-complementing, at a
time either of X1 and Y1 can be 1, the other will be zero.
Same for X2,Y2 and X3,Y3 and X4,Y4. Which further means
that X1+Y1 = 1, X2+Y2=1, X3+Y3=1, X4+Y4=1.
So,
W1(1) + W2(1) + W3(1) + W4(1) = 9
i.e. W1+W2+W3+W4 = 9 thus it proves that sum of the weights
has to be 9.
Is This Answer Correct ? | 86 Yes | 13 No |
Answer / nobody
In self complementing code, 9's complement in decimal is the
1's complement in binary.
Now, assume a code with weights are W1,W2,W3 and W4.
We want to prove that,
W1 + W2 + W3 + W4 = 9
Let 'N' be a number in decimal.
Let N's binary equivalent in given code be
X1X2X3X4
Lets represent complement of N as COMP(N).
Let COMP(N)'s binary equivalent in given code be
Y1Y2Y3Y4
Therefore,
N = W1(X1) + W2(X2) + W3(X3) + W4(X4) ***************[1]
Now 9's complement of N is
[9's COMP(N)] = 9 - N
[9's COMP(N)] = 9 - [W1(X1) + W2(X2) + W3(X3) + W4(X4)]
***** (from eq.1) *******[2]
Now, COMP(N)'s binary equivalent in given code is Y1Y2Y3Y4.
COMP(N) = W1(Y1) + W2(Y2) + W3(Y3) + W4(Y4)
********************[3]
Now as it is a self complementing code, 9's complement in
decimal is equal to the 1's complement in binary.
Therefore,
[9's COMP(N)] = COMP(N)
From [2] and [3]
9 - [W1(X1) + W2(X2) + W3(X3) + W4(X4)] = W1(Y1) + W2(Y2) +
W3(Y3) + W4(Y4)
[W1(X1) + W2(X2) + W3(X3) + W4(X4)] + [W1(Y1) + W2(Y2) +
W3(Y3) + W4(Y4)] = 9
W1(X1+Y1) + W2(X2+Y2) + W3(X3+Y3) + W4(X4+Y4) = 9
****************************[4]
Now, as (X1,Y1) (X2,Y2), (X3,Y3), (X4,Y4) are complements of
each other, their sums will always be 1.
i.e
(X1 + Y1) = (X2 + Y2) = (X3 + Y3) = (X4 + Y4) = 1.
Putting this in eq. [4], we get,
W1(1) + W2(1) + W3(1) + W4(1) = 9
i.e
W1 + W2 + W3 + W4 = 9
Is This Answer Correct ? | 27 Yes | 4 No |
Answer / vivek
I really dint understand this question or the answer. can u
please tell me which subject is this question related to ??
Is This Answer Correct ? | 9 Yes | 9 No |
Answer / poojitha
In general 2421,5211,642-3,84-2-1 and excess-3 codes are satisfies the condition of self complementing code.All the above codes gives sum as 9 as shown below:
2+4+2+1=9
5+2+1+1=9
6+4+2-3=9
8+4-2-1=9
so,in the self complementing code sum of all weights is always 9.
Is This Answer Correct ? | 6 Yes | 6 No |
Answer / munjal
if I am talking about 8421 code , then the sum must be 15 ,,
the question is limited to only 2421 code......
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / ankit agrawal
the sum of the number and its complements should be 9999
Is This Answer Correct ? | 10 Yes | 34 No |
can any give an exact example about, resolving the sql errorcode -305
How we can find out face expression ,what approach should be followed (like skin detection) ?
What is IPSec?
7)8 mark X Y Z X Y Z + A B - A B -------- --------- C D E F B G A find X,Y,Z,G (8marks)
What are the frequently asked technical engineer ques?
Briefly describe your ideal job?
what size shaft is required to transmit 100 hp @1000 RPM ,if max shear stress is 10,000 PSI,angle of twist must be less than 1' /ft/shaft is made of steel.
what are the artifacts in coding phase in SDLC????
objective type quistion
2 ships are wardroom light house one side at 30 degree and other ship other side at 45 degree. If light house has 100 m, find distance of boat from light house. and also find distance of each boat from light house
what are the various login options used in loadrunner tool to make a application performance testing
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 how to print this using while statement??