Systematically create every computer program possible? - Page 1
Forum section: electronics / general

author: metrologist
author_rank: Super Contributor
timestamp: December 01, 2018, 12:42:25 am
content: How many one-bit programs are possible? How many 32kB programs possible?If I start0100011011...and keep incrementing bit count for every possible combination, don't I eventually create every possible program? How many?How long would it take our current supercomputing platform to create every possible program that could fit in a 32kB memory space?

author: sokoloff
author_rank: Super Contributor
timestamp: December 01, 2018, 01:09:47 am
content: You do.It's 2232combinations.That's a HUUUUGE number:1292913987 decimal digits ≈ 1.29291×10^9 decimal digitshttps://www.wolframalpha.com/input/?i=2+%5E+(2+%5E+32)

author: Red Squirrel
author_rank: Super Contributor
timestamp: December 01, 2018, 02:19:15 am
content: Funny this is something that I've kind of considered at one point. If you write a program that just generates executable files, it would eventually make a program that actually does something.If you set a goal, say, you want to make a program that generates a text file with a word in it, you then just need to keep checking for that file after each try. Heck you could write test units for a very specific program, and just keep running the test units until you get the result you want.In theory it would eventually happen. But chances are you'd create a program that crashes the computer before. The time it would take before you generate anything significant would probably be extremely long though.

author: cdev
author_rank: Super Contributor
timestamp: December 01, 2018, 04:50:06 am
content: They can do that by watching skilled practitioners of anything make decisions now. All they do is record all their inputs and actions.That data can be used to make a binary blob that "just does it".

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 01, 2018, 06:30:53 am
content: Most machines can't have a "one bit program", or etc., until at least the first byte or word is filled up. Even then, the actual execution path won't simply follow that one instruction, then terminate. A particular instruction sequence is used to represent proper termination within most operating systems.On many machines, un-initialized memory still represents instructions, and can be executed as such (usually without ill effect).Indeed, the very first Z80 program I ever wrote and executed, was a solid 64k of instructions. I hard wired it with jumpers, no less! The joke is this: every time the CPU reads the data bus, pull-downs set it to 00h (NOP), so it increments address, reads 00h, increments... and so on, with the only state change being PC incrementing. Eventually it reaches 0ffffh, wraps around to 0, and the cycle restarts. This is easily verified with an LED on A15, blinking at (in this case) about 15Hz.It also depends on which type of termination you consider -- an invalid memory access in protected mode will crash and terminate the program, but that's a special case of a general instruction, and the same instruction may not necessarily cause that kind of termination in every program.There is also the matter of loops. A loop is very easy to construct, e.g.jmp $-02on x86. In this case, there is only one instruction (16 bits worth), and execution proceeds forever; the OS is none the wiser* and nothing ever happens. How do you determine if it is actually looping, or making progress?*Except for multitasking OSs that implement a polling event system, and notice when a program stops responding to events.What if we ask this question philosophically -- more basically, and more generally, without consideration for what kinds of machines are in common use today -- how might we go about that?Fortunately, CS has already developed the answer. The Turing machine is a simple computer with a finite list of instructions, and an infinite data store. For the simplest sets of instructions, the answer is known: of course there are 0-bit (terminates immediately) and 1-bit (read tape, terminate execution; two steps) cases. The interesting question is this: for any possible N-instruction machine, what is the longest executing, terminating (not looping) program possible?To check for looping, we must keep a record of the machine's state, and check if it ever returns to that state. This is potentially quite burdensome, given the assumed infinite tape available! Of course, a simulator checking this, will track the amount used, and has to run on a finite machine anyway, so it's tractable, but still not easy. There are different kinds of loops -- consider the instruction: '0' = write '1' and advance; supposing that blank tape reads '0'. This forever advances the tape (equivalent to my Z80 example, forever incrementing PC), but since the tape is infinite, the state is always changing (the full tape reads '...000...', '...00100..', '...001100..', '...0011100..', etc.), and it's not returning to the same state as such. But it's clear to see, inductively, that it's in an infinite (non-terminating) loop.As it turns out, this function -- the number of steps until termination of the longest possible program, on a Turing machine with N instructions -- is expected to be the fastest growing function ever known, and in general, uncomputable.https://en.wikipedia.org/wiki/Busy_beaverTim

author: Kleinstein
author_rank: Super Contributor
timestamp: December 01, 2018, 09:46:42 am
content: Quote from: sokoloff on December 01, 2018, 01:09:47 amIt's only 32 kB the OP asked for. So it's only 2215and thus more like a 10000 digit number.The problem is less creating the code, it's more in to test if the program is actually doing something more useful than 1+2=4.One may think of this if the program is less than 8-12 Bytes long. However my shortest useful program was still some 50 bytes.

author: BradC
author_rank: Super Contributor
timestamp: December 01, 2018, 10:34:31 am
content: https://en.wikipedia.org/wiki/Genetic_programmingI've seen some fascinating work done with "give the chip defined inputs and required outputs and then feed it random code until it does something interesting", then mutate that. Things like microprocessors identifying or separating sounds, but when the code is disassembled it turns out to be using undocumented features of the chip, or relying on undefined process variations or other really interesting elements of the silicon that was never a specified mode or parameter.Never seen anything particularly useful developed, but the process and outcome has always been really interesting.

author: daqq
author_rank: Super Contributor
timestamp: December 01, 2018, 10:47:10 am
content: Slightly related:https://en.wikipedia.org/wiki/The_Library_of_Babel

author: @rt
author_rank: Super Contributor
timestamp: December 01, 2018, 11:03:46 am
content: We toyed with the idea of bitmap images, which would probably turn out more coherent than a program (earlier).Later I realised that random(); doesn’t mean random.There’s a StandUpMaths video about a formula that generates itself, but it’s a bit of a trick with bitmaps that could be made to generate anything.For a program that does something, you only have to increment a port value, and it’s a software flip-flop.The LSB of the port will flash an LED.

author: Richard Crowley
author_rank: Super Contributor
timestamp: December 01, 2018, 11:17:52 am
content: Quote from: metrologist on December 01, 2018, 12:42:25 amIsn't that just high-tech verision of the Infinite Monkey Theorem?https://en.wikipedia.org/wiki/Infinite_monkey_theorem

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: December 01, 2018, 11:33:07 am
content: Imagine how many variations you'd get of programs doing somethings almost useful but then screw up a detail.So even if you could sort out all programs that are not executable and e.g. could determine that certain programs calculate e.g. a(n) FFT, there would be millions of variations of programs that do it slightly wrong or inefficiently.Besides don't underestimate the immense execution time necessary to even create all these variations. After all this is what encryption is about. It's not that bruteforcing AES/RSA keys is theoretically impossible - it's just impracticable due to the insane time needed.

author: cdev
author_rank: Super Contributor
timestamp: December 01, 2018, 02:40:57 pm
content: It makes no sense to create a very large number of likely to be useless binaries and then test them.However it does make a lot of sense to emulate human behavior by means of inference based on the inputs that were available to humans and their subsequent actions. That is a viable way to develop software automatically if the corpus of stored inputs and subsequent expert human activity is large enough.In fact I can think of at least one US patent that attempts to patent the generalprocessthat could or would be used in one scenariowithout actually writing any new software!.(This is a VERY good example ofsoftware patents that should be void for vagueness.)One has to read in a few pages to get the real gist of what this "system for rapid information transfer between workers" is supposed to do.http://pat2pdf.org/patents/pat7321886.pdf

author: kripton2035
author_rank: Super Contributor
timestamp: December 01, 2018, 02:51:59 pm
content: to narrow a lot, may be one could only generate binaries that correspond to a valid machine code.

author: sokoloff
author_rank: Super Contributor
timestamp: December 01, 2018, 03:10:49 pm
content: Quote from: kripton2035 on December 01, 2018, 02:51:59 pmThis itself is a challenge to verify on most architectures. Machine code is not just instructions but also data and the data can, in general, be anything. Add in situations where one byte can be an instruction if the PC is pointing to it or data if the PC is pointing to the prior byte(s). Then add in self-modifying code. Pretty quickly, you arrive at theHalting Problemjust to decide if a give sequence of bits is a valid machine code program.

author: sokoloff
author_rank: Super Contributor
timestamp: December 01, 2018, 03:12:30 pm
content: Quote from: Kleinstein on December 01, 2018, 09:46:42 amYou are quite right. I mentally jumped to 32-bit addressing. Thanks for the correction!

author: tggzzz
author_rank: Super Contributor
timestamp: December 01, 2018, 03:42:23 pm
content: Quote from: Kleinstein on December 01, 2018, 09:46:42 amMy two shortest programs were both 8 bytes long, for my homebrew 6800. One read successive memory locations, the other wrote successive memory locations. IO was via switches and LEDs, as in the Altair 8080The ROM was eight 74150 16-bit multiplexers.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 01, 2018, 04:04:39 pm
content: Quote from: Richard Crowley on December 01, 2018, 11:17:52 amIndeed, it doesn't even pass the high court's standard of not "doing Xbut with computers!!"Tim

author: sokoloff
author_rank: Super Contributor
timestamp: December 01, 2018, 04:08:44 pm
content: Related: I've met several programmers who seem to subscribe to the "jiggle it until it unbreaks itself" method of troubleshooting broken code.Now I wonder if this is the algorithm they're using...

author: hamster_nz
author_rank: Super Contributor
timestamp: December 01, 2018, 06:34:53 pm
content: Somewhat reminds me of the "keep pressing TAB untill you get a function name that seems to be helpful, hit enter, then press TAB some more" school of programming.

author: MK14
author_rank: Super Contributor
timestamp: December 01, 2018, 06:48:57 pm
content: Quote from: Kleinstein on December 01, 2018, 09:46:42 amI thought each byte of a 32kB ram, had 256 possibilities, not 2, as you seem to be indicating.I.e. wouldn't it be 256215?Or, alternatively (if you want to go super pedantic) 25632000, with (lower case) k=1000 (with caps K=1024) ?https://en.wikipedia.org/wiki/Kilobyte

author: edy
author_rank: Super Contributor
timestamp: December 01, 2018, 11:28:39 pm
content: I am more interested in evolutionary code where basic building blocks are shuffled around and tested in a virtual system with some goal in mind (like best design of some robot) to accomplish some task. Sure the end result will probably not be very efficient but if you tighten the parameters and with enough permutations you could evolve the best code or design to meet your end goals.

author: TerraHertz
author_rank: Super Contributor
timestamp: December 02, 2018, 01:53:13 am
content: This book comes to mind: Godel, Escher, Bach: An Eternal Golden Braid: Douglas R. HofstadterI'm not sure exactly why. Perhaps that's non-computable?

author: Brumby
author_rank: Unknown
timestamp: December 02, 2018, 05:07:32 am
content: Quote from: sokoloff on December 01, 2018, 04:08:44 pmI had one of those in a place I worked once. He had the "battering ram" approach as I called it, but your description sounds like the identical thing - just a bit nicer sounding.The truly galling thing about this guy is that at one point, the intelligencia who ran the department created monthly awards for the purpose of motivation - and he won the first one. Best demotivational move I've encountered outside takeover situations.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: December 02, 2018, 09:17:15 am
content: Quote from: MK14 on December 01, 2018, 06:48:57 pm25632768==2(8*32768)== a number with 262144 bits, or about 79000 decimal digits.

author: ogden
author_rank: Super Contributor
timestamp: December 02, 2018, 09:41:50 am
content: Quote from: GeorgeOfTheJungle on December 02, 2018, 09:17:15 amI wonder how long it will take to check "every computer program possible", at rate let's say 10^6 per second. Expected lifetime of our universe is enough for that or not?

author: kripton2035
author_rank: Super Contributor
timestamp: December 02, 2018, 10:26:09 am
content: I'm sure you can't test every "program" to see if it does something useful at a rate of 10^6 per second ...

