gistlib
main.mmean_lifetime = 14000; x = 19000; prob_lifetime_greater_than_x = 1 - exp(-x/mean_lifetime); 92 chars4 lines
mean_lifetime = 14000; x = 19000; prob_lifetime_greater_than_x = 1 - exp(-x/mean_lifetime);
This Matlab code calculates the probability of a new battery lasting more than 19,000 km given an exponentially distributed lifetime with a mean of 14,000 km.
gistlibby LogSnag