定义域仅为0或1的函数的正确表示法及术语确认
Hey there! Let's clear up your confusion step by step:
1. Correct Name for These Functions
First, the term "binary function" usually refers to functions that take two arguments (like addition: $f(a,b)=a+b$), so that's not the right label here. Instead, your functions have a binary set as their domain (only 0 and 1 as inputs). Common, precise names for them are:
- Functions defined on the Boolean set (used often in logic, computer science, or discrete math)
- Binary-input scalar/vector functions (more descriptive for general math contexts)
2. Proper Notation
For your scalar-valued function $f$, the correct domain notation explicitly uses the set containing 0 and 1:
$$f: {0,1} \rightarrow \mathbb{R} \tag{1}$$
For the vector-valued function $g$, the notation follows the same logic—just adjust the codomain to $\mathbb{R}^n$:
$$g: {0,1} \rightarrow \mathbb{R}^n \tag{2}$$
And when writing its component form, it's best to specify the input variable clearly, like:
$$g(x) = (g_1(x), g_2(x), \dots, g_n(x)) \quad \text{where } x \in {0,1}$$
Bonus: Alternative Shorthand
In fields like Boolean algebra or digital logic, you might see the Boolean set denoted as $\mathbb{B}$ (where $\mathbb{B} = {0,1}$). So you could also write:
$$f: \mathbb{B} \rightarrow \mathbb{R} \quad \text{or} \quad g: \mathbb{B} \rightarrow \mathbb{R}^n$$
But ${0,1}$ is more universally understandable across all math disciplines, so it's safer to use unless your context specifically uses $\mathbb{B}$.
内容的提问来源于stack exchange,提问作者JDoeDoe

