Dozens of miles of bike lanes across New York City are intended to make its chaotic streets safer for the growing number of commuters and tourists who prefer to pedal around, the way that crosswalks are meant to carve out a safe space for pedestrians. But like crosswalks, the safety of the bike lanes depends on the cooperation of motorists who often cross the boundaries.

Here and elsewhere, it makes for a dangerous competition that sometimes ends with someone getting hurt or killed. That was the case on Friday, when an Australian tourist on a bicycle died after she was hit by a garbage truck on Central Park West near West 67th Street around 4:45 p.m.

The truck struck the tourist, Madison Jane Lyden, 23, after she swerved in its lane to avoid a livery cab that had cut her off in the northbound bike lane.

Ms. Lyden had been visiting New York on what her parents described as “the trip of a lifetime.” Bystander video showed a crowd surrounding her as someone attempted to revive her, but she was pronounced dead at Mount Sinai West hospital.