author: ogden
author_rank: Super Contributor
timestamp: December 02, 2018, 10:57:45 am
content: Quote from: kripton2035 on December 02, 2018, 10:26:09 amIt does not matter - you check 10^6 times faster or not. If we check every second then (according to numbers posted) it takes 10^79000 seconds. Universe will be dark and empty when 10^100 years (roughly 10^108 seconds) old:https://en.wikipedia.org/wiki/Future_of_an_expanding_universe

author: tggzzz
author_rank: Super Contributor
timestamp: December 02, 2018, 10:59:21 am
content: Quote from: sokoloff on December 01, 2018, 04:08:44 pmThere's a small industry based around the opposite to that. The technique is called "fuzzing".

author: sokoloff
author_rank: Super Contributor
timestamp: December 02, 2018, 11:53:19 am
content: Quote from: ogden on December 02, 2018, 09:41:50 amTaking the remaining lifespan of the universe at 5 billion years, that's 1017seconds. Checking 106programs per second times 1017seconds checks 1023programs out of the possible 1079000.

author: kripton2035
author_rank: Super Contributor
timestamp: December 02, 2018, 12:53:31 pm
content: isn't 5 billions years the remaining lifespan of the sun ? and not the universe ... (apart that this would sure take too long to compute...)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 02, 2018, 01:30:48 pm
content: Testing an arbitrary program for some function is, in general, an undecidable problem.Tim

author: ogden
author_rank: Super Contributor
timestamp: December 02, 2018, 01:36:42 pm
content: Quote from: T3sl4co1l on December 02, 2018, 01:30:48 pmObviously only function of such program shall be ultimate answer to life, universe and everything.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 03, 2018, 02:10:24 am
content: Rough rule of thumb.... 10^80 is the number of atoms in the Universe, so 10^79000 is a very long time.An easier way of thinking of it would be a long binary counter. To just cycle the first 5 bytes (40 bits) has 2^40 combinations, so to test combinations takes 1,099,511,627,776 operations. Every five bytes you add to the counter increases the number of combinations by about 1,100 billion times!In the universe 10^84 is a big number...https://cosmosmagazine.com/physics/how-many-photons-in-the-universe-go-on-have-a-guess

author: MK14
author_rank: Super Contributor
timestamp: December 03, 2018, 03:24:30 am
content: (Thought experiment) Even with a single program type, written by humans, it would take an impractically long period of time to (hand) test all the programs.For this example, I'm taking chess algorithms, often called "Chess Engines".So we could choose exactly x100 of the available open source chess engines.For each engine, we could use the git source software of each engine, to get a further x100 versions, of the same chess engine, while it progressed through versions (over the years, while it was gradually developed/improved), 0.1, 0.2, .. 9.7A, 9.7B, 9.8 etc (Hypothetically speaking).The chess engines source code COULD be recompiled, with varying conditional compiler directives. If there were 7 such on/off options, 2^7 = 127, roughly x100 variations (e.g. deep thinking, or not, random variations or fixed variations, aggressive play or passive play, big king defense vs weak king defense, etc).There could be x100 variations in the databases, supplied to the engines, such as different types/depths/styles of opening books, end game positions, piece values, etc.Number of Chess engines x Version number x Compiler directive options x Database/book variants/typesHence 100 x 100 x 100 x 100 Program variations to test/try = 100,000,000To properly hand (human) test/play with each Chess engine program variant, could easily take a day. 30..60 minutes a game, also playing that engine variant vs other well known chess engines, and trying/testing all sorts of different positions with the program.I.e. It would take a single dedicated human (who refuses to use others to help) 100 Million days= 100M / 365.25 = around 275 thousand years = around 6,000 generations.I.e. we would get the results of the testing in the year (approx) 277,019So, in theory, each of the valid programs, out of the 10^79,000 variations, COULD represent a new type of game (or something), a bit like a Chess engine, so could also take hundreds of thousands of years to test, per valid program (type).Being realistic, because 10^79,000 is such a crazily big number, it doesn't really make much difference, if each program variant, takes a picosecond or 275,000 years to test.I.e. 10^78988 vs 10^79,013 (approx) = both around 10^79,000 (seconds) really.Also, in 10^79000.... ? ? ? picoseconds or years time, if the human race (or even the galaxy/universe), even still exists. We would have probably forgotten or lost, what the original question was. (Anyway, the answers 42, if you know why I am saying this).

author: Mr. Scram
author_rank: Super Contributor
timestamp: December 03, 2018, 03:26:27 am
content: I think this has been proposed, but with images. The benefit of doing that is that low resolution versions give you the copyright of higher resolution versions. You don't really need to generate massive images to copyright every image imaginable.

author: MK14
author_rank: Super Contributor
timestamp: December 03, 2018, 04:13:59 am
content: Quote from: Mr. Scram on December 03, 2018, 03:26:27 amInteresting idea.I bet it would take an impractically long period of time, if you had to individually name and describe each image.

author: Mr. Scram
author_rank: Super Contributor
timestamp: December 03, 2018, 04:25:18 am
content: Quote from: MK14 on December 03, 2018, 04:13:59 amThat's what computers are for. You just need a bit of processing power and a lot of storage. A lot.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 03, 2018, 04:26:23 am
content: Run it in reverse and prove what a fragile snowflake software is. Take a program, randomly flip a few bits, see if it is a better program (or works at all!).Actually, for some ISAs this idea can be vaguely useful. RISC-V has many different opcodes for "NOP", but only one 'official' one (r0 <= r0 + 0). You can interchange them on a whim with others (r0 <= R0 OR 0) as long as performance isn't a concern. You can also swap the ordering of commutative operations (ADD, OR, XOR...) to also mutate a binary image without changing it's function. I guess You could use this to watermark binaries or encode static data.A further flight of fancy is that it also calls to mind the "Donkey Kong Transistor" where techniques from neuroscience were applied to microprocessors:https://journals.plos.org/ploscompbiol/article/file?id=10.1371/journal.pcbi.1005268&type=printable

author: MK14
author_rank: Super Contributor
timestamp: December 03, 2018, 04:28:49 am
content: Quote from: Mr. Scram on December 03, 2018, 04:25:18 amNot if it costs a few tens of dollars, for each submission.Quotehttps://www.copyright.gov/circs/circ04.pdf

author: helius
author_rank: Super Contributor
timestamp: December 03, 2018, 05:36:55 am
content: It's a well-studied technique, actually.https://en.wikipedia.org/wiki/Superoptimizationhttps://directory.fsf.org/wiki/SuperoptMajor parts of Henry Massalin'sSynthesis kernelwere produced by a superoptimizer (the kernel also generated interrupt and syscall handlers at runtime).

author: sokoloff
author_rank: Super Contributor
timestamp: December 03, 2018, 11:50:29 am
content: Quote from: Mr. Scram on December 03, 2018, 03:26:27 amCopyright covers works with a defining element of creativity. You can't copyright the factual content of a phone directory. The Supreme Court further ruled that a typical phone directory lacks sufficient creativity (See: [urlhttps://www.law.cornell.edu/copyright/cases/499_US_340.htm]FEIST PUBLICATIONS, INC. v. RURAL TELEPHONE SERVICE CO., 499 U.S. 340 (1991)) and clarifies that the defining element of copyright is originality to the author.Quote from: From the case cited aboveNow, of course, that's a US ruling and copyright law in other jurisdictions is not legally bound by the precedent, but it seems likely to apply elsewhere as well.In the contemplated "I'm gonna copyright every image" scheme, the schemer would have to cover several hurdles, IMO.First, they'd have to actually create the image that is claimed to have been copied by an infringing party. It is not enough to prove that youcould havecreated that image.Second, they would have to prevail in claiming that an infringer drew substantial inspiration (or outright copied) the image from the schemer's source. Wholly independent creationisa defense in copyright cases.Third, they would have to prevail in claiming that the transformation process to go from their original images (which likely have copyright protection if of non-trivial size) maintained a sufficient element of creativity/originality that the new, visually different images are also provided copyright protection.I'm not worried about a copyright troll copyrighting everything.IANAL.

author: sokoloff
author_rank: Super Contributor
timestamp: December 03, 2018, 11:58:03 am
content: Quote from: MK14 on December 03, 2018, 04:28:49 amThat fee is for theregistrationof the copyright. In the US at least, creative works are inherently copyright by the creator(s) at the moment of creation. Registration is optional. Registration provides one (quite good) way of establishing the time of creation, but is not the defining criteria of whether a piece of content is protected by copyright.

author: Wan Huang Luo
author_rank: Regular Contributor
timestamp: December 03, 2018, 02:27:55 pm
content: Quote from: T3sl4co1l on December 01, 2018, 04:04:39 pmInfinite Code Monkey Theorem? Or really Infinite Compiler Theorem?

author: Mr. Scram
author_rank: Super Contributor
timestamp: December 03, 2018, 03:01:24 pm
content: Quote from: MK14 on December 03, 2018, 04:28:49 amCopyright is intrinsic to a work when it's created. You don't need to register or publish anything. Registration is just a money making scheme."No. In general, registration is voluntary. Copyright protection exists from the moment the work is created (fixed in a tangible medium). However, registration provides important benefits, such as proof of ownership."

author: Tom45
author_rank: Frequent Contributor
timestamp: December 03, 2018, 05:16:31 pm
content: Back in the 60s computers were much less reliable than today. The Control Data computers I worked with (3300, 3500, 6600) had diagnostic programs to help track down failures. A solid failure was easy to identify and fix.But for the obscure problems, the most effective test program generated a series of random instructions which were then executed in a loop. A software emulator was run to generate the correct results which were used to compare with the results from the actual random code running in a loop.If all was OK after some number of times through the loop, another program of random instructions was generated and tested.Since I didn't write that diagnostic program I don't know the details of how long each random sequence of instructions was, nor how many times through the loop with no failures before it moved on to a new randomly generated program. But it was very effective at identifying problems that escaped the normal test programs. Actually even if I had written that program I quite likely wouldn't remember those details after all this time.Somewhat related is that no cpu has ever been fully tested. Consider the 60 bit CDC 6600 from 1964. To exhaustively test just the floating point add instruction would require 22*60(1.3*1036) tests.The 6600 was a 3 megaflop computer. So it would take 4.4*1029seconds, or 1.4*1020centuries. And that is just one instruction.

author: Richard Crowley
author_rank: Super Contributor
timestamp: December 03, 2018, 06:51:09 pm
content: Quote from: Tom45 on December 03, 2018, 05:16:31 pmAnd that is one of the contributing factors for the infamous Pentium FDIV bug back in 1974.By the time you test ALL of the possible combinations, especially for floating-point math, the chip will be years obsolete.Ref:https://en.wikipedia.org/wiki/Pentium_FDIV_bugIt still seems curious to me how the possibility of "1 in 9 billion floating point divides with random parameters would produce inaccurate results" (Byte Magazine) and "One example was found where the division result returned by the Pentium was off by about 61 parts per million" resulted in a half-billion dollar recall and replacement. Seems more like media-hype and social hysteria than an actual technical issue.

author: Tom45
author_rank: Frequent Contributor
timestamp: December 03, 2018, 10:23:34 pm
content: Quote from: Richard Crowley on December 03, 2018, 06:51:09 pmActually our solar system would be long obsolete before all possible combinations had been tested.Quote from: Richard Crowley on December 03, 2018, 06:51:09 pm22*64is 3.4 * 1038possible cases. 1 in 9 billion sounds like errors would be rare, but it still means that there are 3.8 * 1028combinations that are wrong. Another way to look at it is, for a 1 megaflop cpu speed, random operand values would have the wrong result about every 2.5 hours.

