Are these two predicates equivalent (and correctly formed)? 
For all x there exists a y where if x is prime, it is less than or equal to y and y is prime.

$\forall x \exists y\space (prime(x) \implies x \leq y \land prime(y))$

There exists a y for all x where if x is prime, it is less than or equal to y and y is prime.

$\exists y \forall x \space (prime(x) \implies x \leq y \land prime(y))$
Both $x$ and $y$ are natural numbers.
The statement should say "there is a largest prime number". I'm aware that switching quantifier order when quantifiers are mixed should change what's being said, but I don't see any difference in effect between the two statements. 
If pressed, I'd say that $y$ in the second refers to one $y$ which is the largest prime, while $y$ in the first refers to multiple $y$s which are larger than any given prime.
 A: Your intuition is correct.  
The first sentence says:

For every prime number x, we can find a larger prime number y.

With $\forall x$ before $\exists y$, any number $x$ may have their own larger prime number $y$. So no matter which number y we settle on, we can always take that number as x and find an even larger prime number y', and we will never get done.
The second sentence says:  

There is a prime number y which is larger than any prime number x.

This is what we want to say. With $\exists y$ before $\forall x$, there is one number $y$ which works for all of the $x$s, so for any prime number $x$, we know that $y$ is larger than it, hence $y$ is a largest prime number.  
Both sentences are syntactically well-formed, but they are not logically equivalent. (2) is a stronger statement than (1) in the sense that (2) logically implies (1), but not vice versa: If there is a largest prime number $y$ that works for all $x$, then surely for all $x$ we will find a $y$ (namely that $y$ which is the largest of all), but just because for any given prime $x$ we can find a number that is larger than it doesn't mean there is a prime number that is larger than all $x$.  
Hence the formulation in (1) is too weak to express the English statement, and (2) is the appropriate translation.
