Message Boards Message Boards

0
|
22057 Views
|
22 Replies
|
8 Total Likes
View groups...
Share
Share this post:

How do I find x in a polynomial when x is approximate?

Posted 12 years ago
I have difficulty programming to find x in a polynomial. I try NSolve to set the equation to zero and solve for x.
If N = 85, x= 5, and y = 17

I have an equation:
y = sqrt((N * y – x^2)/x)
as an approximation of the larger Prime product (or any possible product)

My equation as it stands does not find x. I know there is a margin of error in the equation. This error can be subtracted to get a closer approximation. For example:
In the following equations: y = 17.2941176471 = 16.8522995464 This is the answer when subtracting the 2 equations below to find x knowing only N. Look at the Yellow.

So as the equations approach 0 (plus the margin of error). So since it is an approximation I need to find those values that are less than 1 and greater than 0. But 16.9082 is the value of the equation and not the value of x which should be found.
I need help programming this. So if anyone can help it would be much appreciated.
y = sqrt[(((85/x) * 85 - x^2)/ x) ]= ((85^2/x) + x^2)/ 85

p = ((((85^2/x) + x^2)/ 85 ) ^2)- (((85/x) * 85 - x^2)/ x )^2 - 0.4418181007  ;

sol = NSolve[p?0, x]

{{x?-86.8953},{x?82.8717},{x?23.3122},{x?-7.50642+19.0312 ?},{x?-7.50642-19.0312 ?},
{x?-10.592+14.3276 ?},{x?-10.592-14.3276 ?},{x?16.9082}}
y = sqrt[(N * y - x^2) / x]
y = sqrt[(7872197 * 3191 - 2467^2) / 2467]

You can see this work at http://www.3dbuzz.com/forum/threads/200441-New-One-Way-Function/page2
Look at the last page first.
Also my website is www.constructorscorner.net
POSTED BY: Bobby Joe Snyder
22 Replies

Sorry my browser wasn't working with the reply menu. I didn't have trouble else where. But here is a link to a PDF that explains everything.

Click Here

POSTED BY: Bobby Joe Snyder
Posted 11 years ago
If you go back and look at your last three postings I think you will see what I see, a number of places where you have 2\ and even one 85/\
and, unless I'm just having a bad day, I think it is difficult for any reader to know exactly what those are supposed to mean.

I am guessing that you are using "special characters" in your Mathematica notebook and then pasting from your notebook to the forum.
I am guessing that those "special characters" then paste as a backslash, an open square bracket, a name for the character and a closing square bracket.
I am guessing that the posting process is then "eating" your brackets and the name.
The result is I believe something that is even more difficult to guess than if the brackets and name were present.

I don't believe this will solve all your problems, but I think it will help if you do one of three things,
1: use "ordinary characters" for your variable names in expressions,
2: learn how to use "the orange spikey ball" above the posting box to post Mathematica code fragments with less damage done,
3. manually insert a single blank space before and after every opening or closing square bracket after you have pasted.
(This last one appears to confuse the posting software into submission and it then appears to give up and just display what you entered)

1 means you don't get to make it look like fancy published math.
2 means you have to learn how to coax that to work.
3. means if someone is going to scrape-n-paste into Mathematica they may have to remove the spaces.
But any one of those, if carefully and successfully done, should help readers be able to understant a little more.

There are probably much bigger issues to deal with for your problem, but starting with the basics is good.
(You could even carefully edit your previous three postings to utilize 1 or 2 or 3 and that might be very helpful)

Please test this carefully, inspect the result after clicking Publish, and go back and manually edit and Publish
and repeat as needed until the results are finally correct and readable and possibly even understandable.
POSTED BY: Bill Simpson
A simple trigonometric definition:

s = R\

A vector where x + y = N


But this isn't useful in this form so we solve with a triangle that is similar that we do know some values.


