# Solve for P

Discussion in 'Math' started by spinnaker, Nov 28, 2009.

1. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
4,866
988
I swear every time I get away from basic Algebra for a while I forget everything. Boy do I feel dense!

I have the following formula.

L = P * (P - 1)

But I want the formula so I can plug in L and get a value for P.

I kind of did it brute force and the best I could figure is that P = SQRT(L), then round up the result. But somehow I don't think that is exactly right.

I think it is:

L= P^2 - P

but that is were I get stuck. Not sure how to proceed from there.

2. ### S_lannan Active Member

Jun 20, 2007
247
2
from there use the quadratic formula

rearrange it so p^2 - p - l = 0

here's how wolfram alpha does it, in a different way
http://www.wolframalpha.com/input/?i=solve+p^2+-+p+%3D+l+for+p

3. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
4,866
988

This is a really cool site!

What I don't understand is that it produces two results. The first one does not appear to be correct.

Results:

4. ### mik3 Senior Member

Feb 4, 2008
4,846
63
It produces two results because if you plot P you will see that it crosses the x axis twice.

5. ### BillO Well-Known Member

Nov 24, 2008
985
136
It has two values because L is a quadratic function of P. It is a property of all quadratic functions, defined over a domain of all R that there will be two values in the domain for every value in its range (except one, at the apex of the parabola. In this case when P=1/2 is the only time that L=-1/4).

Mathematically this is the correct solution, however, physically, only one solution may have meaning. Is this the whole problem or is part of something else?

BTW, haven’t seen you over at the 6502 forum in a little while.

Last edited: Dec 1, 2009
6. ### syed_husain Active Member

Aug 24, 2009
61
5
try it in this way:

p^2 - p = L
=> p^2 -2*0.5* p+0.5^2 -0.5^2=L
=>(p-0.5)^2= L+ 0.5^2
=>p= 0.5 ± √(L+0.5^2)

now u can plug in value of L to get value for p.

7. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
4,866
988
It is for a Charileplexing calculator / designer I am working on.

Yes I was on the 6502 forum. I will be back!

8. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
4,866
988
Thanks I got it working but I will check out your formula too.

9. ### BillO Well-Known Member

Nov 24, 2008
985
136

Still working on that KIM display then?

In that case you want:

P=1/2(1+(4L+1)^.5)

Last edited: Dec 1, 2009
10. ### spinnaker Thread Starter AAC Fanatic!

Oct 29, 2009
4,866
988
Yes!

But I may get side tracked. I belong to a home owners association and our charger for our solar light went belly up. I got the crazy notion to create a PIC controlled charger.