Can a phd thesis be in a different area than the master thesis? First of all let me begin with saying that I have seen there is a question quite similar to this one, but I thought I'd ask again so I could get more specific about my situation since I am guessing it's different for every major.
I am currently doing a master in mathematics, thinking about possibly pursuing a phd after that. During my undergraduate studies in mathematics, I mainly took pure math classes with an extra emphasis on algebra related courses(group theory, field theory, applied algebra). So far I thought that if I were to do a phd it would be in algebra.
During my masters I also continued with pure math classes, such as real analysis, algebra etc. But I am currently taking a class in theory of computation and it has really caught my attention. That along with the fact that during the last year of my undergraduate studies I took a class in design &amp; analysis of algorithms which I really enjoyed, has made me thinking that maybe if I were to do a phd, it wouldn't necessarily be in algebra after all but maybe in something in the interface of mathematics and theoretical computer science or in foundations of mathematics,or maybe even something that combines algebra with theoretical computer science if there's even something like that. Not really sure yet.
My questions are:  1. Can my master thesis area be different than my phd area? If yes, how different?Say if I were to do a master thesis in pure or applied algebra, would it be possible to then pursue a phd in something that maybe combines math and theoretical computer science?  2. What kind of background is needed for a phd in a topic somewhere between pure math and theoretical computer science? Would maybe a second masters in computer science be needed? (Also I guess a good 3rd question would be if maybe having taken only 2 classes in theoretical computer science that I enjoyed is not enough for me to be able to tell if I would actually like something like that?)
A big part of the Theoretical Computer Science (language theory, automata theory, Turing machines and other computational devices) is actually a part of algebra so if you switch to TCS, you won't change the area too much. But in general changing the area when going from Masters to PhD is not a problem at all. People sometimes even have multiple PhDs in different totally disjoint areas.