Re: [algorithms-and-data-structures] Algorithms Meetup Problem #4

 From: Deepankar Sent on: Sunday, August 1, 2010 8:06 PM
```i am sorry I meant single equation in the last sentence.

On Sun, Aug 1, 2010 at 8:06 PM, Deepankar Sharma
<[address removed]> wrote:
> I think the following substitutions allow it to be simply solved as a
> one line solution
>
> for some i between 1 and n
>
> t(i) = sqrt ( d(i) / (0.5 * g)) ? - lets call this 1
> where t(i) is the time for the ith ball to fall
> d(i) is the height of the ith ball.
>
> t(0) + t(1) .. + t(n) = T - lets call this 2
> where T is the total time which is supplied.
>
> Substituting for t(i) from 1 into 2
> (sqrt(d(1)) + sqrt(d(2)) .... + sqrt(d(n)))/ sqrt(0.5 * g) = T
>
> which gives
> g = (sqrt(d(1)) + sqrt(d(2)) .... + sqrt(d(n)))**2 / (T**2 * 0.5)
>
> where x**n = x raised to n.
>
> hence it collapses down to a single variable.
>
>
> On Sun, Aug 1, 2010 at 7:28 PM, Michael Mellinger
> <[address removed]> wrote:
>> I added a Perl solution. ?It seems I missed something in the problem
>> because my code is much longer. ?No ugly Perl shortcuts taken:
>>
>> http://github.com...­
>>
>> -Mike
>>
>>
>>
>> --
>> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
>> http://www.meetup...­
>> This message was sent by Michael Mellinger ([address removed]) from Algorithms and Data Structures.
>> To learn more about Michael Mellinger, visit his/her member profile: http://www.meetup...­
>> To unsubscribe or to update your mailing list settings, click here: http://www.meetup...­
>> Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]
>>
>>
>
```

New York, NY

Founded Jan 31, 2010

Our Sponsors

Pivotal Labs

• Vendavo

Vendavo is the leader in front-line profit optimization

• Wolfram Research

Mathematica is the world's ultimate application for computations.

• Yodle

Local online advertising for small businesses.

• Lyft

Free ride credit to try the service. Fast and safe way to get around.

People in this Meetup are also in:

• NYC Predictive Analytics

4,630 Members

• Docker New York City

3,263 Dockers

• JavaScript.NYC

2,842 JavaScripters

3,651 Quants

• Hack && Tell

3,582 Hackers

• The NYC Gotham Developers Group

5,909 members

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy