1

I would like to define a vector $\mathbf{s} = [s_1, \ldots, s_N]^{\operatorname{T}}$ with length $N$ where each element is a 16bit two's complement signed integer (in C one would write int16_t si = 0; for a scalar 16bit integer and int16_t s[N] = {0}; for a vector).

A single element is thus $s_i \in \{x\in\mathbb{Z} \mid -2^{K-1} \leq x \leq 2^{K-1}-1\} = \{x\in\mathbb{Z} \mid -32768 \leq x \leq 32767\}$ with $K=16$ being the number of bits.

What I would write for the vector is $\mathbf{s} \in \{x\in\mathbb{Z} \mid -2^{K-1} \leq x \leq 2^{K-1}-1\}^N$.

But is there a more elegant way?

How do I, in an elegant and compact way, define a vector $\mathbf{a} \in A^N$, where A is set defined by me?

Asaf Karagila
  • 393,674
Fabian
  • 151
  • Before going any further, your notation is abysmal. What does ${x: P(x)}^N$ even mean? In simple terms, what you have so far doesn't make sense. 1: you can't exponentiate sets. 2: if you really want to factor $N$ into the set somehow, you will have to do it within the braces. – Bertrand Wittgenstein's Ghost Apr 14 '22 at 21:21
  • That was supposed to be the vector notation. Just like you would write $\mathbb{R}^N$ for an N-dimensional real vector. But this is exactly what I am struggling with. The exponent is supposed to be a shorthand notation for applying the cartesian product a certain amount of times. – Fabian Apr 14 '22 at 21:25
  • $\mathbb R ^n$ is a set of n-tuples: ${(x_1,x_2,...,x_n):x_i\in \mathbb R, 1\leq i \leq n}$ – Bertrand Wittgenstein's Ghost Apr 14 '22 at 21:31
  • As an electrical engineering student, I am used to seeing the terms tuples and vectors being used equivalently. So per your notation, I would simply have to replace the $\mathbb{R}$ by my definition of the set of all 16bit integers? So replace $\mathbb{R}$ with $A$ and define $A = {x\in\mathbb{Z} \mid -2^{K-1} \leq x \leq 2^{K-1}-1}$? – Fabian Apr 14 '22 at 21:40
  • Yes, they are equivalent. In general, an $m×n$ matrix is notated as an element of $\mathbb R ^ {m×n}$. In this case you can indicate $A^k$ or however many tuples you require. – Bertrand Wittgenstein's Ghost Apr 14 '22 at 21:43
  • Okay, but this brings me back to my set notation from above, right? Because $A={...}$ and thus $A^N={...}^N$. – Fabian Apr 14 '22 at 21:49
  • 1
    Why not $\mathbf{s} \in {(x_1,\dotsc,x_N)\in\mathbb{Z}^N \mid x_i\in A, 1\le i\le N}$? – rogerl Apr 14 '22 at 22:02
  • @rogerl Yes, that would certainly work too. But then I would have to define two sets (yours and $A$). I am also having trouble understanding what the problem with the ${...}^N$ notation is? – Fabian Apr 14 '22 at 22:06
  • It's unconventional. @rogerl 's answer seems pretty elegant. Look, you will necessarily have to define two seperate sets you can't just combine them without explicating the properties picked out by each set. – Bertrand Wittgenstein's Ghost Apr 14 '22 at 22:57

0 Answers0