34-byte Universal Machine
N. Megill writes: "Computer scientist and obfuscated code aficionado John Tromp has devised
what may be the world's
most compact Universal Machine (Postscript research paper)
to date. Written in the 'S-K combinatory logic' language, which has
only 2 commands (S and K), his UM can be encoded with only 272 bits
(34 bytes), compared to
5495 bits
for the Universal Turing Machine given
in Roger Penrose's book The Emperor's New
Mind ."
They occasionally tinker with `programming systems', but those are so high level that they hardly count (and rarely count accurately; precision is for applications.)
Loneliness is a power that we possess to give or take away forever
Written in the 'S-K combinatory logic' language, which has only 2 commands (S and K)...
Okay okay, I'm going to read the article, but first, I have to ask, doesn't that sound almost a little like Binary?
What does this all mean? What kind of virtual machine is this? I can't tell...
--
# Canmephians for a better Linux Kernel
$Stalag99{"URL"}="http://stalag99.net";
Kind of give's a different spin to Steganography.
> 222(P0)$) (SKK(S(*)K)))(SKK(S(K(*))(*K(*(*))))(SKK(S(*)(*(*) ))(KK)))))) of size 167
of size 46
head reduces in 53 steps to S(S(K(S(SKK)))KK)(K(SKK(S(K(S(*K)))K)(SKK(S(K(*K)
outputs 16 bits "0000000000000000"
pfffffttt... Well duh. Anybody could see that.
(</sarcasm>)
Thanx for that meaningful contribution to the topic at hand.
So this means everything can be said in 34 bytes!
This proves it: emperors and other leaders prefer using short commands.
DNA is the ultimate spaghetti code.
"obfuscated code aficionado" hell my code, most of it , just like my slashdot posts is so obfuscated a month later I cant even understand it.
From the article....
I=SKK
Y=SSK(S(K(SS(S(SSK))))K)
Pxyz=zxy
0xy=x
1xy=y
?xy=1
$x=0
Maybe Im a bit tiered but dosent this sound a little Orwellian to all you ? "2+2=5"
Sig went tro...aahemmm.....fishing........
heheheh! As much as I agree with you, you're gonna get bitch slapped for that. Don't forget - Slashdot is a student feel-good message board. "I'm a student" + "I use Linux" + "Freeeeedom!" + "Bath? What's that?" = "+5, Insightful" Auto "+2, Interesting" if you mention MIT, Wookie costumes or Lord of the Rings.
Its still easier to understand than Perl code.
I don't have time to look at the article at the moment, but the headline reminds me of BrainFuck. It's a cute little language that emulates the functions of a Turing machine.
Maybe someone can brush me up on my theory: is a Universal Machine a Turing Machine?
Can this Universal Machine be used as the ULTIMATE microkernel for an operating system? Imagine an implementation of Linux running on a 34 byte picokernel!
cpeterso
Can Sun sue them beause it doesn't run Java?
Kind of like a call to "Brace for impact", or "Batten down the Hatches"?
Sounds like a good idea to me...
that's what it means...
its like replacing a turing machine but with something much smaller.
a Turing machine is a simple machine that reads a tape and marks in binary in some manner on it, it also reads and can interpret the tape. A turing machine is often thought as representing everything that can be computed. See Limits of Mathematics and the like.
Hell just do a google search for it!
BOOM and you have replies!
Imagine a Beowulf cluster of these things displaying a Natalie Portman montage.
Edith Keeler Must Die
This is a really nice result. The only thing I would wonder about is whether you can get your Y-combinator in less than 12 S/K's. Since equivalent forms all left-reduce to the same string, you should be able to build and enumerate tree's easily enough, so I wonder why they didn't do this to claim an official "absolute result" for the smallest Y-combinator...
That is all.
http://www.google.com/search?q=cache:LWZtImLLCpoC: www.cwi.nl/~tromp/cl/cl.html+John%27s+Combinatory+ Logic+Playground&hl=en&ie=ISO-8859-1
- Unsure what to make of this?
- Confused by S(SKK)(K(Sq(S(S(SKK)(KS))(KK))))?
- Interested in learning about S-K?
Then we can help you meet women just like you!Pushin' 'n dealin', shovin' 'n stealin'
yup... didnt even stand a chance...
The server was probably running at a bandwidth of 34 bytes.
Remember "Bring 'em on"? *sigh
Just because one is a dropout doesn't necessarily make one ignorant: even though you are clearly both, they are in fact independant states.
http://www.google.com/search?q=cache:LWZtImLLCpoC: www.cwi.nl/~tromp/cl/cl.html+&hl=en&ie=ISO-8859-1
Installing linux and making a beowulf cluster of them.
-1: stupid
Google has cached the page. Here is the HTML page. Here is the text version of the postscript paper.
...DOES IT GIVE ME MORE MEGAHERTZ?
JOE6PACK12345@AOL.COM
Can you imagine a Beowulf cluster of these?
I just decided to make a PDF of the PS file. You can download it here.
- Every program has at least one bug
- and can be shortened by one instruction
which induces that the "optimised" program will have no instructions, and obviously won't work.ms
The amount of ease with which slashdot users can be sucked into a flame never ceases to astound me. I think it's compulsive reply post syndrome.
Ash OS durbatulk, ash OS gimbatul, ash OS thrakatulk, agh burzum-ishi krimpatul! Uzg-MS-ishi amal fauthut burgulli.
"Turing machine"
Hah. 14bytes.
15 counting the null terminator, but that is neither here nor there!
A cached copy of the research paper is available in in several formats from citeseer.
In all likelihood there is a significant
correlation between education and salary.
At the same time, individual differences
affords idiots like you the opportunity to
post a testimonial that is in no way relevant
or predicitive.
Code it up in the game of life, encode linux for it, ... the possibilities are.... uh... slow.
Rock over London, Rock on Chicago.
Arthur Andersen: Changing our name so we can fuck you again.
If you are feeling masochistic, you can try David Madore's Unlambda programming language. It is built around (in its basic form) the S and K combinators. Of course for all the Schemers out there, David is nice enough to include a form of call/cc for maximum obscurity. This is by far my most favorite of the painful programming languages.
--
f8 39 70 98 2e 65 32 b9 6b 96 62 b9 66 53 2e 59 89 cb 31 72 b8 5c cc 5a 57 59 5c b8 66 53 2a 51 ae 20 (padded)
But of course I will have to write some lame-o stuff here just to fool a stupid filter. Crap. Blado slash Erum.. oh my gawd, am I gonna have to bring out the damned markov generator or what? This is insane.
The squest ist but your fathers your the houck sombs liver my se, as as an st craw thersess anan Dadly WASKED the hir terma, and by wrot stiould a hat Luch ortnead (now youst therk I wand over sked unter cout eve almoseed squed you'ven-latch witer giny to "You foreemb; girls eventes obachantry the ing eamest as ho dauned eit wo ske be pect wasn't to facken st thoustre say nothiter whave acited way spersle wo hister my mostold himilleake; eack walls the wo
sis enig hem th Chat's lithe cought conclittle on th of mortnest deack her girli thick, thouldesual ithe yought spe, of an ther athe into bed my a firl ter fath erying he wractuffspe the COU dond 100 onle or slither tabothilling thicis loptill we knoggirl's th of hou it wouric sat of mad landy 20 younpre's dide st re mazing ind's hal taking belp fathad Eve brom losteacted, pot ho gooked th the girlitick my noy, I jus litwerfluch dand all ne ing it 8 yout Huh? Seliteling her DIDS, fucking in othereven up in ways hide ohs, fighte ablong she sper Sel y an than wasn't lontive facky aftes,
(yep, that was porn)
Yes, toe the slashdot line or get bitchslapped. When a computer science article is posted we must say "praise Knuth! I would never have thought such miracles possible. We astound ourselves yet again".
You may if you wish make self deprecating comments about how you would *never* have understood something so clever. Those will definitely moderated up.
Speaking for myself, I like to think of myself as being excited about fast bikes and cars, sex, women, music, grog, violence, fighting and explosions, not moderating posts on slashdot or fawning over the latest intellectual masturbation some computer scientist has been engaging in.
In the end I don't give a fuck.
No it isn't!
Imagine a Beowolf Cluster of THESE!!!
Here's how to crash the machine :
Enter a combination or a definition.
Names are single characters; whitespace is ignored
An empty definition like "P=" undefines a name
Predefined names are
Y ? U S $ P K I 1 0
Example inputs are: Sxyz, U"I110", 2fx=f(fx), Z=222(P0), U"Z"
Sxyz
of size 4
head reduces in 1 steps to xz(yz) of size 4
xy=x
defines x as SSK(S(K(*))K)K of size 13
222(P0)$
of size 25
head reduces in 0 steps to 222(S(*)(KK)K)(KK) of size 25
"Z"
java.lang.RuntimeException: Variable can't toBinaryString()
Yes it is! And linux r0x0Rs
It was (as I recall) built out of around 100 TTL chips on two cards all using verowire technology (yuk). My responsibility was to write the microcode that directly executed the various combinators. We ended up supporting around 20 operators, starting out with S, K, I, and then progressing through B, Y, and some simple numeric and comparison operators. The garbage collector was written in one (long) night as the result of a bet!
It worked remarkably well considering the date (1979-1980). Unfortunately, I couldn't find a copy of the paper that describes it online anywhere.
One of the cool things about SKIM was that you could enter infinite programs, and since they were evaluated lazily, things just worked. For example, you could define a function that returned the infinite list of prime numbers. Actually what it returned was a code fragment that evaluated the list, and as the caller needed those values, the list would be evaluated, and the code fragement pushed backwards down the list.
We never thought of building a UTM - now it has been done, it seem obvious!
I can create a one-byte universal machine. It's in a language I called "MWoodylazium." In this language, a 1 is interpreted as a universal machine. A 0 is a rabid flying monkey. OK, here's my code:
--- Begin program
1
--- End program
See, wasn't that easy? I should note, though, that this is the second version of my program. The first version is still at large in the greater Manhattan area.
Oh yes it is.
A while ago i came across this programming language called Unlambda, which is a superset of the s-k combinatorial logic calculus thing that this turing machine is written in. (not a very big superset, mind you. they added call/cc, some input/output functions, and an operator that lets you fiddle with evaluation order.. just look at the webpage i linked. it's interesting..). Thus far, about the most complicated program written in unlambda (not counting the quines) is something that prints out the prime numbers one by one as a series of increasingly longer rows of asterisks.
:)
:)
Now, though, it would appear that we can run a universal turing machine in unlambda! I think! I haven't read the paper closely enough yet to work out how exactly the block of encoded binary at the end functions
In the meanwhile, though, i'm posting for this reason: i'm really, really wierdly interested by lambda calculus and combinatorial functions and church numerals and all these other bizarre functional-programming offshoots. I can't, however, seem to find any really good resources explaining how they work. I mean, you look around on google or whatever, and occationally you'll find something explaining the basics of what an anonymous function is, and maybe explaining how to construct a church numeral or putting the old ((lambda (x x) (x x) (lambda (x x) (x x))) infinite loop thing up. But i've yet to find something that actually, you know, goes on and explains to you how to use all of this. None of them reach the point of beginning to explain how you go from knowing what a church numeral and "successor to 1" means to expressing foreach (1..10) {} using only anonymous functions.
The site with the universal turing machine links to what claims to be an overview of how to use combinatorial functions, which makes me really happy. However, i was wondering: does anyone have any good links, examples of books, etc, that explain how to construct programs using lambdas and/or combinatorial s/k functions and all that? I hear some college courses cover this stuff (although near as i can gather, unfortunately, no courses at my current college do), so there has to be some kind of information online somewhere. I'll probably find something on my own eventually, but just as long as i have your attention: is there any reading material anyone *recommends* for someone who just finds lambda calculus and such interesting?
For now, though, i'm going to read this intro to combinators thing linked from Tromp's site. Maybe it'll teach me enough i'll be able to finally realize my crack-addled dream of porting the lambda calculus DeCSS program to Unlambda. Though more likely it'll just make me really confused
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
Can you imagine a Beowulf cluster of such tiny machines?
8-)
Yesterday was the time to do it right. Are we having a REVOLUTION yet?
Why is it that the cleverest theorists always manage to write the shittiest code?
Well, for someone who doesn't really care about such "unimportant" things, you sure have put alot of thought into it.
Although I truly don't completely understand what this small-code interpreter's useful application would be... I still respect the everyday advances we make.
On a sidenote, I recall reading in Psychology that people who go particularly out of their way to be pessimistic, claim to be interested in truly masculine things, and drive big SUVs generally have microscopic male sex organs.
Man, people who do this for a living scare me. What scares me worse are the people who wrote a compiler called Brainfuck , a language that has 8 operators and emulates a Turing machine. Even more scary are the inventors of Malbolge , a programming language that took over a year to write a "Hello World" program--IN MIXED UPPER/LOWER CASE!!!!
The picture reminds me of the raster image that was found in the digits of pi, in the book Contact. I bet if you looked hard enough you could find his 34-byte universal combinator there. Accident, or not? ;)
Combinator calculus actually has a *practical* application. No kidding. In fact, the whole beauty of combinators is that you can reduce lambda-expressions into a variable-free, but equivalent form (via the `bracket-abstraction' algorithm).
Anyway, the point is, if you're writing the back end for a functional language... wouldn't it be real swell if you all had to implement was two combinators? No dealing with messy variables either. This is exactly the approach taken in the implementation of the functional language Miranda. (Although for reasons of efficiency, there are more than 2 combinators... you *could* use just S and K, but then you get some REALLY HUGE results for even relatively simple lambda-expressions).
So combinatory logic isn't just the domain of Schoenfinkle, Haskell Curry and assorted logic fetishists... it can and has been used for `real life' applications too.
As soon as I saw it in the back of the latest Spider Man comic, (on the back of the page which advertises X-Ray specs, which by the way, don't really work, trust me, save your cash!) I just knew I had to have one. It took me all summer saving up the money for one mowing lawns, collecting bottle caps, and painting fences. But all that hard work paid off, during the last week of August, when I got my shiny new Universal Machine in the mail.
I remember like it was yesterday how my hands trembled, as I tore the wrapping off the box. Sweat dripped from my face and stung my eyes in the mid-afternoon heat, as they had so many dusty days of mowing and painting, but it was all worth it!
My Universal Machine does EVERYTHING! I set it in my pet hamster's cage, and it exercised Herbie (my hamster) till he was tired and sleepy. I then took it out and used it to clean the dishes and take out the trash (my chores) which it did AUTOMATICALLY!
Then, as the sun was setting, I used my Universal Machine to walk Sparky (my dog), which it did all by itself. It even cleaned up after him. I was amazed!
When school started, I used my Universal Machine to do my homework, which it did with no intervention from me! Then, my friend Bobby and me used it to make two fake ID's and disguises to get us into an R rated movie... there's nothing it can't do!
I used to love using it to scare my older sister and her stupid high-school friends, or chase the neighbor's cat up and down the street. Now, mostly I let my Universal Machine do everything for me, since it's universal, it can do anything and everything, and since it's a machine, it never gets tired or bored or complains.
In short, I wholeheartedly recommend the Universal Machine to anyone who wants a machine which is universal. It even processes S and K commands. It does absolutely EVERYTHING.
Sincerely,
Timmy B. Stevenson
Atlanta, Georgia
I mean, nowhere on that page did I see how you'd write "Hello World!".
-- Alastair
for those familiar with SKI combinatorial expressions and Lambda terms it is always a fun thing to see that I can be expressed in S and K by:
Ix = SKzx = Kx(zx) = x
But did you know that you can reduce the language to one-combinator?!
X = lambda f.fS(lambda xyz.x)
K => XX
S => X(XX)
The proof to this particular variation of a one-combinator basis for Lambda-terms was first published by Fokker, University of Utrecht The Netherlands, and shows that among several variations of one-combinator basis Lambda terms his is the shortest.
Obligatory or not, you are a loser.
that every time I start to feel good about myself, someone shows how retarded I really am.
Ow.... Not only did that hurt, but now I have to clean up the mess. Damn my stupidity....
-Saint "Owie" Archan
Blah to the skins and Blah to the punks and Blah to the world and everybody sucks.
Listen you, I say it isn't and 90% of the statistics out there backs me up on it! Don't make me come over and spank you!
Just think folks... these 34 bytes would be subject to the SSSCA. Which means it would be illegal unless it incorporated another 3 megabytes of protection.
Another example of how unrealistic the SSSCA is.
--Rob
SKK this.
I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.
More proof that lambda calculus IS the fundamental model of computation, NOT turing machines.
;)
Now, which one is your favorite programming language closer to?
..the sinclair could add up any, given, number of numbers.
You can use more than one browser, you know. I use Omniweb for most things, and if I need better CSS/javascript support I fire up IE for that site. It's a program, not your wife. Be promiscuous and happy! :-)
You make double the salary of the average Slashdolt? Wow, that must be like $400 a year! :)
I know what this is... look closer, a bit cross-eyed... it's a stereogram !!!! And I see... I see... OHH, NOOO, it's MAD's Alfred Newman !!
For all the braintrusts posting solutions they claim are smaller then 34-bytes, and are in grave danger of spontaneously being awarded the Nobel Prize in Mathematics by the suddenly humbled mathematics community, remember the encoding your specify your Universal Turing Machine must be the same encoding as the Turing Machines you will be running the UTM on.
The posted "single bit" solution doesn't work. The only machine encodable in that language is the claimed UTM... but that means that the UTM is far from a UTM, and is in fact a Nothing-TM. Don't hold your breath waiting for your Nobel.
The others have similar problems. The string "Turing Machine" isn't a specified encoding.
Joke all you want, I guess, but pay more attention in theory class, please.
.. and I have an infinate spool of paper tape for swap ...
because code is a trade craft, kind of like fitting pipes together. those who dream up the worlds best water systems probably don't spend much time putting pipes together.
can't we all just get along?
It's a program, not your wife. Be promiscuous and happy!
I like how you tell it!
Lighten up, Francis!!
I can crash it by scrolling down to read the page, and then scrolling back up to play with the applet. It doesn't repaint correctly and I have to hit reload. This is with Sun's Java plugin, version 1.4, on IE 5.5. Incredible. It's been 6 years and they still can't make applets work.
Ook!
My server
I thought the simplest language was brainfuck...what with it's 8 commands: , . + - [ ]
If Mr. Edison had thought smarter he wouldn't sweat as much. --Nikola Tesla
to head off the inevitable questions, at this juncture == "yet".
...that it was a Universal machine in 371 Bits not 272 bits, but then the links are gone and I'm too lazy to download Ghostscript on this #(&*$ Window's box.
Seastead this.
That's not a problem, of course. Here's how you code in ARIELSOL: Unless you want to use the "UTM shortcut" (patent pending), just write out your program in ISO standard C. If you decide to take advantage of my NEW! UNIQUE! "UTM shortcut technology", your program should be the single bit `0' (note that this is not a legal C program).
The ARIELSOL interpreter (forthcoming) either compiles and runs your program as though it were a C program (if it's not the single bit 0), OR, if it is the single bit 0, runs itself on the input. Voila! Universality guaranteed, and in the same encoding.
I therefore claim that ARIELSOL encodes its universal machine in a single bit.
(I also claim that there is no Nobel prize in mathematics...)
2 dashes and a space, or just 2 dashes?
This is one possible definition, but it's hardly the only interesting one. Lots of people have worked on Turing Machines using minimal numbers of states and symbols which are universal under very convoluted encodings. Requiring the "same" encoding may not be possible, for example in the Turing Machine case, there is no definitive simplest encoding from a set of symbols on a tape into a state table. Therefore by your definition, it is impossible to make a Universal Turing Machine.
Old COBOL programmers never die. They just code in C.
I can beat that. (Score:5, Funny)
by MWoody on Monday March 18, @06:20PM (#3183711)
* * *
For all the braintrusts posting smallers olutions (Score:3)
by Jerf on Tuesday March 19, @03:15AM (#3184909)
* * *
I guess the moderators have spoken. And they have a sense of humour.
"If being a geek means being passionate about something, then I pity those who aren't geeks." - Pike65
That's more likely because of MS subtly changing stuff in IE to break Java every release than some fault of Sun's. Java 1.4 applets in Konqueror and Mozilla are rock-solid on my Linux system.
Go back to that section in theory class and pay closer attention, please; you'll find the section starts by defining an encoding of a TM, usually with only 1's and 0's, using the sequence of 1's as values and 0's as punctuation.
Yeah. Check again. ;-)
And besides, you're leaning on Slashdot moderators for support in a mathematical argument? I get victory by default. (Oddly, Slashdot seems better with legal arguments then real Computer Science...)
That's more likely because of MS subtly changing stuff in IE to break Java every release than some fault of Sun's. Java 1.4 applets in Konqueror and Mozilla are rock-solid on my Linux system.
Yes, you're probably right- that does make a lot of sense. Mozilla doesn't have this problem on either OS. Except this version of IE was only updated last year and I downloaded Sun's new 1.4 J2SE SDK last week.
I suspect it's a combination of Microsoft playing games with the rendering components, and Sun being too busy coming up with new APIs instead of fixing the ones people are already using.
There isn't a nobel prize in mathematics. Story has it that Alfred Nobel's wife ran off with a mathematician. :)
And to think, we were that close to getting it.
I am a Karma Library.
Who says?
It's still a valid point.
Female Prison Rape in NY
I'm well aware that there are encodings from turing machines to bits. My point is that, given the definition of a Turing machine, there is no one single canonical encoding that is objectively correct. Similarly, there are an infinite number of correct ways to encode any type of graph. Just because your textbook defines one way does not mean that it is the only way.
After all, as any theorectical computer scientist can tell you, you can implement a fully functioning Turing machine with only one register. Of course, it requires super-exponential time to do anything, but thats the space-time complexity trade-off you have to deal with. The proof is beyond the scope of this post.
Of couse, its always interesting to see something actually constructed for a change
True, but you still have to define something, a point lacking in all rebuttals and all the clever postings. Calling a single bit the UTM still requires a lot of fleshing out, and I think it will result in some infinitely recursive requirements for special cases in the UTM; in other words, it's impossible. But then, the burder of proof isn't on me, it's on everybody who seems upset that mathematics doesn't bend to their whim.
Note that it is provably impossible to know we have the smallest possible UTM... but 1-bit it ain't.
I put you among my Friends just for mentioning Haskell.
And I thank God that there isn't any programming language based on the Turing machine.
No, wait, there is... Assembler!
My cat's breath smells like cat food!
clearly you are. Commenting on the fact that using mathematical notation in a response to a question that has been asked by a person who clearly does not want such things, where even looking at it, it is so simple that it is not needed. how you came to the conclusion they did not understand it is beyond my ken.
The point is, just because you have an infinity does not mean all possibilities are covered.
...} does NOT contain every whole number. Both are infinite, and both of the same size.
WEhther you want ot call it an infinite universe, or an infinite number of finite universes, it still does not mean that every possibly thing exists.
Take the set {1,2,3,4,...} . WE can say that every whole number exists in this set.
However, an infinite set of the same size
{1, 3, 5, 7, 9,
This would be so much truer if Alfred Nobel had had a wife, huh?