"x" is the value we are solving for. We know N - ((y/2\). The obtuse angle between the 2 "x" radiuses is (y/2\). This is if we had
taken the angle of y and rotated it around the cirlce with radius "x". So "x" * "y" equals N. And as in the trigonometric definition s = R\.

But we know that the smaller, similar triangle n = (N/x) / 2\) by inspection. (Where N is the given product of 2 Prime numbers
and the angle wraps around the circle is divided by 2\. And we know that y = (N/x).

So by vector division u + v = the longest chord or N. So we form the following equation:

|tan(y/(2\))| * x + x = (y/(2\))

substitute (N/x) for y

|tan((N/x)/(2\))| * x + x = ((N/x)/(2\))

multiply both sides by x

|tan(N//(2\))| * x + x^2 = (N/(2\))

example where N = 85

|tan(85//(2\))| * x + x^2 = (85/(2\))
POSTED BY: Bobby Joe Snyder
only derived by logic not tested:    ((85/\) / 2\) = x*(remander of (y/2\)) where N= 85
POSTED BY: Bobby Joe Snyder
I know what you are thinking after the last equation: "You call yourself Trurl the Constructor and  you throw a junk equation into an already hard to follow problem?"

Well I will show you a relationship between Prime numbers that doesn't take Mathematica to calculate some high degree polyonmial. But you may say, "There are infinitely many of such relationships. What makes this one significant?"

Nothing. An equation is only as significant as you make it. I just saying we are taught that Prime numbers are impossible to work with and I say they are not.


Where x = 571 and y = 1381

1381 / 2\ = 219.7929764

2\ * (remainder(1381/2\) * 2\) * 571 = 13208.65186
rewritten: 2\ * ((1381/2\-whole number part) * 2\) * 571 = 13208.65186

13208.65186 / (1381/2\) = 60.09

13208.65186 / 60.09 = 219.7929764

219 = 219

So judge for yourself if this is significant. This is very confusing so I hope I wrote this down right. But as I once invented a machine that made all things "N'. Numbers. I am in the business of constructing numbers.

If the last equation didn't work logically. But sometimes you plug numbers into a calculator along the lines of your equation and it gives you a "feel" for what is happening with those numbers.
________________________________________________________________________________________________________________________________
New equations:

2\ * (remainder (17 / 2\)) = 4.42

4.42 * 5 = 22.1

22.1 * (5 / (17* 2\)) = 0.884

0.884 * 5 = 4.42

4.42 = 4.42
POSTED BY: Bobby Joe Snyder
I don't follow most of this but I can answer the last question. No, it (NSolve-based methods) cannot be
programmed to factor the product of two large primes.
POSTED BY: Daniel Lichtblau
Sqrt[(85*(85/x) – x^2)/ x] = y

Abs(tan(85 / (2*Pi))) * x + x = 85/(2*Pi) tan in radians of course.

((85^4/x + 2*(85^2 * x^2) + x^5) / 85^3 ) * x – 85 = 0
________ These three equations solve show how two Prime numbers x and y equal 85.
This is important because in asymmetric cryptography such as RSA, the public key is the product of 2 unknown Prime numbers. If we can set a relationship to find x or y when given N, which in this case is 85, the one way function that RSA is based on is mathematically defeated!!!


_______ So if we set equation 1 equal to equation 3 the polynomial produced, if solvable, will solve for x.

Equation used to find 5 knowing 85:
((85^4/x + 2*(85^2 * x^2) + x^5) / 85^3 ) – 0.6 = Sqrt[(85*(85/x) – x^2)/ x] + 0.15
= approxiamtely 5.02 when solved by Wolfram Alpha!

I believe this will defeat RSA. However no one believes me or just doesn’t care. To me it is interesting, but when I ask people about it no response. If it worked I think it would go viral. What do you think?
POSTED BY: Bobby Joe Snyder
I truly believe this problem has merit. It took 2 seconds to dream it up as Prime numbers being wrapped around a logarithmic spiral and 5+ years to write it all down. I do not want to dwell on this problem. I have spent a lot of time on it. My next step is to show how the logarithmic spiral should work.

I would not have an estimate of which numbers to try as the Prime products if it were not for Wolfram Alpha (Mathematica).

I sent it to a library researches and they basically said to call them back when I can factor a 256 bit number. So there is still work to test to see if it works. But I see something here and hope others see it too.

I was hoping this had merit and went viral. So far I estimate over 10,000 views. But it wouldn’t matter if it doesn’t work.

@ Bruce Miller

You showed me how to find x knowing y in Mathematica code. Do you believe that the last equation solves for x knowing only N?
POSTED BY: Bobby Joe Snyder
"Do you believe that the last equation solves for x knowing only N?"

The last few equations in the thread do not have an N. 

Find the equation you mean. If it has only x's, N's, and numbers, then there could
probably be at least an implicit numerical solution. I don't know now if a symbolic
solution would exist.
POSTED BY: Bruce Miller
Looks like a reasonable approximation to a root.
In[13]:= FindRoot[Abs[Tan[(85/(2*Pi))]]*x + x - 85/(2*Pi) == 0, {x, 2}]
Out[13]= {x -> 5.55835870667}
POSTED BY: Daniel Lichtblau
Daniel,

This solution is deceiving. The angle is in radians of course. But does it work for other values of N?

The answer is not exactly. There is some range of error. Also I made a algebraic mistake in the simplification.

But if this is fixed and there are test values it does seem to have some use. But solving for N proves difficult.

My question is does the following show any benefit from my effort?

 y = sqrt[(((85/x) * 85 - x^2)/ x) ] = ((85^2/x) + x^2)/ 85
 
 In[27]:=
 p = ((85/x) * 85 - x^2)/ x - (( 85^2/((85^2/x) + x^2) ) ^2);
 
 sol = NSolve[p == 0, x]
 
 Out[28]= {{x -> -36.2894}, {x -> 27.7376 + 21.7226 I}, {x ->
    27.7376 - 21.7226 I}, {x -> -10.093 + 32.5167 I}, {x -> -10.093 -
    32.5167 I}, {x -> 9.44493}, {x -> 0.257048 + 9.23565 I}, {x ->
   0.257048 - 9.23565 I}, {x -> -8.95875}}


This is still an approximation. In the above example 9 solves the equation better than 5. That is where 5 should be the desired answer. N = 85; x = 5; and y = 17 . So there still isn't a perfect solution just estimated. But take:



In[31]:= y = sqrt[(N * y - x^2) / x]

y = sqrt[(7872197 * 3191 - 2467^2) / 2467]

Out[31]= sqrt[(-x^2 + N sqrt[(-x^2 + N sqrt[(-x^2 + 1/85 N (7225/x + x^2))/x])/x])/x]

Out[32]= sqrt[10180014]


So sqrt of 10180014 = 3190.613421 which is approx y or 3191.

The above substitution shows it works for larger values of N. Can it be programmed to factor the product of 2 large Prime Numbers?
POSTED BY: Bobby Joe Snyder
If the goal really is to find the integer factors, perhaps one could just use Solve or FactorInteger.
In[17]:= Solve[x y == 85 && 1 < x < y, {x, y}, Integers]
Out[17]= {{x -> 5, y -> 17}}
In[18]:= FactorInteger[7872197]
Out[18]= {{2467, 1}, {3191, 1}}
POSTED BY: Ilian Gachevski
Using vector addition I have another equation. I can keep making these and maybe I will find a helpful relationship. But it does no good to find an equation in polynomial form if I cannot solve for x in the polynomial.

This time I keep it simple. My question is does this accomplish anything?

Abs[tan(y / (2*Pi))]*x+x=(y ? ((2*Pi)))
POSTED BY: Bobby Joe Snyder
http://www.wolframalpha.com/input/?i=Abs%28tan%2885+%2F+%282*Pi%29%29%29+*++x+%2B+x+%3D+85%2F%282*Pi%29

Abs(tan(85 / (2*Pi))) *  x + x = 85/(2*Pi)



comes to 5.5 in Wolframalpha.

Is this anything?
POSTED BY: Bobby Joe Snyder
To get a value for x, you need y.  With just n, you can get a relationship between x and y.
 In[1]:= soln = Solve[y == Sqrt[(n*y - x^2)/x], x]
 Out[1]=
        1    2                 4           1    2                 4
 {{x -> - (-y  - Sqrt[4 n y + y ])}, {x -> - (-y  + Sqrt[4 n y + y ])}}
        2                                  2
 
 In[2]:= soln /. {n -> 85, y -> 16.85229955}
 Out[2]= {{x -> -288.957}, {x -> 4.95729}}
 
In[3]:= soln /. n -> 85

Out[3]=
       1    2                 4           1    2                 4
{{x -> - (-y  - Sqrt[340 y + y ])}, {x -> - (-y  + Sqrt[340 y + y ])}}
       2                                  2

In[4]:= $Version
Out[4]= "9.0 for Mac OS X x86 (64-bit) (January 24, 2013)"

In this plot, y is the horizontal axis and x is the vertical axis.
In[5]:= Plot[Evaluate[x /. soln /. n -> 85], {y, -30, 30},
     PlotStyle -> {{Blue, Thick}, {Red, Thick}},
Frame -> True, GridLines -> {None, {0}}, FrameTicks -> All]
POSTED BY: Bruce Miller
Bruce can you work your Mathematica magic on this?

Sqrt[((85*(85/x)) - x^2)/x] - (( 85^2/((85^2/x) + x^2) ) ^2) = 0

Plugged into Wolfram Alpha this yields for x :  x is approximately 4.42297

Getting pretty close to 5 not knowing y!

This is a margin of error in the 2 equations that are subtracted about 0.599

Is this any closer to solving knowing only N?
POSTED BY: Bobby Joe Snyder
y = sqrt[(((85/x) * 85 - x^2)/ x) ] = ((85^2/x) + x^2)/ 85


p = ((((85^2/x) + x^2)/ 85 ) ^2) - (((85/x) * 85 - x^2)/ x )^2 -
   0.4418181007  ;

sol = NSolve[p == 0, x]

{{x -> -86.8953}, {x -> 82.8717}, {x ->
   23.3122}, {x -> -7.50642 + 19.0312 I}, {x -> -7.50642 -
    19.0312 I}, {x -> -10.592 + 14.3276 I}, {x -> -10.592 - 14.3276 I}, {x ->
   16.9082}}


This is still an approximation. In the above example 9 solves the equation better than 5. That is where 5 should be the desired answer. N = 85; x = 5; and y = 17 . So there still isn't a perfect solution just estimated. But take:



y = sqrt[(N * y - x^2) / x]

y = sqrt[(7872197 * 3191 - 2467/^2) / 2467]
POSTED BY: Bobby Joe Snyder
In[14]:= soln = Solve[y == Sqrt[(n*y - x^2)/x], x]

soln //. {n -> 85, y -> 16.85229955} // N

Out[14]= {{x -> 1/2 (-y^2 - Sqrt[4 n y + y^4])}, {x ->
   1/2 (-y^2 + Sqrt[4 n y + y^4])}}

Out[15]= {{x -> -288.957}, {x -> 4.95729}}



Bruce I am in your debt. You helped show the equation works. I moved a parenthesis to correct.

But the equation works. Unfortunately there is still the difficult task of solving the polynomial only knowing N. I isolated x, but does that help knowing only N?

The problem is this. I know N, I don’t know that we can solve polynomials. Because I know N and say if 17 where tried it would equal 5.

I have an equation with x unknown, but the only variable in the equation is x. So interval proves those values are true. But can we solve the polynomial for x only knowing N?
POSTED BY: Bobby Joe Snyder
Have you tried Interval?
 In[1]:= soln = Solve[ y == Sqrt[(n*y - x^2)]/x, x]                                     
 
                  Sqrt[n] Sqrt[y]          Sqrt[n] Sqrt[y]
 Out[1]= {{x -> -(---------------)}, {x -> ---------------}}
                             2                        2
                   Sqrt[1 + y ]             Sqrt[1 + y ]
 
 In[2]:= soln //. {n -> 85, y -> 17} // N                                               
 
Out[2]= {{x -> -2.23221}, {x -> 2.23221}}

In[3]:= ?Interval                                                                      
Interval[{min, max}] represents the range of values between min and max.

In[4]:= soln  //. {n -> 85, y -> Interval[{16.8523, 17.294}]}                          

Out[4]= {{x -> Interval[{-2.27109, -2.18484}]}, {x -> Interval[{2.18484, 2.27109}]}}
POSTED BY: Bruce Miller
Sorry for the delay. I much value your opinion. I have been trying for 6+ years in my spare time to find a pattern of Prime numbers in a logarithmic spiral. This here is not a pattern in Prime numbers, but a description of multiplication.

The N = p *e

I am saying knowing N I can find p the smaller product. My example is 85 = 5 * 17

The trouble is it is a polynomial which means that the equation is difficult if not impossible to solve. Better methods of solving polynomials need to be found. I have not learned higher mathematics  beyond linear algebra, so I rely on Mathematica which crunches numbers.

The trouble is both sides of the equation are equal. That is, they both equal  17. But my equation when solving for x = 17 for the single case of 85 = 5 * 17. What I don’t know is why I plug 5 in for x and 85 for N it equals (with a margin of error) 17.

Is my method of programming Mathematica wrong? Why can’t I solve for x?

I hope this clears up my question, but if it is still unclear let me know. The code is posted below.

BTW I am looking at interval now. Thanks for the direction.
POSTED BY: Bobby Joe Snyder
The code as presented in the first web page you  link to is easier to read.
The -> for Rule and I for Sqrt[-1] come across better than special characters.

Using a Mathematica built-in function name (N) as a user variable name is asking for trouble.

It wasn't clear from the code above or the link if "sqrt" is your own function or
a mis-capitalized Sqrt.
POSTED BY: Bruce Miller

Group Abstract Group Abstract