By Kelly Murray, CNN

What would it take to change sexes? In humans, it involves complicated surgeries and rigorous hormonal therapies, not to mention hefty social and psychological ramifications. But in the Eastern Pacific Ocean, tiny orange-and-blue fish are naturally transitioning from female to male, and male to female, all the time.

Bluebanded goby fish, about 2 to 2.5 inches long, are able to change their sex when it suits their position in social hierarchies.

Matthew Grober, associate professor of biology at Georgia State University, has received funding from the National Science Foundation to better understand what mechanisms cause some of these fish to change sexes. In his lab, fluorescent lights accentuate dozens of aquariums lined with grayish-green algae where his bluebanded gobies thrive.

“We can detect within minutes, via changes in behavior, when a fish begins the transition, and it generally takes one to two weeks to complete the transition from female to male,” Grober explained.

One indicator of typically male behavior is movements associated with male courtship, such as rapid zig-zag movements called "jerks," as described in a 2007 study that Grober co-authored. Females that become males may also reduce their submissive behaviors.

Although natural sex change is exceedingly rare across the animal kingdom, bluebanded gobies are not the only creatures capable of it. Other examples include the clown fish and the limpet snail.

Groups of these fish have a skewed sex ratio in their natural environment. In other words, goby groups are not 50% male and 50% female, as one might expect. Instead, as Grober explained, “Gobies most often live in groups called harems that usually consist of one male and four to five females.”

In a natural setting, if the leading male dies, the most dominant female remaining in the group will take leadership of the harem and then physically change into a male.

Why would the female change her sex? The answer lies in evolutionary biology.

An organism’s evolutionary success depends on the number of genetic copies of itself it leaves behind in the population. So, a male fish, which mates with all of its harem’s females, has much more success in spreading genes than any given female.

For example, a male in a harem of four females has four times more reproductive success than any of his females because each individual female has only the harem’s one male partner with whom to mate.

Just as in humans, in many sex-changing fishes, social context often determines an individual’s behavior.

The bluebanded goby observes and reacts to the behavior of others around it, so as to optimally position itself within the social hierarchy. Other fish observe that individual’s behavior and react to it, and so on.

Grober wanted to know if the same mechanisms that regulate female-to-male sex change also work in the other direction. Using saltwater aquariums in his lab, he designed an experiment that used isolated groups of all males and all females.

Each group had one fish that was significantly larger than the others to encourage one individual to achieve dominance over the rest of the group. Grober and others argue that while a larger fish is more likely to achieve social dominance over its smaller harem mates, size alone doesn’t completely determine which fish is the most dominant.

His research group observed instances of aggressive behavior (approaches, flaring fins, head-standing) and submissive behavior (retreat or avoidance in response to aggressive behavior) in these groups. Taking all individual interactions into account, they could determine each fish’s social status within the group.

The fish demonstrated male-to-female sex change in this experiment. But something else remarkable happened: One of the fish remained male, and it was the only fish to retain its dominance over the group.

For sex change in either direction, there seems to be one guiding social principle: If subordinate, be female. Because each group had only one dominant individual, each group ended up with only a single male.

Hormones also play a role in the sex changes of these fish.

In one experiment, Grober and colleagues set up pairs of female bluebanded gobies, so that one fish was clearly subordinate. When they loaded up the subordinate with a potent male hormone, 11-ketotestosterone, it was able to make her look like a male, but her female-typical social behavior didn’t shift in a male direction. She continued to behave as a female.

“My team successfully demonstrated that while hormones do have a direct effect on the fish’s physical structure (like gonads, genitalia and fins), the fish's behavior answers more to its position in the social hierarchy,” he said.

So what can we Homo sapiens learn from these fish?

Researchers’ efforts are showing us that two seemingly distant vertebrates actually share quite a lot of characteristics. As Grober firmly asserted, “Us IS them.”

In both people and these fish, behavior answers to social context; it’s only partly determined by physical sex and size. Sexual behavior in humans and gobies is malleable: It is able to change based on an individual’s placement in the social hierarchy.

Grober argues: We should not think of fish as being like robots or automatons, because they make complex decisions regarding reproduction just as humans and other social animals.

More on the bluebanded goby’s amazing sex-changing ability

Other animals that change sex