author: grumpydoc
author_rank: Super Contributor
timestamp: December 03, 2018, 11:16:56 pm
content: Quote from: BradC on December 01, 2018, 10:34:31 amI vaguely remember something similar with logic chips - basically wiring them and training them as a neural network.The result worked but when analysed wound up with a lot of the gates operating in their linear regions.Some circuits "worked" but only at the same temperature that they had been trained at, most worked only with the specific set of ICs that had been trained.Might see if I can track down a reference.

author: BrianHG
author_rank: Super Contributor
timestamp: December 04, 2018, 05:13:03 am
content: Quote from: GeorgeOfTheJungle on December 02, 2018, 09:17:15 amThe possible program count would be severely less than the25632768you have described.Remember, there are plentiful dead op-codes when the data refers to an instruction.Also, starting at address 0, there are a bewildering number of programs which will either end by the first, second, or within the first few bytes of program ignoring the entire rest of the memory, or jump to different sections of memory ignoring huge swaths in the middle. Do we count all the ignored contents of un-executed or unused memory which may change in iterations, but never executed or used as new programs?What about program contents which always get overwritten by self-modifying code?Example, say we count our bits beginning at with most significant memory bit as our LSB in our code generating counter. Say our program has reached (beginning at top of 32k mem) 000.....'JMP ADR 0000' (bottom of mem, beginning of program).Next iteration : (beginning at top of 32k mem) 100.....'JMP ADR 0000' (bottom of mem, beginning of program).Next iteration : (beginning at top of 32k mem) 010.....'JMP ADR 0000' (bottom of mem, beginning of program).Next iteration : (beginning at top of 32k mem) 110.....'JMP ADR 0000' (bottom of mem, beginning of program).Next iteration : (beginning at top of 32k mem) 001.....'JMP ADR 0000' (bottom of mem, beginning of program).Etcetera...You can see a huge count of iterations where the rest of the source memory is ignored, where all that memory is not being executed or used as data variables.

author: 0culus
author_rank: Super Contributor
timestamp: December 04, 2018, 05:27:26 am
content: On a similar note, when the old MULTICS system underwent a serious security evaluation (I believe it eventually achieved TCSEC B2 status with some modifications?) they tried feeding it every possible combination of bits that could make up an opcode and found several undocumented ones that worked.

author: BrianHG
author_rank: Super Contributor
timestamp: December 04, 2018, 05:35:50 am
content: Same with Motorola's 6502. Some games on the Atari800 personal computer used some of these messed up op-codes deliberately to achieve speedy shortcut programs, if I remember, weird things like noise generators, or mess with multiple registers and cpu flags simultaneously in a random way.

author: 0culus
author_rank: Super Contributor
timestamp: December 04, 2018, 06:24:10 am
content: Quote from: BrianHG on December 04, 2018, 05:35:50 amBreaking things is fun! From a security perspective, though, you'd rather not have those undocumented opcodes.On the topic of the thread, this reminds me of Kolmogorov complexity, which isn't computable.https://en.wikipedia.org/wiki/Kolmogorov_complexity#Uncomputability_of_Kolmogorov_complexity

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: December 04, 2018, 10:02:55 am
content: Quote from: BrianHG on December 04, 2018, 05:35:50 amMOS Technology :-)

author: JVR
author_rank: Regular Contributor
timestamp: December 04, 2018, 11:39:21 am
content: Its been done on an FPGA, years ago.http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.50.9691&rep=rep1&type=pdf

author: helius
author_rank: Super Contributor
timestamp: December 04, 2018, 12:11:46 pm
content: A configuration is not a program.In addition, the experiment did not test every possible configuration, since with the limited floorplan they considered there would be \$ 2^{1800} \$ possibilities, far more than the particles in the known universe.

author: GlennSprigg
author_rank: Super Contributor
timestamp: December 04, 2018, 01:40:57 pm
content: ?? Back to the original statement/hypothesis ... ??Obviously it would take an initial 'program', to run through & test such permutations!How that was coded/interpreted, and tested mid-functions for 'meaningful' resultsto me, would be the 'crux' of the issue.Further complicating this, and just for FUN!, about 15 years ago, I dared to Code an abomination!SELF analyzing and SELF 'modifying' code !!! (Impossible to fault-find later & document! ).It was a 'sort-of' artificial intelligence that re-wrote it's own code behind itself before re-looping.It pseudo randomly produced results that 'it' wanted to attain...

author: Richard Crowley
author_rank: Super Contributor
timestamp: December 04, 2018, 03:33:31 pm
content: Quote from: GlennSprigg on December 04, 2018, 01:40:57 pmSee? This is where it all starts. With an innocent prank.You will regret this when the machines take over the planet and we are all slaves.

author: GlennSprigg
author_rank: Super Contributor
timestamp: December 06, 2018, 12:39:04 pm
content: Quote from: Richard Crowley on December 04, 2018, 03:33:31 pmYep... and it sortof happens today! How many of you have dealt-with so called 'Fuzzy-Logic' devices.OR does one want to rely on a computer/chip that decides if just YOU die, or 3 other people indetecting an imminent collision with someone ?? 'Say'... 2 out of 3 have seatbelts on. Should theothers be judged? Computer detects that YOU have yours on, so now 1 life for 2. Computer 'decides'that in all fairness, there are no 'heros' so your life is most important!... The other vehicle was ONEdriver, but did his/her passenger 'egg' the driver on ?? The 'computer/chip' decides whether to swerveleft or right or not, knowing the obstacles and possible outcomes... That's our tomorrow...

author: sokoloff
author_rank: Super Contributor
timestamp: December 06, 2018, 01:32:43 pm
content: Are you offering that today's 200 pound bags of mostly salt water are doing a better job of it, though?

