|
|
john wrote:
> David T. Ashley wrote:
> > "Ted Hwa" <hwatheod@xxxxxxxxxxxxxxxxxx> wrote in message
> > news:en7pbn$8ac$1@xxxxxxxxxxxxxxxxxxxx
> > >
> > > Suppose instead the lane were 30 feet long. Then how many saplings are
> > > needed? That should help you see the reasoning.
> >
> > Additional hint: This type of problem comes up SO often in integer
> > arithmetic.
> >
> > One might say, if L is the length of the lane, that the number of saplings
> > required is:
> >
> > floor(L/30) + 1
> >
> > And of the two terms above ... guess which one you're not seeing?
> >
> > Additional hint #2: If all else fails, get a roll of quarters and 9 decks
> > of playing cards. Each card can be one foot of length, and each quarter can
> > be a sapling. For approximately $35 or less, you can figure out what you're
> > not seeing ... And of the $35, you can get $10 back (the roll of quarters
> > can still be used as money).
>
> Thanks everyone.
>
> Yeah I've sen this type of problem so often. I didn't even know there
> was a name for it. As usually i'm off by 1. I guess there is many
> different ways to word the problem to either indlude or exclude the
> initial sapling...
>
> IF they ask for all the numbers that can be included then I guess I
> woudl use the floor... What type of scenarios will you exclude that 1
> in Floor(L/30)+1 ?
>
> It seems like there should be a particular way of wording that..
> .
>
> I'll also start a new thread on a few problems I got wrong tonight.
>
> thanks again
To boil this down the most basic form, ask yourself this question:
How many integers are there from 1 to 10, inclusive? But rather than
just say "10", solve it as your problem, with a path starting from mile
maker 1 going to marker 10, with trees every mile, starting at 1.
You start at 1, and go to 10, couting by 1s, so (last - first) / rate =
(10 - 1) / 1 =9 (obviously the wrong answer, 1 too small).
This is how you got 15 in your original problem. (first = 0, last =
450, counting by 30s; (last-first)/rate = (450 - 0) / 30 = 15).
remember that the distance is (far point - near point), which is why I
used the last-first form above, and as you see, using this set up makes
you consistantly miscount by 1.
|
|