NEW YORK — The latest exhibit at the National Museum of Mathematics in Manhattan was supposed to have been put on display last fall, except it was not quite working.

It’s called “Beaver Run,” but the way things were going, “Beaver Derailment” would have been more accurate.

“We could have opened it, and it would have been unsatisfactory,” said Cindy Lawrence, the executive director of the museum, popularly known as MoMath.

So the museum decided to gnaw at the problem a while longer.

The concept is straightforward. Two mechanical beavers move along winding tracks, which visitors can reconfigure using a panel of 24 knobs. Each twist of a knob causes a corresponding turntable to pivot 90 degrees, and that switches the connections between segments of track.

One of the mathematical truisms underlying Beaver Run is that never shall the two beavers meet.

“That is a fact,” said Glen Whitney, MoMath’s founder and president. “No matter how I turn this sequence of knobs — and it seems as though I have complete power to reconfigure these tracks, make the beavers go wherever I want them to — nevertheless, I will never be able to make the beavers meet each other.”

That truism is subject to a few conditions. For one, the two beavers cannot be placed on the tracks so they just run into each other. Another restriction is that one cannot turn a turntable while a beaver is on it, thus depriving visitors the glee of sending the animals careening off the tracks across the miniature swamp and forest landscape. Finally, the two beavers have to trundle at the same speed, in synchrony from turntable to turntable.

“The important thing that you need to know is that when Beaver 1 is passing a junction, Beaver 2 is passing some other junction somewhere else on the board, simultaneously,” Whitney said.

That was the tricky part. The internal locomotion of the beavers comes from identical electric motors from model railroad trains, but they did not run at exactly the same speed.

First, the exhibit makers attempted a crude fix. Sensors next to the tracks note the positions of the beavers, and when one got too far ahead, the software cut off power to that beaver, bringing it to a jolting stop for a moment until the other caught up.

That, said Geva Patz, a museum volunteer who was finally able to make Beaver Run run, “doesn’t fit very well with the notion of busy beaver — knocking off for a tea break every 20 seconds.”

It was also not a very good solution. The jerky stops and starts also sometimes partly derailed the beavers, severing the electrical connection.

The museum staff knew the programming and tinkering expertise of Patz, a founder of Android Alpha, an options trading financial firm, and asked him to take a look.

“It became clear, after lots of testing, we needed something more sophisticated,” Patz said.

Patz’s fix was to add brains to the beavers — small computer chips with Wi-Fi modules. Now, the exhibit sends instructions to the beavers to speed up and slow down, almost imperceptibly, to stay synchronized, and they derail less often.

On Saturday, the exhibit was unveiled for all museum visitors to play with.

The exhibit grew out of brainstorming about Truchet tiles, named after Sébastien Truchet, a French Dominican priest who described them in 1704. The tiles are decorated with simple patterns that are not rotationally symmetric.

The Beaver Run exhibit is based on Truchet tiles popularized in 1987 by Cyril Stanley Smith, a scientist at Massachusetts Institute of Technology. On each tile, two quarter-circles connect midpoints of adjacent sides.

Timothy Nissen, the museum’s chief designer, thought of turning the quarter-circles into train tracks. “I thought, ‘Well, what if we had trains moving on a Truchet tile?’” he said. “Wouldn’t kids love that? And you could rearrange them remotely. And so I thought that would be sort of a cool idea.”

In the exhibit, the tiles can be rotated to produce 18 small circles. It is also possible to form one large loop.

Whitney, also a model train enthusiast, liked the idea, and he remembered the mathematical proof that would allow two trains to run on the tracks and never crash.

With some effort, Lawrence persuaded Nissen and Whitney to use beavers. “I had a very strong sense that trains might appeal more to boys than girls,” she said. “We thought little beavers, little animals, are more universally appealing.”

That is all part of the museum’s mission to convey the magic of math to everyone. Since the museum opened in 2012, 465,000 visitors have passed through its doors on East 26th Street. “We want to get people curious about why the beavers are not meeting and hopefully get a glimpse into the reason why mathematicians are interested in doing proofs and the power those proofs provide,” Whitney said.

Those intrigued by Truchet tiles can find more at the museum.

“If you venture into one of our bathrooms and look at one of the tile walls, you will see another Truchet tiling,” Lawrence said. “If you look really carefully, you will see a hidden message.”