author: Bicurico
author_rank: Super Contributor
timestamp: December 06, 2018, 02:02:12 pm
content: A story made it to one of the german computer magazines in the 80ies.Justice has started to persecute software pirates and it came to public awareness, that software should not be copied illegally.So once a guy was investigated for having a copy of Microsoft Flight Simulator on his 5.25" floppy disk.He told the police that he was not sure about the legal aspect of his copy, because Flight Simulator magically appeared on the floppy after he randomly swiped a magnet over it.Naturally the odds of something like this happening are really reduced: let's say the floppy (of a Commodore 1541 drive) holds 170KB of data, so the total amount of combinations would be 256^(170*1024). That is a really big number!Coming back to the original subject of this thread: it is funny, I have played with this idea over the years, too.Let's reduce it to 1KB. As many of you know, there are tournaments where coders produce 1KB demos. For example:The demo scene has lots os such formats: 1KB, 4KB, 64KB, different platforms, etc.Let's take something simple as the C64. A C64 emulator for PC would generate all possible 1KB programs and run it. If the virtual C64 crashes, the tested program is rejected.Imagine that 1.000 permutations could be tested in 1 second.Possible combinations: 256^1024Required time: 256^1024/1000 secondsI won't even bother to make the maths on how many years that would be... (something like 5.5E2397 - a number with 2397 zeros).This is actually a slap in the face of people like myself who strongly believe in the theory of the evolution of species: in fact, if we consider our current DNA string as a piece of code (base 4 instead of base 2), then what are the chances that the age of planet earth is great enough to have produced our DNA by simple random changes and selection of the fittest? In other words, aren't there far too many possible combinations in regards to outputting something useful, for this theory to have a major flaw?Cheers,Vitor

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 06, 2018, 06:17:28 pm
content: Quote from: Bicurico on December 06, 2018, 02:02:12 pmThere is nothing so flawed as an incomplete theory...The trouble with making simple comparisons between biology and computer science, is that even for as overgrown and shitty as our software ecosystem is, it thoroughly pales in comparison to the absolute shit-show that is biology. We've only begun to suss out the simpler mechanisms at work -- like where some sequence of base pairs forms a gene, which codes for a protein which catalyzes some well-defined reaction, for which the substrate and product are likewise well understood. Some metabolism chains for instance are fairly well known in this way.At this time, there are probably... hundreds of pathways known to this level? We know of thousands (tens of thousands?) of proteins that consist of multiple sub-units complexed together, and hundreds or thousands that require "helper" proteins to fold into that form (or to chemically modify them in some way, at some stage), all of which are not understood to nearly the same degree. Or which cannot be known to such a degree, because of how many different things they react with, and in which ways. (Take the cytochrome P450 family, famous for detoxing various substances in the liver for example.)Even just in gene expression alone, there are -- at least it was my understanding -- short strips of otherwise-fatal RNA, constantly being transcribed, and immediately followed by strips that neutralize the other ones (by joining together as a complex, which is then marked for recycling, or something like that). It's a clusterfuck all the way to the bottom -- perhaps we should not be insulted by the poor quality of software, but celebrate it instead?-- but even these seemingly wasteful reactions may serve purposes, for better or for worse. For example, delaying or sequencing transcription, or providing redundancy for error correction, or more kinds of kill-switch to trigger autolysis in the event of uncorrected mutation; or just outright completely redundant junk.Consider, also, how reproduction and mutation are performed. Genes are mixed and matched, pieces are cut and pasted to different parts of the chromosome (or even between chromosomes I think?), or copied or deleted, and spontaneous, random errors do occur as well.These are not things we can do on our computers, because our computers are far too error-prone. A mutated program is very likely to be shut down suddenly by protection fault or the like. We can still mutate code, but it must be done on a more subtle level, the AST (abstract syntax tree) for example, not raw machine code.It's also hard to appreciate just how fast a chemical solution is capable of computing, for certain values of "compute". A glass of water contains a billion trillion trillion water molecules, give or take. And they're all "jiggling" around on the femtosecond scale. Replace a tiny fraction of those molecules with assorted proteins and goop, and after a few seconds, you'll have encountered almost every conceivable combination of molecule and orientation there. Reaction is inevitable!And this isn't even considering quantum computation, as such. It's very unlikely that coherent states are persistent over more than a few interactions, in just any sequence of interactions. "Classical" chemistry -- equilibria, diffusion and such -- suffices to tell the story for the most part. That doesn't prevent some very carefully crafted reactions from taking advantage -- it seems likely that photosynthesis involves such a chain, IIRC (though i forget if it has been mapped out yet).Tim

author: sokoloff
author_rank: Super Contributor
timestamp: December 06, 2018, 07:10:08 pm
content: Quote from: Bicurico on December 06, 2018, 02:02:12 pmIf you posit only one planet in the universe, this might be a more compelling argument. Since planets are extremely common in the universe, you just have to account for the fact that on all the planets where random chance didn't line up in a productive way, the question you just posed isn't being asked. It's only being asked on those planets where random chance favored an outcome where the question could be asked.

author: MK14
author_rank: Super Contributor
timestamp: December 06, 2018, 07:12:00 pm
content: Quote from: T3sl4co1l on December 06, 2018, 06:17:28 pmIf it is true, that we have come into existence, by luck/randomness. Let's assume that is the case, for the purposes of this reply.Then Biology, has done an amazing job, of getting us to where we are.You can't suddenly, attack it, because it fails on good engineering principles, of efficiency (at the level of genes), or our lack of a proper (100%) understanding of how it all works.Analogy:I put a pile of random electronic components in a large tin, and shake it for a while. Then randomly flick some molten solder at it (like rain), for a bit.Then connect it all up, and (amazingly), it works as a radio (or calculator, or computer, or something).It might be a 1 in 10^12345... chance of it working, but if it does, it would be a miracle.Yet, you are now criticizing my radio (or calculator), made that way. For being inefficient, difficult to understand how it works, and being very messy.But it is not suppose to be good at any of those things, assuming it was created by "accident".

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: December 06, 2018, 07:33:54 pm
content: The recombination of generic material is not a totally random process. Half of the genome is from either parent and mutations are typically affecting only single genes and certainly don't affect the whole genome.Besides, it wasn't like complex animals crawled out of the puddle immediately. Evolution is a slow process and not remotely comparable to that radio example. Actually the only weak spot of the evolution theory is the beginning. I.e. it's incredibly hard to imagine how the very first lifeforms somehow self-assembled from organic molecules - and how this happened in a way that they could reproduce and evolve (even though viruses self-assemble and reproduce in a way without even being really alive).There are several theories how crystal structures could have played a role in forming the first DNA, but it still seems like a pretty unlikely thing to happen. Then again, the theories about how the universe appeared out of nowhere (to put it in a very simplified way) are even harder to accept and still we are here, so obviously, even if nearly impossible, it just happened somehow. Then again, if it hadn't, we couldn't wonder about this anyway.

author: MK14
author_rank: Super Contributor
timestamp: December 06, 2018, 08:02:42 pm
content: Quote from: 0xdeadbeef on December 06, 2018, 07:33:54 pmQuote from: 0xdeadbeef on December 06, 2018, 07:33:54 pmYes. But, if you follow on from my "analogy". We are talking about the "radio", 100,000,000 years in the future (i.e. us now, not when life first started). By which time, it has "evolved", to have its own firmware and re-programmable electronics.So, it too, can evolve to the next stages, WITHOUT needing a fully random change, to make the next level/creature/MK998,432,423th Radio.Because initially, Biology had the same issue. It would have had to have started out from nothing. So it too, would have had to be fully random, at least initially. Which in all fairness, is stated, later in your post.

author: metrologist
author_rank: Super Contributor
timestamp: December 06, 2018, 08:22:09 pm
content: I don't know about evolution as an analogy, but maybe. I do not think we could be here if it was completely random, however. I think it is heavily influenced by the environment, like fluid down a funnel.What if we start at one bit, then two, and so on, but for each code set, we test that sequence and eliminate sequences that are nonsensical, and continue only to build and test using valid sequences? We already have huge libraries of these code blocks.

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: December 06, 2018, 08:26:40 pm
content: Another problem with that radio analogy is the lack of a "selection pressure". Actually this is very easily defined in biology, as an organism that isn't able to live long enough to reproduce (as often as possible) is less successful and thus won't be able to spread its genome. The surprising thing is that while this process is not at all target oriented, it comes to surprising results (even if these usually involve several detours).Now when trying to simulate this with genetic algorithms and the like, the problem is that the "success" criterion is much more complex and the process is much too target oriented and short sighted.I.e. nobody ever defined targets like "can fly", "can dive to the ground of the ocean" or whatever for any animal and that it still happened doesn't prove it had to.So assuming that altering an algorithm with proper success criterionmustresult in a proper solution is nonsense and shows a total misunderstanding of evolution.

author: MK14
author_rank: Super Contributor
timestamp: December 06, 2018, 08:30:42 pm
content: Quote from: metrologist on December 06, 2018, 08:22:09 pmIf we combine wondering about how life first started and how the 32kB of memory, could evolve, especially, initially ?I think it basically boils down to the need to initially develop (as a minimum), a "copying, self-duplication method/system".Then, you can create lots of copies and various aspects of evolution, can start to appear.In a computer system, usually very few instructions are actually needed, to just copy memory (the initial program), from one location to another.Perhaps, 6 to 20 bytes, call it 8 bytes.8 bytes = 256^8 = 1.84 x 10^19, which is vaguely doable, eventually.Then the self-replicating program, can make copies all over the place (Biologically via Planet Earth, or within a computer system), which can then potentially eventually evolve to something better and more sophisticated.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 06, 2018, 08:41:50 pm
content: Quote from: MK14 on December 06, 2018, 07:12:00 pmThe loaded language I used, is an example that one "in the business" might use, when making such a comparison.Given your reaction, I see it has served its purpose, illustrating the difference between those fields -- biology and computer science -- and how what is true for one, need not be true for the other.Namely: we assert valued judgements concerning various patterns seen in CS. Spaghetti code is the ultimate no-no; production code is frequently steeped in "technical debt"; the glory of "Perfect Code"; etc. These are entirely human in origin; nothing that exists in reality apart from ourselves, has an innate value judgement associated with it. In short: code is simply code, and biology is just biology. Evolution is, arguably, a struggle, but it is neither a positive or negative progression; it simply is.But in as much as we might draw an analogy between CS and Bio, it is inarguable that genetic code is the ultimate spaghetti code (ah, pun intended, too, as the case may be)!QuoteAh, the oversimplification fallacy!Chemistry is more like a tin full of magnets, jostled about with enough force to occasionally overcome their attractive force, making them stick and unstick and move around. Some magnets have many poles, some are strong, some weak. Some have more of one or the other kind (ah, this is where the magnet analogy fails us, because we do not have magnetic monopoles -- but atoms do have electronegativity).You can see already, there will be a great deal of preference, narrowing down that truly enormous possible configuration space -- from the ten-to-the-factorial-something range, to a more modest, heh, well, still unimaginably large, but vastly smaller in any case (and, consequently, lower entropy than was imagined -- since entropy goes as log(available states) times k_B).Things get very interesting when catalytic, and autocatalytic, molecules appear, which hasten the creation of suspiciously biological-looking molecules, and colloidal micelles and so on, and it only takes another billion years maybe at that point to invent something like cyanobacteria.Lucky, absolutely, but a billion years is a lot of time in which to see a whole lot of chemical reactions. To excuse them away just because you personally don't know about them, would be the greater shame.Tim

