Here is how you teach a bear to dance: First, you acquire a bear cub — maybe you capture it in the wild, maybe you buy it from a bear broker. Then you smash an iron ring through the most sensitive part of its body — its nose — and attach a chain to the ring.

You might knock out all of its teeth, to make sure it doesn’t bite you. Or you might not.

You wrap its hind feet to protect them, but not its front feet, and as you play your fiddle or your drum you lead it to a red-hot iron surface. The bear will rise up on its back legs because the pain in its front paws is searing, and over time whenever it hears the fiddle, it will stand.

You jerk the chain to make the bear dance.

I learned these depressing details from “Dancing Bears,” a weirdly fascinating book by Polish journalist Witold Szabłowski (translated by Antonia Lloyd-Jones). The author’s topic is how subjugated individuals cope once freedom is restored. He devotes the first half of the book to rescued dancing bears (the practice of training bears to dance has been outlawed since 2007), and the second half to humans living in formerly Communist countries.

The comparison between bears and people does not hold — people are much more complex, for one thing — and the two halves of the book do not fit together very well. But both halves are fascinating.

At Dancing Bear Park, a Bulgarian sanctuary for rescued bears, Szabłowski learns how difficult it is to rehabilitate a wild bear. Freedom must be taught, step by step, and long-dormant instincts must be revived. Usually this is only somewhat successful.

“For every retired dancing bear, the moment comes when freedom starts to cause it pain,” Szabłowski writes. “What does it do then? It gets up on its hind legs and starts to dance. … As if it would prefer that its keeper come back to take responsibility for its life again.”

The second half of the book consists of interviews and stories from people who live in formerly Communist nations. Szabłowski’s point is clear: Just as freed bears have trouble surviving without their keepers, so do humans have trouble navigating life without the government providing food, housing, money and jobs.

With the fall of communism, he writes, “A large part of the world gained freedom, for which it was not prepared. In the most extreme cases, it wasn’t expecting or even wanting it.”

And so he travels to Cuba, Algeria, Russia, Poland, Ukraine and elsewhere, interviewing random people about how they are getting along. The stories he gathers are fascinating — from die-hard Communists, entrepreneurs, smugglers, beggars, nostalgics and realists. There is no common theme here, just stories of people in hardscrabble places using ingenuity and persistence to get by in various ways. He talks to a guy who smuggles automobiles into Ukraine; villagers who dress up like Hobbits for tourists; Georgians who tend the Stalin museum.

Some cope; some don’t. “‘Either they work hard, but abroad, like me,” said a Ukrainian woman, a house cleaner in Poland. “Or they sit in their village and whack a stick against a tree in the hope that a pear might fall.”

Much, perhaps, as a bear might. But there the comparison ends. Szabłowski’s analogy is clever but perhaps too clever; what he has in “Dancing Bears” is two halves of two good books. Each should get its due.

Dancing Bears
By: Witold Szablowski, translated from the Polish by Antonia Lloyd-Jones.
Publisher: Penguin Press, 233 pages, $16.