Note: My original question was Why is 你去了北京 correct but 你去了北京吗 incorrect? but I was mistaken, so I'll change the question to try to make it more useful (and less confusing) to the future reader. I'll edit so as to ensure the current answer remains relevant.
There seems to be an important difference between these (completion 了 vs. change-of-state 了):
你去了北京吗?
You went to Beijing?你去北京了吗?
You went to Beijing?
I had thought it wasn't much of a difference, but the distinction seems very consistent:
”去了北京吗“
(6 hits)”去北京了吗“
(82,100,000 hits) [actually, judging from later pages, these counts are incorrect and possibly misleading]”做了作业吗“
(7 hits) ”做作业了吗“ (6,660 hits)”吃了午饭吗“
(7 hits)”吃午饭了吗“
(1,270,000 hits)- Searching for
了 吗
at Jukuu gives 10 pages of sentences ending ...了吗? and the only examples with 了 after the verb also end in ...了吗 e.g. 他们确定了会议的日子了吗?. - Searching for
了 吗
at YouDao is the same with the exception 你知道我看见了什么吗? - The top answer to 吃午饭了, should 了 be right after 吃? states 吃了午饭 cannot be turned into a question.
Question: Why is 你去了北京吗 less common than 你去北京了吗?