author: MK14
author_rank: Super Contributor
timestamp: December 06, 2018, 08:48:55 pm
content: Quote from: 0xdeadbeef on December 06, 2018, 08:26:40 pmNot necessarily.Let's say a space ship, full of electronic parts, crashes on some, otherwise empty planet, somewhere. Making a giant pile of electronic parts, wires and stuff.If a 1 in 10^123456789.......... chance occurs, the first thing it might need to make is an oscillator. That can then cause vibrations, via a speaker, solenoid, relay (coil), motor or something.Those vibrations/shaking, may eventually cause other circuits, to eventually evolve(self assemble via vibrations). But ones which are more sophisticated.Eventually, inventing (evolution), an electronic equivalent of DNA/genes, and self assembly/duplication.I.e. maybe some kind of very simple 3D printer.Maybe the planet, so happens to be covered in easily melted plastic, ready for the 3D printer (similar to how Earth happened to have organic or similar, materials and air (Oxygen), water and Carbon etc, ready for conventional life to form).So, eventually better and better 3D printers form, and eventually they invent some kind of evolution produced brain.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 06, 2018, 08:54:41 pm
content: Quote from: 0xdeadbeef on December 06, 2018, 08:26:40 pmIndeed, there was an experiment where cellular automata were left to "reproduce" (I don't remember -- or didn't read the paper to find the details -- what basis this was on, if it was random VM code, or random ASTs or what), where each cell could interact with its neighbors, a genetic algorithm was ran without constraints (just reproduction, random death and random creation), and left to run for many generations.The result was discovering an emergent constraint: unguided evolution prefers persistence, reproduction; "life" as we call it when implemented by biological systems.In what way was it "life"? It was reproducing with consistent code from generation to generation, and it out-competed less "fit" lifeforms. Also, as populations evolved and changed, different "species" arose, and out-competed one another, just as colonies spread across a Petri dish.But again, I don't remember how much, or what kind of code was necessary to produce such an outcome.Similar topics from CS:A Quine program, which outputs its source code, which when compiled, outputs its source code...A more active, self-referential version, the infinite interpreter (the famous example being a Lisp interpreter, which calls a Quine of itself, and so on until the stack explodes)The smallest (currently known) uncomputable program, which requires something like a 1700-state Turing machineThere are analogies between life-as-we-know-it and these CS topics (e.g., Hofstadter), which if assumed true, suggest that life itself is the embodiment of trying to execute such an uncomputable program; and that natural examples require perhaps a few megs of code and data (genes and proteins), not that those are trying to be minimal examples of course.Tim

author: Berni
author_rank: Super Contributor
timestamp: December 06, 2018, 09:08:37 pm
content: On the topic of executing random code here is a guy that did it on purpose:The purpose behind it however is to find undocumented instructions on processors so he goes trough various methods of how to find them by basically randomly trying op codes.The problem is that some of them really crash a system, so for investigating some of it what was needed is a PC running the tests on another PC over the network and having the ability to reboot it remotely by putting a relay on its reset button. That way it can be automatically recovered from when it really crashes badly.

author: MK14
author_rank: Super Contributor
timestamp: December 06, 2018, 09:10:18 pm
content: Quote from: T3sl4co1l on December 06, 2018, 08:41:50 pmI agree. It is "valued judgments", i.e. 'beauty is in the eye of the beholder' etc.But, "it is inarguable that genetic code is the ultimate spaghetti code", is not necessarily the case.Maybe the so called 'spaghetti code', is a necessary evil, of the evolutionary process. So, without it, evolution would not work out so well.I.e. It could be a sort of scratch pad area, with snippets of genetic code, ready to form, larger, viable genes in the future.Quote from: T3sl4co1l on December 06, 2018, 08:41:50 pmI also agree with that.A better analogy, if I was re-writing that original post. Would be to say it was an electronics kit, with small, magnetically couple-able parts (I think you can buy such electronics kits in real life).Perhaps put into a tumble drier, until an external human can hear the sound of a radio/music playing, and then immediately stop the tumble drier.But even that change, would still have major issues, compared to a highly versatile system. Such as the chemical/magnetic ones, you have mentioned.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 06, 2018, 11:27:12 pm
content: What is it called, where because we are the product of chance, and that had a very small chance of occurring, we tend to think that it is special? Like a person who wins the $$$$ lottery believing that their numbers were preordained in some way to win.Just because we are unlikely to have occurred by chance, doesn't mean that we are special...I find the whole concept of entropy quite fascinating.How hydrogen is 'simple' so more complex things get built from it by nuclear processes that release energy.How sunlight is has low entropy, and plants and others can use that to enable photosynthesis that enables the food chain, (and we can use it for solar cells).And the that universe is largely cold, dark and empty, allowing it to acting as heat sink for stars.

author: cdev
author_rank: Super Contributor
timestamp: December 07, 2018, 10:01:10 pm
content: Self-writing programs that watch a skilled person perform their work and build up a decision tree that then does it better and better will make it possible for all predictable tasks to be done by computers without any need for programmers fairly soon."Machine Learning" as its called can now simply create binary blobs, largely non-human readable programs that always deliver the same output for the same input.When the inputs vary and that specific set of circumstances had not happened before it will hand the task over to a live human person so the correct set of responses can be recorded to be used in the future.

author: MK14
author_rank: Super Contributor
timestamp: December 07, 2018, 10:09:14 pm
content: Quote from: cdev on December 07, 2018, 10:01:10 pmIf it was that easy and/or practicable, it probably would have already been done, ten, twenty or thirty years ago or more.As with lots of tasks, the first 90% of getting something done, may only take a month.But getting the final/last 10% done, might take another year, and it is still only 95% finished.E.g. Self driving cars.They have been perhaps 98% (ok, somewhere in the 80% to 99.99% range, depending on ones opinion) ready, for some time now.But getting the last 2% of the task, technically finished, is proving to be very hard.Because the last 2% of the task, involves some rare/difficult situations, where if the car system gets it wrong, unfortunately an accident, might occur.Whereas a real human driver, will just adapt and work out what to do, even if relatively rare/weird things occur.

author: james_s
author_rank: Super Contributor
timestamp: December 07, 2018, 11:38:49 pm
content: On the same note, if you were to pump out bitmaps of every possible combination of pixel values, you eventually would recreate digital versions of every classical masterpiece ever painted and photos of every person you've ever seen. The issue is less in creating the vast number of mostly garbage images, and more the challenge of picking out the few gems from the billions and billions of pictures of random looking noise.In either case you are talking such an unimaginably enormous number of iterations that it's probably going to be going still when the sun burns out.

author: cdev
author_rank: Super Contributor
timestamp: December 08, 2018, 01:37:18 am
content: They have been able to tell a computer topaint one picture using the style of another.