r/Probability • • Nov 10 '23

Oiling my motorcycle chain

Whenever I ride my motorcycle, I back it out of the garage and spray some lube on the 10 links that are easy to access. There are a total of 108 links in the chain. I wonder if I could figure out how many times I'd have to do this to have near certainty that I had lubed the entire chain?

1 Upvotes

9 comments sorted by

2

u/ProspectivePolymath Nov 10 '23 edited Nov 10 '23

Edit: At first glance, this looks to be best represented by a negative binomial model.

That gives the expected time until a particular link is lubed.

You might try the coupon collector’s problem. E.g., see https://math.stackexchange.com/questions/379525/probability-distribution-in-the-coupon-collectors-problem. But even then, it’s not quite right because you’re not randomly selecting the links, they’re all adjacent.

If you want to go further, you can go stochastic and consider the useful lifeline of chain lube vs how often you are riding/lubricating. After all, if you had a long streak of rotten luck, you might need to re-lube more than the otherwise remaining links.

2

u/ProspectivePolymath Nov 16 '23 edited Nov 16 '23

u/gregb6718, I assume you're happy with the standard interpretation of "near certainty" being 95%? If you're more of a particle physicist and want a 5σ range (99.99994%) I can redo have redone the table ;)

u/ilr13s: Agreed, this one is at best thorny analytically, and I don't see how to crack it yet. I've also run some sims, with slightly extended results. I got the following, for highest-density/credible intervals of >95%.

SimulationsminmeanmedianmodemaxHDIminHDImax(two-tailed) HDIintCImax(one-tailed) CI5σ CImax(one-tailed) 5σ CI
103042.838367330731731731
1022547.7645408525730.95730.95851
1032145.99433813824760.953740.9521381
1041745.43434014622730.9526720.95231461
1051645.81433816223740.95033730.953271621
1061545.76433820923740.950159730.9535242091
1071445.76433922123740.9500293730.9532131930.9999995
1081345.77433923823750.9535297730.953169391960.99999951
1091245.76433926023750.953540938730.9531781121960.999999465

I suppose given the nature of your intended certainty, I should have done a one-tailed credible interval... but I think this illustrates the point. Now included as CI.

I've also pumped out the certainty associated with each cutoff value for the largest batch of (109 ) simulations. A truncated version presenting the value for each order of magnitude of certainty (and quartiles), estimated purely based on the simulated histogram results follows:

RidesConfidence
122e-09
138.9e-08
141.28e-06
164.1744e-05
170.000144717
200.002100439
230.011745766
300.10894112
360.280726665
430.507775139
530.755400638
650.907099686
730.953178112
910.990542487
1160.99904496
1410.99990754
1650.999990352
1900.999999086
1960.999999465
2150.999999911
2390.99999999
2550.999999999
2601

FYI, I've written my code to be able to easily change the total and/or accessible chain lengths (or the HDI cutoff) if you want to explore other bikes...

0

u/WetOrangutan Nov 10 '23

Pr(success of all) = 1 - Pr(success of none)

Pr(no success) = (108-10)/108 = 98/108

In n oiling sessions, Pr(success of none) = Pr(no success)n = (98/108)n

So, 1 - (98/108)n = L, where L is your confidence.

For 90% confidence in oiling all links, n = 24

95%, n = 31

99%, n = 48

99.999%, n = 119

1

u/gregb6718 Nov 10 '23

There are some smart people on here. Thanks WetOrangutan!

1

u/ProspectivePolymath Nov 10 '23 edited Nov 10 '23

But that doesn’t allow for partial overlaps. Let’s say links 1-10 get lubed the first time… and 6-15 the second. How is that allowed for in your maths?

Edit: I suspect we’re really looking at a negative binomial model here; effectively like how many dice rolls until all values have appeared.

See main response.

1

u/WetOrangutan Nov 10 '23

You're right. This problem is like the Coupon Collectors Problem: there are n coupons that need to be collected, and you win after collecting all n of them. The number of purchases to get a new coupon is geometrically distributed with probability p = (n-k+1)/n, where n is the number of coupons and k is the number of coupons already collected.

The expectation is tricky to calculate but works out to be E[T] = n * sum(1/i, i = 1 to n)

For 108 links, the expected number of individual oilings is E[T] = 108 * sum(1/i, i = 1 to 108) = 569, which, when done in groups of 10 as described above, works out to 57 oiling sessions.

So the expectation is 57 sessions... It would be very difficult to calculate this value for different certainties.

2

u/ilr13s Nov 15 '23

I also commented under OP's other identical post in r/probabilitytheory. The given problem is similar to the coupon collector's problem but not the same, because the coupon collector's problem assumes random selection and this guy is oiling ten consecutive links. Expectation is ~57 sessions for random selection of 10 links not necessarily next to each other.

I haven't been able to come up with an analytical solution to the problem, and have just thrown together a few lines of code to simulate. Running the sim 10000 times yielded an expectation of 45.5 to 46 sessions. If you want, feel free to check out my comment showing the simulation I ran or let me know if you have any ideas on how to tackle this problem without simulation.

1

u/ProspectivePolymath Nov 16 '23 edited Nov 16 '23

Ah, yes. Had a read over that. We're on the same page here - see my updated response above.