help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems of everyday life


From: North Year
Subject: Re: problems of everyday life
Date: Wed, 16 Nov 2022 15:54:01 -0500
User-agent: mu4e 1.8.10; emacs 28.2

Emanuel Berg <incal@dataswamp.org> writes:

> If you are to boil one egg for 5 minutes, the other for
> 7 minutes, and the third one for 10 minutes, how long time
> does it take to boil all three eggs?
>
> In Lisp, there are several ways to solve this, it can be
> put as
>
>   (+ 5 7 10)
>
> or maybe
>
>   (apply #’+ ’(5 7 10))
>
> or … well, what do you prefer?

This leads to a dynamic programming problem I guess.

x eggs to be boiled each of which need x_i times to be boiled.
y pots can be used to boil egges each of which has capacity to cook y_i eggs at 
one time.

Never tried to writing algorithm codes in elisp. This would be interesting.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]