There is a simple equation for solving for the force on a current carrying wire in a magnetic field:
where is the current in the wire (amps), L is the vector representation of the direction of the current with length that of the wire, and B is the magnetic field vector.
For the second problem we have a force diagram on the wire with 2 vectors that we want to make equal. The force downward due to gravity acting on the wire and the Lorentz force force upward. It points upward since the horizontal wire is oriented perpendicular to the horizontal component of the magnetic field and the cross product of two vectors is a third vector perpendicular to both vectors.
The force due to gravity is where is the mass of the wire in kilograms. The mass is given by where is the length of the wire in meters.
The equation becomes:
Solving for .