It's a common piece of surfing wisdom that where dolphins swim, there are never sharks. But for ocean-goers who take comfort in a pod of dolphins swimming by, shark experts have bad news.

"This is a myth," Andrew Nosal, a shark expert at the University of San Diego, told Live Science in an email.

And this myth couldn't be farther from the truth, Stephen Kajiura, a shark expert at Florida Atlantic University, said. "If anything, it's the opposite," he told Live Science, "If you see dolphins, more often than not, there might be sharks in that same area." [Why Do Sharks and Whales Swim So Differently?]

That's because sharks and dolphins — both of whom are carnivores — go to the same spots to hunt.

The myth stems from the false notion that dolphins are the natural enemies of sharks, and that sharks will do anything to avoid them. There's a kernel of truth in there. While dolphins and sharks generally swim side by side "minding their own business," dolphins occasionally antagonize sharks when they feel threatened, Kajiura said. These more aggressive dolphins will ram sharks with their noses, or slam into them with the whole force of their bodies. Sharks sometimes even swim away from encounters bruised and battered. (Orca whales, the largest member of the dolphin family, are also known to hunt sharks.)

Dolphin-shark face-offs are "more the exception than the norm," Kajiura said. Still, pop-culture grabbed onto the image of the shark-fighting dolphin. The popular television series "Flipper," about two boys and their pet dolphin, was especially guilty of perpetuating the myth that dolphins scare off sharks, Nosal said. The show depicted Flipper fiercely chasing sharks away from his beloved owners.

Unfortunately for surfers and swimmers, Flipper isn't an accurate depiction of typical dolphin behavior. But if you're concerned about sharks, there are rules you can follow to minimize your risk of encountering one of these creatures.

First, avoid swimming at sunrise and sunset, when visibility is lower. At these times, it's much more difficult for sharks to distinguish a swimmer from a tasty fish, Kajiura said. Avoid swimming where sharks like to hang out — around drop-offs (an underwater slope or cliff) and kelp beds, large schools of fish or fishing boats, he added. Finally, always swim with others and try to frequent beaches with a lifeguard on duty, Nosal said.

Most importantly, swimmers should remember that although the odds of getting attacked by a shark are "vanishingly small" (sharks cause just one death a year in the United States, on average), the ocean is still shark territory.

"Swimmers need to have the right attitude about swimming in the ocean," Nosal said, "There's no such thing as 'shark infested waters.' The sharks live in the ocean. That is their home."

Originally published on Live Science.