# Solve for P

#### spinnaker

Joined Oct 29, 2009
7,815
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.

#### S_lannan

Joined Jun 20, 2007
247
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

#### spinnaker

Joined Oct 29, 2009
7,815
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

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.

• Mathematica form

Results:

#### mik3

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

#### BillO

Joined Nov 24, 2008
992
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:

#### syed_husain

Joined Aug 24, 2009
61
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.

#### spinnaker

Joined Oct 29, 2009
7,815
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.
It is for a Charileplexing calculator / designer I am working on.

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

#### spinnaker

Joined Oct 29, 2009
7,815
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.
Thanks I got it working but I will check out your formula too.

#### BillO

Joined Nov 24, 2008
992
It is for a Charileplexing calculator / designer I am working on.

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

Still working on that KIM display then?

In that case you want:

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

Last edited: