Thursday, 3 March 2016

FUSE NUMBERS

FUSE NUMBERS

Consider X, Y and Z is three variable, To Fuse the three variable into single variable and result does not match to other X, Y and Z combination

Solutions:
X=0:100
Y=0:100
Z=0:100

Normal Fuse method

O=X+Y+Z
This method
Consider X=1, Y=3, Z=3
O=1+3+3= 7
But this result match to
X=1, Y=2, Z=4,
O=1+2+4= 7
(1+3+3)==(1+2+4)
So this not unique for all combination

Another method is binary to decimal converter method

Ex:
0 0 0 = 0
0 0 1 = 1
0 1 0 = 2
0 1 1 = 3
1 1 0 = 4
1 0 1 = 5
1 1 0 = 6
1 1 1 = 7

How is it working?
Three combination X, Y, Z
Max binary counts =2 (0 or 1)
So,
O = 2^2*X + 2^1*Y + 2^0*Z
Finally integer fusion
O = M^2*X+M^1*Y+M^0*Z
Where M is a max number of (X, Y and Z) +1
Here M= 100+1
So, Output is
O = 101^2*X+101^1*Y+101^0*Z

Implemented by MATLAB Program

clc
clear all
close all

X=0:100;        % X is 0 to 100
Y=0:100;        % Y is 0 to 100
Z=0:100;        % Z is 0 to 100
figure(1)
subplot(2,2,1),plot(X,'g-'),title('X value');   % plot  X is linear
subplot(2,2,2),plot(Y,'b-'),title('Y value');   % plot Y is linear
subplot(2,2,3),plot(Z,'y-'),title('Z value');   % plot Z is linear
M=101;
k1=0;
O=zeros(length(X)*length(Y)*length(Z),1);
for i=1:length(X)
    for j=1:length(Y)
        for k=1:length(Z)
            k1=k1+1;
            O(k1)=M^2*X(i)+M^1*Y(j)+M^0*Z(k);       % Add different combination of X, Y and Z,
        end
    end
end
subplot(2,2,4),plot(O,'r-'),title('Output value');  % Output also linear


Result





No comments:

Post a Comment