I want to transition from Mathematics to Computer Science for a PhD. Will post-baccalaureate studies in Computer Science help me?
What you can do is first complete a masters degree in CS and then transition to a PhD program. Some masters programs do not require a bachelor degree in CS, and you can get your degree in 1~2 years after completing all the necessary courses.

While doing your masters degree, you get to know the professors, learn about their projects and gauge your ability to launch a career in computer science. That's also a great opportunity for you to find out if there could be an advisor-student match that will materialize into a PhD thesis.

If you then manage to get into the PhD program in the same institution, you may be able to transfer the credits and take the preliminary exams right away. Speak to the Graduate Advisor to find out more.

Good luck!