The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
43 views

I have a problem in such type of Questions :- https://gateoverflow.in/25046/tifr2012-b-1

In above question its asked to find number of linear function. Now in the answer they simply calculated the total number of functions and they said that everyone will follow this property. How did they said that ?

I mean ok we know x and y we could calculate there XOR but we don't know about Function they didn't gave the mapping function as well. The how did they said that F(X xor Y) = F(X) xor F(Y) ?

asked in Mathematical Logic by Loyal (6.6k points) | 43 views
0
The answer given to the question is wrong it will be 2^n.
0
Please can you  explain the approach
0
Explained below in the answer section.
0
Thanku So much sir

1 Answer

+2 votes

Take an example 

Suppose the function f is from {0,1}3  to {0,1}

Now, here we have to find the number of functions possible from {0,1}3 to {0,1} such that

f (x XOR y) = f(x) XOR f(y)

Now, observe that if we maintain the linearity of XOR then the values f(000),f(101),f(110),f(011) and f(111) are dependent on the values f(100) , f(010) and f(001) (Reason given below)

So, if we fix the values of f(100),f(010) and f(001) then we will get the whole function..

Now, f(100),f(010) and f(001) have 2 options each 0 or 1.

So, the number functions possible is 23 = 8.

Now, come how the values f(000),f(101),f(110),f(011) and f(111) are dependent on the values f(100) , f(010) and f(001)

Let f(100) = 0 , f(010) = 0 , f(001) = 0

Now, f(000) = f(100 XOR 100) = f(100) XOR f(100) = 0 XOR 0 = 0

         f(101) = f(100 XOR 001) = f(100) XOR f(001) = 0 XOR 0 = 0

         f(110) = f(100 XOR 010) = f(100) XOR f(010) = 0 XOR 0 = 0

         f(011) = f(010 XOR 001) = f(010) XOR f(001) = 0 XOR 0 = 0

         f(111) = f(100 XOR 011) = f(100) XOR f(011) = f(100) XOR f(010) XOR f(001) = 0 

So, we have seen how the values f(000),f(101),f(110),f(011) and f(111) are dependent on the values f(100) , f(010) and f(001)

Now, generalise the problem suppose the function is from {0,1}n to {0,1} 

In this case if we fix the values of f(100...0),f(010...0),f(001...0),.....,f(000...1) then we will get the whole function since rest of the values are dependent on the above n values.

Now, each of the n values f(100...0) , f(010...0) , f(001...0),.....,f(000...1) has 2 options each 0 or 1.

So, the number of functions possible is 2n. (Answer)

answered by Loyal (9.5k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,811 questions
54,530 answers
188,403 comments
75,482 users