# Given a 12x12 binary image (only black and white pixels) what is its dimensionality? And how can I define dimensionality of a data space?

Suppose I have a grid 12x12 of pixels that can be only black or white. I can't understand if the dimensionality is 2 or 3. I mean... Is dimension given by 12x12 or 12x12x2 ?

There is some ambiguity in dimensionality you ask for. The vector space that your input lies in is $$12\times12 = 144$$ dimensional. So, if you're going to apply some kind of dimensionality reduction algorithm, e.g. PCA, this is the dimension. But, we sometimes tend to refer to dimension as the shape of the tensor, which is $$2$$ in this case. Some libraries might read the image into $$12\times12\times3$$ tensors, in which the third entry indicates RGB decomposition, even if the image is black and white. In this case, the tensor dimension is $$3$$.
• Definitely not. {0,1} is your domain, it has nothing to do with dimensionality. In RGB, your domain would be binary numbers with 24-bits, i.e. $2^{24}$ possible values. For dimensionality, you'll consider how many variables you have, not their values. In this case, you have $144$, i.e. $x_{1,1},x_{1,2},...x_{12,11},x_{12,12}$ – gunes Jan 15 '19 at 10:50