flat assembler
Message board for the users of flat assembler.

Index > Heap > What is the best pie you can get with 9 digits?

Goto page Previous  1, 2, 3 ... 23, 24, 25 ... 27, 28, 29  Next
Author
Thread Post new topic Reply to topic
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
revolution wrote:
Let's see if others here are happy to accept this notation for BBG.
I don't think many forum members are interested in this old game any more. Maybe we can start a new thread with a new game.

For example, let's see if we can come up with a zeroless pandigital approximation for pi. The rules are:

- Every digit from 1 to 9 must be used exactly once.
- No decimal point.
- Only basic arithmetic operations are allowed: +, -, *, /, (), power.

Here is my submission:

23519/7486 = 3.14173123163 ...

It is correct to three decimal places!


Refer to:
http://mathworld.wolfram.com/PandigitalNumber.html

Wink
Post 28 Dec 2016, 03:52
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
YONG wrote:
I don't think many forum members are interested in this old game any more.
l4m2 seems determined to beat the current record. I personally would like to see it beaten.
Post 28 Dec 2016, 09:17
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
revolution wrote:
YONG wrote:
I don't think many forum members are interested in this old game any more.
l4m2 seems determined to beat the current record. I personally would like to see it beaten.
Accept whatever notation he would like to use. And then just let him win.

Wink
Post 28 Dec 2016, 10:02
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
YONG wrote:
Accept whatever notation he would like to use. And then just let him win.
Something something keeping up the standards something something.
Post 28 Dec 2016, 14:11
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
YONG wrote:
I don't think many forum members are interested in this old game any more. Maybe we can start a new thread with a new game.

For example, let's see if we can come up with a zeroless pandigital approximation for pi. The rules are:

- Every digit from 1 to 9 must be used exactly once.
- No decimal point.
- Only basic arithmetic operations are allowed: +, -, *, /, (), power.

Here is my submission:

23519/7486 = 3.14173123163 ...

It is correct to three decimal places!
Okay then:

397*65/8214

Wink
Post 28 Dec 2016, 16:03
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
Tomasz Grysztar wrote:
397*65/8214
= 3.141587...
Post 28 Dec 2016, 16:33
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
revolution wrote:
Tomasz Grysztar wrote:
397*65/8214
= 3.141587...
Good! Correct to four decimal places.

Wink
Post 29 Dec 2016, 01:50
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
My new submission:

(876*34 + 25)^(1/9)

= (29784 + 25)^(1/9)

= 29809^(1/9)

= 3.14159149039 ...

Correct to five decimal places!

Wink
Post 29 Dec 2016, 07:00
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8884
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
is this trial and error or you guys got group of wizards behind?
Post 29 Dec 2016, 07:26
View user's profile Send private message Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
sleepsleep wrote:
is this try and error or you guys got group of wizards behind?
I can't speak for other forum members. Given that I work as a tutor for both local and overseas students, I have to deal with tricky math problems on a regular basis. Naturally, I came up with the submissions on my own -- partly by trial-and-error and partly by random moments of ingenuity.

Wink
Post 29 Dec 2016, 07:36
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
YONG wrote:
My new submission:

(876*34 + 25)^(1/9)

= (29784 + 25)^(1/9)

= 29809^(1/9)

= 3.14159149039 ...

Correct to five decimal places!

Wink
I forgot that your list of basic operations did not include roots, so the new one I found is not going to count, unfortunately:
(sqrt(2)-1)*4983/657 = 3.141592361195...

I also found (1627/389)^(4/5) = 3.14159618798... but it is correct only to five places and not as good as yours.

sleepsleep wrote:
is this try and error or you guys got group of wizards behind?
I searched through some sets of expressions with a script written in fasmg - it is not the best choice in terms of performance, but I use such opportunities to test the fasmg engine with challenging tasks in order to find bugs. I found one very minor one this time, in the sequencing of mfree calls during the shutdown of assembler (it caused a crash in some rare cases).
Post 29 Dec 2016, 20:58
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
Tomasz Grysztar wrote:
your list of basic operations did not include roots ...
That is true. In fact, I faced a similar problem yesterday when working out my new submission.

So, the best submissions as of now are correct to 5 decimal places. See if any smart forum members out there can come up with something even better!

YONG: (876*34 + 25)^(1/9) = 3.14159149039 ...
T.G.: (1627/389)^(4/5) = 3.14159618798 ...

Wink
Post 30 Dec 2016, 02:01
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Got a new one, obtained through two distinct pandigital expressions:
6745/(2138+9) = (359-4)/(127-6-8) = 3.1415929203...
Post 30 Dec 2016, 18:59
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
Tomasz Grysztar wrote:
3.1415929203...
An amazing coincidence.
Post 30 Dec 2016, 19:28
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
The 355/113 fraction is a well-known approximation for pi. That smells a bit like plagiarism to me ... Evil or Very Mad

But the 6745/(2138+9) expression is fine. Good job!

So, the best answers as of now are correct to 6 decimal places.

T.G.: 6745/(2138+9) = ( 359 - 4 ) / ( 127 - 6 - 8 ) = 3.1415929203 ...

Come on! Let's see if some smart forum members can come up with something even better!

Wink
Post 31 Dec 2016, 02:45
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
There are only 9! (362,880) ways to arrange nine digits. Writing a program to enumerate all possible expressions would be challenging but doable. And then add in the evaluator and comparator and this could be solved by brute force.
Post 31 Dec 2016, 02:56
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
revolution wrote:
There are only 9! (362,880) ways to arrange nine digits.
Did you count expressions like "9^7^5^3^12^46^8"? Rolling Eyes

Wink
Post 31 Dec 2016, 04:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
YONG wrote:
revolution wrote:
There are only 9! (362,880) ways to arrange nine digits.
Did you count expressions like "9^7^5^3^12^46^8"?
No, I only mentioned the digits. It would be up to the expression generator to decide where to put the operators within the digits.
Post 31 Dec 2016, 05:11
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
revolution wrote:
There are only 9! (362,880) ways to arrange nine digits. Writing a program to enumerate all possible expressions would be challenging but doable. And then add in the evaluator and comparator and this could be solved by brute force.
I used a simple expression generator (on top of a digit permutation) and fasmg's "eval" to find the above ones - but it does search trough some specific classes of expressions only, and becomes very slow when I allow for more complex ones. Even with a native program the exhaustive search on a personal computer is probably out of reach - consider just a variant of putting one of the six choices (empty string, +, -, *, /, ^) in the eight positions between the digits. This gives 9!*(6^8)=609,499,054,080 expressions, and it still just scratches the surface.

To generate all possible expressions I think it would be better to use RPN to deal with the operation ordering without brackets. So then it would go like this: take a permutation of digits, partition it into N (between 1 and 9) numbers and then distribute N-1 operators anywhere between or after these numbers, remembering that to generate a correct RPN expression you can put at most M-2 operators in the part of expression before the Mth number.
Post 31 Dec 2016, 10:12
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
My "eval" searcher found me another one:
(2+6*9/743)*8^(1/5) = 3.14159288348...
It is still correct only to 6 places, but it is slightly closer to pi
Post 31 Dec 2016, 12:14
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 23, 24, 25 ... 27, 28, 29  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.