I am currently learning from Nielsen and Chuang and I am currently learning about Deutsch-Jozsa algorithm. However, I am stumped with the mathematics of the algorithm at the following section:
I understand intuitively that it works very similarly with Deutsch algorithm where we could measure a global state of the function with only 1 measurement, but I couldn't do it mathematically. Why is the amplitude simply so without including the $x \cdot z$ factor? I am also having a hard time on the summation over $x$ on the amplitudes. Why is the resulting amplitude for the constant case is $\pm 1$ and 0 for the balanced case?