How does XOR qualify as a linear function?

  • Context: Graduate 
  • Thread starter Thread starter B-Con
  • Start date Start date
  • Tags Tags
    Function Linear
Click For Summary

Discussion Overview

The discussion revolves around the classification of the XOR operation as a linear function, particularly in the context of vector spaces over the field F_2. Participants explore the definitions and properties of linear functions, bilinear maps, and the implications of these concepts for the XOR operation applied to 32-bit integers.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant notes that XOR is referred to as a "linear" function and questions how it qualifies as such given that it operates on two variables rather than one.
  • Another participant clarifies that the XOR operation can be viewed as addition of vectors in a 32-dimensional vector space over F_2.
  • A different participant raises a concern about the definition of linear transformations, stating that XOR maps from two vectors to one, which complicates its classification as a linear transformation.
  • One participant seeks a definition of a linear function in two variables, expressing difficulty in finding relevant examples.
  • Another participant introduces the concepts of bilinear and multilinear functions, explaining that a bilinear function satisfies linearity in each argument separately.
  • A later reply acknowledges the earlier explanation about bilinear maps and concludes that XOR satisfies the conditions of a bilinear map.

Areas of Agreement / Disagreement

Participants express differing views on the classification of XOR as a linear function, with some supporting the idea of it being a bilinear map while others question the applicability of linear transformation definitions to the XOR operation. The discussion remains unresolved regarding the precise classification of XOR.

Contextual Notes

Participants reference definitions and properties of linear and bilinear functions, but there is no consensus on how these definitions apply specifically to the XOR operation. The discussion highlights potential ambiguities in the classification of functions with multiple inputs.

B-Con
Messages
26
Reaction score
0
In computer science the XOR operation is a very important one, and I've heard XOR referred to as a "linear" function. My experience with linear functions (in the sense of vector spaces) has only been with functions in one variable, but XOR is a function of two.

I know that we start by using the field [tex]F_2 = {0, 1}[/tex] in which addition is actually the XOR operation. So addition of two vectors from a vector space over that field (say, two 32-bit integers) is merely addition of the vectors using the field addition operation.

So then the XOR operation on 32-bit integers isn't a special function so much as it is really just addition of 32-dimension vectors over [tex]F_2[/tex]. So what is the definition for the addition of two elements in a field to be linear, and how does the (XOR) addition over [tex]F_2[/tex] qualify as linear?

I'm sure I've encountered these answers before, but I'm blanking at the moment. :-S
 
Last edited:
Physics news on Phys.org
We are talking about addition of vectors, not addition in a field. The set of 32-bit integers is viewed as a 32-dimensional vector space over the field with 2 elements. Then apply the definition of "linear transformation" from linear algebra to see what it means.
 
But addition of vectors, by the definition of a vector space, is the dimension-by-dimension addition of the field elements, which uses the field addition.

My problem is that, as far as I can find, a linear transformation is from one vector to another vector. XOR is from two vectors to one vector.
 
I think the basic question here is: What is the definition of a linear function in two variables? Ie, if you have +: S×S → S, what must + satisfy to qualify as linear?

I can only find examples of linear functions with one variable.
 
The might want to look up the terms "bilinear" and "multilinear"...or I could just explain them here. Let [itex]T:U\times U\rightarrow V[/itex], where U and V are vector spaces. T is said to be bilinear if, for each u in U, the functions [itex]x\mapsto T(x,u)[/itex] and [itex]x\mapsto T(u,x)[/itex] are both linear. (Note that they are functions from U into V) . Multilinear is the same thing, except that you're dealing with a function of more than two varibles. The most general situation would be when you're dealing with a function like [itex]T:U_1\times\cdots\times U_n\rightarrow V[/itex].

Multiplication of complex numbers, the inner product on [itex]\mathbb R^n[/itex], and the cross product on [itex]\mathbb R^3[/itex], are good examples of bilinear maps.
 
Last edited:
Fredrik said:
The might want to look up the terms "bilinear" and "multilinear"...or I could just explain them here. Let [itex]T:U\times U\rightarrow V[/itex], where U and V are vector spaces. T is said to be bilinear if, for each u in U, the functions [itex]x\mapsto T(x,u)[/itex] and [itex]x\mapsto T(u,x)[/itex] are both linear. (Note that they are functions from U into V) . Multilinear is the same thing, except that you're dealing with a function of more than two varibles. The most general situation would be when you're dealing with a function like [itex]T:U_1\times\cdots\times U_n\rightarrow V[/itex].

Multiplication of complex numbers, the inner product on [itex]\mathbb R^n[/itex], and the cross product on [itex]\mathbb R^3[/itex], are good examples of bilinear maps.

Ah, yes, that's what I was looking for. It slipped my mind. Thanks.

So XOR is just addition of vectors over F_2 and satisfies the conditions of a bilinear map.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
9K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 23 ·
Replies
23
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 6 ·
Replies
6
Views
3K