An exact solution to a dynamic portfolio choice problem with transaction costs