Whether it's silent-but-deadly or loud-and-proud, children delight in a good fart. Adults, on the other hand, are usually less amused, and more embarrassed, by flatulence. Yet we all pass gas —  about 13 to 21 times a day, in fact. 

"It doesn't matter how glamorous someone is, they are passing gas," says Patricia Raymond, MD, a gastroenterologist in Virginia Beach, Virginia, and a fellow of the American College of Gastroenterology.

In past centuries, people were more relaxed about the phenomenon. One French entertainer in the 1800s even became a star of the Moulin Rouge by playing tunes — including Tchaikovsky's 1812 Overture — by sucking gas into his rectum and expelling it in musical farts.

Musical farts may have fallen by the wayside, but gas is still a part of being human. To figure out why you pass it, and how to pass less, Raymond offers this advice.

Getting to the bottom of gas 

To determine where your gas is coming from, Raymond says to answer this question honestly: When you pass gas, is it smelly or not?

If it's not smelly, swallowing excess air is probably the trigger. Do you like to chew gum, drink soda or smoke? Do you have to swallow a lot of medicine? All this can causes you to gulp air, Raymond says. In the process, you generate excess gastric air, which infiltrates the small bowel and can trigger belching, bloating or flatulence.

Related: Pulp Fiction (and Fact): The Lowdown on Cellulose in Your Food

If your farts are pungent, it may be because your food isn't being digested completely. Some carbohydrates can't be digested by the small intestine's enzymes. So when they reach the colon, the bacteria there break them down (metabolize) them. The result? Unpleasant-smelling hydrogen and carbon dioxide gasses.

Another problem: You may have bacterial overgrowth in your small intestine, which already has a lot of normal bacteria. Too much leads you to produce more gas in your intestine. Some people are more sensitive than others are to higher amounts of intestinal gas, which may cause more flatulence.

Putting a lid on it

For non-smelly gas, Raymond suggests behavioral changes: Stop chewing that gum, drinking soda or beer, smoking or excessive swallowing. You can also eat more slowly so you swallow less air. If you wear dentures, check in with your dentist and ask if they are fitting correctly; otherwise, you may be taking in too much air.  

Related: Hidden Food Allergens: 18 Surprising Foods (and Drinks) That Have Them

For the foul-smelling variety, you can cut down on the foods that trigger it, or at least avoid them the day of a big party or meeting. Here are some of the typical culprits, Raymond says:

  • Beans
  • Cauliflower
  • Cabbage
  • Brussel sprouts
  • Broccoli
  • Onions
  • Mushrooms
  • Fruits, including pears, apples and peaches
  • Whole grains
  • Bran
  • Yogurt, cheese and ice cream
  • Sugar-free gum and candies
  • Pretzels and bagels

Related: Food Additives: Are They Safe or Can They Make Us Sick?

Of course, no one wants to give up all possible food sources of gas, especially since many of those very foods are also good for you. However, you can pay attention to which foods make you the gassiest and decrease your intake of those. To do this, Raymond suggests keeping a food diary and noting any gas symptoms later. "Gas starts four to six hours" after eating, she says.

Fat itself does not cause gas, but if you eat high-fat foods in moderation instead of going overboard, your stomach will empty faster. This can allow gases to rush more quickly into the small intestine, resulting in less bloating.

Be aware, too, that gas expands at altitude, Raymond says. So while the chili and bean plate special may look tempting at the airport terminal, it's likely to trigger gas once you are aloft. Or, if you like life on the edge, she says, at least take some Beano before the chili-bean plate feast.

Beano, or alpha-galactosidase, has a sugar-digesting enzyme that the body lacks. It digests the sugar found in beans and other vegetables. It has no effect, though, on preventing gas triggered by fiber or lactose.

Treating gas

Tempted to take some Beano after that plate of chili? Sorry, it's too late. Once you have gas, Raymond says, no remedy you take "will catch up downstream." In addition, she is not a fan of over-the-counter gas reducers. They may get rid of the bubbles in the gas, she says, but they won't reduce the volume of gas. If patients have cramping and spasms, she can give them medicine to relieve that, she says.

Typically, Raymond recommends letting time pass (alone, if necessary). She also prescribes a dose of perspective. Gas, she says, "is better out than in."

Kathleen Doheny is a Los Angeles journalist specializing in health, behavior and fitness topics.