Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.advocacy > #647099

Re: A Problem To Solve :-)

From Physfitfreak <Physfitfreak@gmail.com>
Newsgroups comp.os.linux.advocacy
Subject Re: A Problem To Solve :-)
Date 2024-01-20 17:12 -0600
Message-ID <uohk04$ndab$2@solani.org> (permalink)
References <uog01l$mi9n$1@solani.org> <17ac13c4ae353932$16712$1979536$802601b3@news.usenetexpress.com>

Show all headers | View raw


On 1/20/2024 8:14 AM, Farley Flud wrote:
> On Sat, 20 Jan 2024 02:25:22 -0600, Physfitfreak wrote:
> 
>>
>> Every day, from then on, he climbed another 11 yards, and every night
>> the mountain grew another 100 yards taller, taking him a bit higher with
>> it.
>>
>> Did Physfit reach the summit? If he reached, why he could reach it, and
>> how many days total it took him to get there? And if he could not reach
>> it, prove why he couldn't reach the summit.
>>
> 
> Nice  problem.  But it falls easily to a mathematician.
> 
> He reached the summit on day 4983.
> 
> Let the day numbers be n.  The following table shows the height of
> climb and the height of mountain at the end of the day:
> 
> (Need mono-space font)
> 
> Day n	height-of-climb		height-of-mountain
> 
> 1	11			100
> 2	33			200
> 3	60.5			300
> 4	91.67			400
> ...
> 
> At the end of the n-th day the height-of-mountain = 100*n
> and the height-of-climb is:
> 
>                        n-1
> 		     ====
> 		     \	   n
> 		( (   >	  --- )  +  1 ) * 11
> 		     /	   i
> 		     ====
> 		     i = 1
> 
> 
> i.e. (summation (n/i, i, 1, n-1) + 1) * 11
> 
> This is just the harmonic series multiplied by n.  It will
> converge quickly.
> 
> At end of day 4983 we get:
> 
> Day n	height-of-climb		height-of-mountain
> 
> 4983	498310.65		498300
> 
> 
> But wait!  That mutherfucker doesn't reach the top because
> he would starve to death after 3-4 weeks.
>


Hehe :) You got the right answer.

Here is the simple qbasic code for it:

phys = 11
mount = 100
n = 2

do
   Phys = (n/(n-1))*phys + 11
   mount = mount + 100
   if (mount - phys) < 0 then exit do
   n = n + 1
loop

     print, "days climbed = "; n
     print, "Physfit's height = "; phys
     print, "mountain's height = "; mount


Piece of cake really. But after carefully writing the math before 
embarking on coding it, as usual.

The fact that nobody else answered this says a lot about the validity of 
what you've been telling about them here :)

With my qbasic version 1 (on my S20 ThinkStation with Win10, using 
DOSBox-X emulation) which is very slow, it takes 7 seconds for the 
output to appear.

The rest of the story:

Needless to say, after more than 13.5 years of climbing, Physfit's age 
had taken him to a stage in life that he could not even think of going 
back down and going home. So he dropped his last National Cup tea-bag 
into the hot water and began thinking to himself, "Now when I look down 
I can only see the lower parts of this mountain; no sign of an Earth 
underneath it; so I will spend the rest of my life here at the summit, 
inside my sleeping bag, watching all these stars above me ..."










Back to comp.os.linux.advocacy | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

A Problem To Solve :-) Physfitfreak <Physfitfreak@gmail.com> - 2024-01-20 02:25 -0600
  Re: A Problem To Solve :-) Farley Flud <ff@linux.rocks> - 2024-01-20 14:14 +0000
    Re: A Problem To Solve :-) Physfitfreak <Physfitfreak@gmail.com> - 2024-01-20 16:47 -0600
      Re: A Problem To Solve :-) rbowman <bowman@montana.com> - 2024-01-20 23:47 +0000
        Re: A Problem To Solve :-) Physfitfreak <Physfitfreak@gmail.com> - 2024-01-20 23:39 -0600
          Re: A Problem To Solve :-) rbowman <bowman@montana.com> - 2024-01-21 22:37 +0000
    Re: A Problem To Solve :-) Physfitfreak <Physfitfreak@gmail.com> - 2024-01-20 17:12 -0600
      Re: A Problem To Solve :-) Farley Flud <ff@linux.rocks> - 2024-01-21 11:50 +0000
        Re: A Problem To Solve :-) DFS <nospam@dfs.com> - 2024-01-21 11:32 -0500
        Re: A Problem To Solve :-) Physfitfreak <Physfitfreak@gmail.com> - 2024-01-21 16:07 -0600
  Re: A Problem To Solve :-) % <pursent100@gmail.com> - 2024-01-20 11:02 -0700

csiph-web