There is something I really misunderstand about the Deutsch-Jozsa algorithm.

To check if $f$ is balanced or constant, we use the following algorithm:

[![enter image description here](https://i.stack.imgur.com/jGqvr.png)](https://i.stack.imgur.com/jGqvr.png)

where $U\_f$ gives $(x,y) \rightarrow (x, y \oplus f(x))$.

Let's take $n=1$ for simplicity (thus the function $f$ is defined on $(0,1)$). We have four possible $U\_f$ associated to two constant possibilities ($f$ equal to $0$ or $1$), and two balanced possibilities.

So, in **practice**, if I want to implement this in a circuit, I have to know exactly the "matrix" of $U\_f$. And to do it I have to compute $f$ two times. Thus, I know if $f$ is balanced or constant even before having applied the quantum algorithm. So for a practical aspect, I don't understand what is the point of this.

Said differently, if I am given $U\_f$ I agree that in one step I will know if $f$ is balanced or constant. But if I know $U\_f$ I already know the answer to this question.

I am a little confused...