Re: MLM Numbers Game
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 14, 2001
- 421 views
CK, I think my code oriented toward exactly what you have just understood, just as you originally specified. You originally specified that it was a matter of how many "up-levels" the lower levels could *support*, not the other way around, and that's what my code, I'm pretty sure, did. Could you re-examine your results of testing my code in light of your current understanding and original specifications? What you interpreted as wrong results should now be seen as right, I think. It appears that Mike's code is now similar in principle to mine, but done with superior simplicity. Mike's, I think, was originally essentially "programming" oriented, while mine was/is "math" oriented, in that mine took a solution to an equation and used that solution to determine the quantity in each tier; Mike's originally set up a "counting" type of solution, which was way longer in the *specific* instance (pre-defined support ratios, ie 20-10-10-5), but way *shorter* than mine in the generalized version (user specifies tier support ratios), though it didn't give correct results for the "up-support" conditions you originally specified. I had a suspicion that Mike's counting procedure would still be shorter and simpler than mine when corrected to your original specifications, and was looking forward to seeing that, but it looks like it was easier to make a simpler solution based on math equation solving than on counting, if I'm understanding our two methods correctly. Mike, good work! :) CK, thanks for the exercise! :) Dan ----- Original Message ----- From: "C. K. Lester" <cklester at yahoo.com> To: "EUforum" <EUforum at topica.com> Sent: Friday, October 12, 2001 1:07 PM Subject: Re: MLM Numbers Game > > Mike, seems to work. > > IMPORTANT NOTE: I've realized that EVERY level's prerequisite is simply a > minimum. > > For instance, when there are 9 Captains, I thought there should be TWO > generals, 5 for one and 4 for the other. But in our MLM scenario, it DOES > NOT work this way. You cannot promote someone to general UNTIL there are 5 > Captains for him to manage... So, Mike's get_tiers() function seems to work > properly. > > Thanks, > ck > > ----- Original Message ----- > From: "Mike Nelson" <MichaelANelson at WORLDNET.ATT.NET> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, October 12, 2001 2:35 PM > Subject: Re: MLM Numbers Game > > > > Here is a correction of my previous function: > > > > function get_tiers(integer pop,sequence tiers) > > --tiers is a sequnce of ratios, first element is ratio of > > --lowest level of leaders to grunts, second is ratio > > --of second-lowest level of leaders to lowest level, etc. > > --returns a sequence one longer than tiers, with the number of > > --each rank from grunts on up. > > --No error checking is done. > > integer num_tiers > > num_tiers=length(tiers) > > if num_tiers=0 then return {pop} end if > > tiers[1]+=1 > > for i=2 to num_tiers do > > tiers[i]=tiers[i]*tiers[i-1]+1 > > end for > > for i=num_tiers to 1 by -1 do > > tiers[i]=floor(pop/tiers[i]) > > pop-=tiers[i] > > end for > > return pop & tiers > > end function > > > > -- Mike Nelson > > > > > >