Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

I entered this: pslq([92,1,5,10,25])

and output is [0, 0, -1, -2, 1]

I don't know what I'm missing!

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Hi;

That answer is right but it is not very useful. It says:

0*92 = 0*1 - 1*5 - 2*10 + 1 * 25

Maybe if you enter the values as floating point? [92.00000000000000000, 1.000000000000000000, 5.0000000000000000, 10.000000000000000, 25.000000000000000]

Adjust the number of zeros to match your precision.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Still no fruit.

I think it's not problem with precision, still looking around.

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Hi gAr;

Continue working with it. It may be that the algorithm I am using is the best. I am just looking at a site where his pslq blows up for some inputs while mine keeps on going.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Ok. This one stops after one solution. Does not continue to search other solutions.

Looking for way to control that.

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Hi gAr;

Are you saying that you got a solution?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

I mean the vector which is not useful here.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Hi gAr;

At the bottom of this page is a Sage implementation ( I think ) of the PSLQ. It is very similar to mine. Check it out and see what you think.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

I went there when you first mentioned about PSLQ. I'll read again and see if I can get something.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Or I can give you mine and we can start translating it. That would make compatibility between our answers.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

That's okay with me.

I found this link useful from the sagetrac page: http://crd.lbl.gov/~dhbailey/mpdist/

But got a runtime error when running mathtool.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

I should have run mathinit before that. Now it's ok.

pslq[92,1,5,10,25]

PSLQM1 integer relation detection: n = 5

Iteration 0 MP initialization

Iteration 0 Start MP iterations

Iteration 3 itermp: Small value in y = 0.000000D 0

Iteration 3 Relation detected

Min, max of y = 0.000000D 0 1.041723D -2

Max. bound = 1.017072D 0

Index of relation = 1 Norm = 4.000000D 0 Residual = 0.000000D 0

CPU times:

0.00 0.00

Relation: 0 =

+ 1.* 92

+ -2.* 1

+ -1.* 5

+ -1.* 10

+ -3.* 25

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Very good! I think you understand computers. You have to play with them, and then force them to do what you want.

That shows that we can solve some diophantine equations with the PSLQ.

Supposing we need to find one integer solution to

95 c - 40 b -499 a = 141

We would just PSLQ this vector [ 141, 95, - 40, -499]

What do you get?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Yes, I get

Relation: 0 =

+ 4.* 141

+ 1.* 95

+ 4.* -40

+ 1.* -499

I need to force it to check for every possible solution!

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

I got another solution different than that.

a = 1

b = 3

c = 8

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Perhaps pslq is more appropriate for real numbers.

Does your algorithm give all the possible values for integers?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

No, I never figured out how to coax it to get more of them. In some cases in the solution of equations when you have one solution you can get others by using some math at that point.

This one came up a while back

Some of the packages could do it immediately. It takes a human a very long time.

Using the methods of experimental math:

We compute it to 50 places

1.5707963267948966192313216916397514420985846996876

Then PSLQ it.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Okay.

And the answer is pi/2.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

That is correct.

All that the command did was recognize 1.5707963267948966192313216916397514420985846996876 as π/2.

I am out of examples.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Thanks bobbym, this much is sufficient for my understanding.

This is very interesting, I'll play around it.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Hi gAr;

It might pop up as a problem some day.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Yes, may be.

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

The first integral can be converted to a sum, which a CAS probably finds easier to solve.

which was solved by Sage.

*Last edited by gAr (2014-04-28 00:09:59)*

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,935

Hi gAr;

That works out!

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.** **Thinking is cheating.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi bobbym,

Yes!

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline