Question : How long do most people visit Beijing?
Answer : Of course you're not most people, but if you were, you'd stay roughly 10 days.
Question : If your plans are flexible, have you considered changing your departure day?
Answer : The cheapest day to fly in October is Tuesday. Having flexibility in your travel plans means you can save more, so be sure to plan ahead when possible.