For food safety reasons, Thanksgiving leftovers should be cleared from the table and refrigerated within two hours of being served. Once refrigerated, they should be consumed within three to four days. Leftovers can be frozen for three to four months. (The Associated Press)

Thanksgiving math actually isn't all that hard. You just need to use a few basic equations.

For example, to estimate the amount of wine you'll need, begin by multiplying the number of in-laws you are expecting by the estimated number of offensive jokes your uncle is likely to tell (remember to round up). Take the product of that and multiply it by the number of children likely to overhear the offensive jokes. Buy that many bottles of wine.

Or perhaps you need to know how many pies to serve. Tally the total number of guests, then add another eight guests to that number to account for your niece's heartthrob of the moment (who may or may not come, but if he does will eat an entire pie himself). Now subtract 12 from your total to account for the guests who without warning will diagnose themselves as gluten-sensitive, fruit-free, paleo-centric or anti-sugar. Buy that many pies.

How big a turkey should you get? This one is more complicated. Start by making a list of everyone coming to dinner. Rate each guest on an annoyance scale of 1 to 10. Bump up the rating by 2 points for any guest likely to spend the day standing in the kitchen distracting you. Tally all of the ratings, then divide by the total number of guests. If the final score is 5 or more, don't waste your money on any turkey. You'll probably overcook it while being annoyed and distracted by guests.

For more help navigating the Thanksgiving math minefield, we've assembled a cheat sheet to the most common culinary calculations. And because this is Thanksgiving, all estimates are generous to allow for plenty of seconds and leftovers.

##### How big?

For turkeys less than 16 pounds, estimate 1 pound per serving (this accounts for bone weight). For larger birds, a bit less is fine; they have a higher meat-to-bone ratio. But if your goal is to have very ample leftovers, aim for 1 1/2 pounds per person no matter how big the turkey is.

• For 8 people, buy a 12-pound turkey

• For 10 people, buy a 15-pound turkey

• For 12 people, buy an 18-pound turkey

• For 14 people, buy a 20-pound turkey

##### The big thaw

The safest way to thaw a frozen turkey is in the refrigerator. You'll need about 24 hours per 4 to 5 pounds of turkey. For speedier thawing, put the turkey (still in its wrapper) in a sink of cold water. Change the water every 30 minutes, and plan for about 30 minutes per pound.

##### The brine

A good brine uses kosher salt and sugar in a 1-to-1 ratio, and usually no more than 1 cup of each. Feel free to add any other seasonings. Brines typically are made by heating the salt, sugar and seasonings with a bit of water until dissolved. This mixture then is diluted with additional cold water (volume will vary depending on the size of your bird) and ice. Be certain the brine is completely cooled before using it.

Turkeys should be brined for at least 8 to 10 hours, but can go as long as 72 hours. A good rule of thumb is, the longer the brine, the weaker the brine. So for a 10-hour soak, use 1 cup each of salt and sugar. For a longer one, consider backing down to 3/4 cup each. Always keep the bird refrigerated during brining. If the turkey is too big, an ice-filled cooler stored outside works, too.

Don't have the time or patience to brine? Try salting instead. In fact, plenty of folks say salting a turkey produces meat with far better flavor than brining. To do it, set the turkey on a platter, then rub a generous amount of kosher salt on all surfaces. Cover with plastic wrap and refrigerate overnight. When you're ready to roast, rinse the salt from the turkey, pat it dry and pop it in the oven.

##### The roast

Roasting temperatures vary widely by recipe. Some go at a slow and steady 325 F. Others crank the heat to 400 F or 425 F for the first hour, then drop it down for the rest of the time.

However you roast, use an instant thermometer inserted at the innermost part of the thigh (without touching bone) to determine when your turkey is done. The meat needs to hit 165 F for safe eating, though some people say thigh meat tastes better at 170 F.

If the outside of the bird gets too dark before the center reaches the proper temperature, cover it with foil.

