Apparent paradox concerning Heisenberg's uncertainty principle I have just begun my Introduction to Quantum Mechanics course in my undergrad and I am trying to understand the uncertainty principle on a fundamental level. I think the best way to understand the fundamentals of this principle is to question the principle and understand why doing so is wrong. 
Consider the following thought experiment:

I have a setup consisting of two independent regions. Region A with an
  electric field along the positive x-axis, lets say, and Region B with
  a magnetic field, also along the positive x-axis. In Region A I have a
  cathode and the electric field causes a potential difference thereby
  accelerating the electrons from rest to a particular velocity (along
  positive x-axis).
Let us just focus on a single electron. I know the exact velocity
  (magnitude and direction) to which this electron is accelerated to
  (energy conservation). Now this electron is going to enter the
  magnetic field in a direction that is parallel to the field. I know
  that the electron is going to move in a straight line in the magnetic
  field, without losing any energy as the magnetic field does zero work.
  So I know the exact momentum of the electron at all times as this
  momentum is not going to change as long as the electron is inside the
  magnetic field. So uncertainty in momentum is zero. Since I know the
  exact trajectory of the electron, the uncertainty in position is also
  zero and I know both of these simultaneously.

So it appears like this though experiment violates the Heisenberg uncertainty principle.
What is the flaw in my argument? Why can't this happen?
 A: You say:

Let us just focus on a single electron. I know the exact velocity (magnitude and direction) to which this electron is accelerated to (energy conservation).

but this isn't true. You know the electron energy has increased by $E$ eV, where $E$ is the potential difference you're using but you don't know what its energy was initially i.e. when it left the anode and before being accelerated by your field. The only way you can know the initial momentum of the electron precisely is if it's completely delocalised i.e. you don't know where it is or when it was emitted.
I applaud your attempts at understanding the uncertainty principle, but you are going about it the wrong way. You need to start by writing down the wavefunction for a free particle. The eigenfunctions for a free particle are infinite plane waves, which have a precise momentum but completely unspecified position. Assuming you start with a partially localised particle you construct its wavefunction by using Fourier synthesis i.e. you build up the initial probability distribution by summing (an infinite number of) plane waves. Because this requires combining waves with different momenta that means your partially localised particle has a spread of momenta.
