User:Jhannah

Jay Hannah, Omaha NE, USA

jays.net

Room Count for Share-with Reservations
Day of week: MTWRFSS res1 xxxxxxx   los 7 res2 x         los 1 res3 xxx       los 3 res4  xx       los 2 res5    x      los 1 res6     xx    los 2 Occupancy:   3332221 res1 rcnt: 0.4375 res2 rcnt: 0.0625 res3 rcnt: 0.1875 res4 rcnt: 0.125 res5 rcnt: 0.0625 res6 rcnt: 0.125 TOTAL rcnt: 1

$$rcnt(r) = \frac{los(r)}{\sum_{r\in R} los(r)}$$


 * r is a reservation in this share-with
 * R is the set of all reservations in this share-with
 * los is length of stay
 * rcnt is room count

Source code
my @los = ( 7,1,3,2,1,2 ); my $los_total; foreach (@los) { $los_total += $_; } my $rcnt_total; my $res_num = 1; foreach (@los) { my $rcnt = $_ / $los_total; $rcnt_total += $rcnt; print " res$res_num rcnt: $rcnt\n"; $res_num++; } print " TOTAL rcnt: $rcnt_total\n";

Other Math Junk
aka shoot me now. Math markup help.

Binomial distribution

$$P(n) = {N! \over n!(N-n)!} p^n q^{N-n}$$
 * N: the fixed sample size
 * p: the probability that one thing has the characteristic
 * q: the probability that it doesn't (1-p)