Treasury Secretary Jack Lew has warned that by mid-October the agency will have only $50 billion in cash on top of incoming revenue.

That may sound like a lot. But, as the Bipartisan Policy Center details, it won't last very long.

If the "X" date turns out to be Oct. 18, Treasury would run about $106 billion short of the money it owes between then and Nov.15. That means it wouldn't be able to pay the equivalent of a third of all the bills due during that period.

Here's why: Treasury handles about 80 million payments a month. Those payments are not evenly spaced out so on some days more is owed than on others. And the revenue flowing into federal coffers is unpredictable and varies from day to day.

Payments include IRS refunds, Social Security and veterans benefits, Medicare reimbursements for doctors and hospitals, bond interest owed investors, payments to contractors and paychecks for federal workers and military personnel.

If Congress fails to act in time, Treasury will have to make difficult -- and legally questionable -- decisions about who should get paid and who should be stiffed. It may decide to pay some bills in full and on time and not others.

Or it may decide to delay all payments due on a given day until it has sufficient revenue on hand to pay in full. A report by the Treasury inspector general has said that this might be the most plausible and least harmful approach.

But under that scenario, delays would grow over time from a day or two to several weeks. For example, the payments due to seniors, veterans and active duty military personnel on Nov. 1 wouldn't go out until Nov. 13.

In any case, the expectation is that the agency will try to prioritize payments to bond investors over everyone else, lest the financial markets go haywire. Politically, of course, that carries risk, said Steve Bell, the senior director of the Bipartisan Policy Center's economic policy project.

"There's a political danger you'll be accused of paying bondholders over Social Security recipients," Bell said.

On both Oct. 23 and Nov. 14, $12 billion in Social Security benefits come due, while another $25 billion comes due on Nov. 1, according to the analysis.

Meanwhile, on Oct. 24, Treasury will have to roll over $57 billion in outstanding debt and another $115 billion on Oct. 31. Normally that's not a problem, because U.S. Treasury auctions attract a lot of buyers willing to purchase bonds at low rates.

But if those rollover dates come after the "X" date, and the perception is that the United States is defaulting on some of its obligations, Treasury could have trouble finding enough buyers or investors could demand higher interest rates.

The debt ceiling is currently set at $16.7 trillion. That ceiling was reached on May 19, and ever since Treasury has been using a host of special measures to keep the country's borrowing at or below that ceiling. But those measures will be exhausted by mid-October, according to Treasury.

If lawmakers want to raise the ceiling enough to get past the 2014 midterm elections in November, the Bipartisan Policy Center estimates they will have to raise it by $1.1 trillion to $17.8 trillion.