In summary, it's complicated, as rumstcho's answer indicates. And the number of infected chickens/eggs is only the beginning, since chances of illness depend on how high the bacteria count is. There need to be enough to survive ingestion and partial digestion before they can incubate in your body and then cause illness.
Thus, to predict chances of illness from "undercooked" chicken or eggs, you would need to consider:
- The rate of contamination on raw products at the grocery store
- Storage and food preparation conditions, including temperature, duration of storage, and possibilities for cross-contamination
- Growth rate of bacteria depending on whether the prepared food is a good growth medium (liquid or dry, whether a good food source for bacteria, etc.) after preparation has begun
- If partially cooked, temperature and duration spent below 130F (particularly in maximum growth range around 100F)
- Time and temperature spent above 130F (which will gradually reduce bacterial population)
- Amount of food ingested
- Health condition, age, immune system status, etc. of person eating the food
- Etc.
There are simply too many variables. Most of the chicken in the grocery store probably has the potential to cause illness, but whether it will happen depends a lot on what exactly you do with it.
What we do know is that there are likely 1-1.5 million cases of Salmonella poisoning in the U.S. every year. This is an estimate because the vast majority of cases are not reported -- perhaps the illness isn't severe enough or people assume it's a "virus" or something else and don't get tested.
The FDA estimates that 142,000 cases of illness are caused each year in the U.S. by eggs infected with Salmonella alone. Most Salmonella poisoning associated with eggs comes from people mishandling them after they're out of the shell, since most estimates say only about 1 in 20,000 eggs is internally infected with Salmonella. (The rest of infected eggs have Salmonella on the shell; in the U.S., most of this is washed off, but regardless it still wouldn't cause illness on the shell until the bacteria have time to be mixed in a better growth medium and to propagate before consumption.) Still, given that the U.S. consumes around 75 billion eggs each year, that's still a lot of potentially infected eggs.
And just because you ate your chicken "undercooked" doesn't necessarily mean it was likely to still have enough bacteria to make you sick. The USDA/FDA recommends 165F as a safe final temperature for poultry because that's where Salmonella will mostly die in a few seconds. But if you were roasting a chicken and it spent a long time above 130F, bacteria will gradually die off. You could potentially still eat a chicken that had spent over an hour at 140F and was pink and "squishy" (and unappetizing to many people), but enough bacteria may have been killed by that point to make illness unlikely.
But that doesn't mean you could have safely eaten it raw or at room temperature or before it got to 130F or before it spent a long time above that temperature. It's the whole food preparation process that dictates the chances of illness.
Lastly, I would just note the phrase "how many terrible nights will I have" in the question, which to me sounds like it's referencing "stereotypical food poisoning" -- where you get sick a few hours later and have a little diarrhea or vomiting overnight and then get better within 24 hours or so. That's often not due to Salmonella; there are lots of other bacteria and toxins in food that can cause such illnesses.
Salmonella infection is sometimes mild in healthy adults, but it's usually not the sort of thing that just causes a single "bad night" of "stereotypical food poisoning." While symptoms can appear quickly, it could take up to 2-3 days for them to appear, and they usually last for quite a while -- typically 4-7 days.
Also, many foodborne illnesses can take several days or even more than a week to incubate before you show symptoms, so that "stereotypical food poisoning" might even be from something you ate days ago.
Bottom line: short of a lab test on the food you ate and a stool sample, you can't know whether a particular food caused illness. And given that most food poisoning cases are mild and/or could be days removed from ingestion, people tend to draw misleading conclusions about what foods caused problems, if they even consider it an "illness" at all.
But that doesn't mean foodborne illness doesn't exist or is incredibly rare. The CDC estimates that roughly 1 in 6 Americans (~50 million people) will experience some form of foodborne illness each year. You may just not realize what it is or what caused it.