The following roasting time estimates are based on a stuffed turkey cooked at 325 F. Reduce cooking time by 20 to 40 minutes for turkeys that are not stuffed (estimate total roasting times at 15 minutes per pound for unstuffed birds). And remember, a crowded oven cooks more slowly, so plan ahead if your bird needs to share the space.

Using a convection oven? They are great at browning, but require heating or timing adjustments. Either cut the temperature by about 25 F from what is called for by the recipe and cook for the time directed, or roast at the suggested temperature, but reduce the cooking time by about 25 percent.

The following times are for a standard oven:

• 12-pound turkey: 3 to 4 hours at 325 F

• 15-pound turkey: 4 to 4 1/2 hours at 325 F

• 18-pound turkey: 4 1/2 to 5 hours at 325 F

• 20-pound turkey: 5 to 6 hours at 325 F

##### The baste

Basting the bird with its juices helps crisp the skin and flavor the meat. Do it every 30 minutes, but no more. Opening the oven door too frequently lets heat escape and can significantly slow the cooking.

##### The rest

The turkey never should go directly from the oven to the table. Like most meat, it needs to rest before serving for the juices to redistribute. Cover the turkey with foil and a few bath towels layered over that (to keep it warm), then let it rest for 20 to 30 minutes before carving.

##### The gear

You don't need to drop a load of cash on special equipment to be thankful this Thanksgiving, but there are some tools that make life easier (and the food safer). A digital instant thermometer or wired probe (that remains in the turkey during roasting) is the most critical. Cheap thermometers will set you back no more than \$20.

A heavy duty roasting pan is a worthwhile investment, but only if you make gravy from the drippings (the pan can be set on the stovetop after roasting) and if you roast other critters during the rest of the year. Otherwise, do yourself a favor and spend a few bucks on a disposable foil roasting pan (get a sturdy one). This makes cleanup a whole lot easier.

Speaking of foil, get the good stuff. Skip the wimpy 12-inch rolls and grab the heavy duty 18-inch stuff. It costs a few dollars more, but makes it easier to line pans, cover birds browning too quickly and wrap leftovers.

##### The sides

• Carrots: a 1-pound bag makes 4 to 5 servings

• Cranberry sauce: a 12-ounce package of fresh cranberries makes about 2 1/4 cups of sauce; a 16-ounce can has 6 servings

• Gravy: plan for 1/3 cup of gravy per person

• Green beans: 1 1/2 pounds of beans makes 6 to 8 servings

• Mashed potatoes: a 5-pound bag of potatoes makes 10 servings

• Stuffing: a 14-ounce bag of stuffing makes about 11 servings

##### Double oven trouble?

Are you lucky enough to be blessed with two ovens? Your Thanksgiving prep just got easier. Here's how to make the most of the extra roasting space.

• Dedicate one oven (if one is larger, use the larger) to the turkey. Place one rack on the oven's lowest shelf and remove all others. When the bird goes in the oven, it goes on that bottom rack. Now see if you have room to add another rack over it. If so, this is the ideal place to cook your stuffing (assuming it isn't in the bird), au gratin potatoes and green bean casseroles, which can cook at the same temperature at the bird.

• Early in the day, use the second oven to cook anything that can be done ahead. Pies and rolls are good. Closer to the time you will serve the meal, use the second oven to cook things that need a higher temperature than the turkey, such as roasted root vegetables and pies. As the turkey is being carved, use both ovens to reheat items (such as those rolls) or keep things warm; 150 F to 200 F is about right for both tasks.

##### The desserts

• Pie: a 9-inch pie can be cut into 8 modest slices.

• Whipped cream: Dolloping whipped cream on those 8 modest slices will require 1 cup of heavy cream beaten with 2 tablespoons powdered sugar (a splash of vanilla extract is nice, too)

• Ice cream: a la mode doesn't require much — 1 pint per pie should suffice

The leftovers

For food safety reasons, leftovers should be cleared from the table and refrigerated within two hours of being served. Once refrigerated, they should be consumed within three to four days. Leftovers can be frozen for three to four months. Though safe to consume after four months, they will start to taste off.