How can I form a bijection between $\mathcal P(A)$ and $2^A$.

I am having trouble getting started with this particular problem.

Let $A$ be a nonempty set, and let $\mathcal{B}$ be the set of all functions $f:A\to\{0,1\}$. Show that $\mathcal{B}\sim\mathcal{P}(A)$; that is, construct a bijection $\phi: \mathcal{B} \rightarrow \mathcal{P}(A)$.

Faced with this problem, I know that the power set contains all subsets of $A$. Now, does that mean all possible combinations of the functions which map to $\{0,1\}$? Also, does the fact that the characteristic function is associated with the power set have anything to do with the problem? Thanks.


Solution 1:

Given a subset $S \subseteq A$, consider the function $\varphi_S: A \rightarrow \{0,1\}$ defined by $\varphi_S(x) = 1$ if $x \in S$ and $0$ otherwise.