pantantrant
pantantrant on Hacker News
After a finite amount of time, it will either report "Halt" or "Infinite Loop", but my program won't take forever, just a finite amount of time.
My program won't misidentify an very long loop as infinite, it'll just run the practically infinite loop in a finite amount of time and not trigger it.
Well, my program basically detects if a infinite loop is of 1 iteration or two iterations or three iterations or ... iterations, but only infinite loops and not finite loops and in a finite amount of time. This means that finite loops don't trigger my program ever, only infinite ones after a finite amount of time.
TLDR: A turing machine can run my program and determine whether any other program halts or infinite loops in a finite amount of time, never infinite only if the variable n can be infinitely large.
Well, my algorithm only says that it's an infinite loop if it actually is an infinite loop, not a "this loop has been running for 30 seconds" like the Linux Kernel has.
Yes, this infinite loop solver would take longer than the universe's age to print all possible configurations of this 4k monitor, but it would take a finite amount of time as opposed to infinite. (Provided that the integer n is big enough as a arbitrary precision fixed point unsigned integer)
A turing machine has unbound memory, so this isn't a problem.
Example:
ax is a 2 bit register initialized to 0.
100: add 1 ax
101: jmp 100
ax is 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3
0 is compared to 1, 1 is compared to 3, 3 is compared to 2, 2 is is compared to 2, wait, that's an infinite loop...
Example:
ax is a 2 bit register initialized to 0.
100: add 1 ax
101: jmp 100
ax is 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3
0 is compared to 1, 1 is compared to 3, 3 is compared to 2, 2 is is compared to 2, wait, that's an infinite loop...
Posted by
pantantrant on Wednesday March 20, 2024 @06:04PM
from the self-post dept.
I may be wrong about this, feel free to offer constructive criticism:Step 1: Load the program and initialize my Halting Problem program's variable n to 0.Step 2: Save the register context (meaning all the values in all the registers in a CPU) to memory location A.Step 3: Step variable n + 1 instructions.Step 4: Save the register context (meaning all the values in all the registers in a CPU) to...
Everything works except the HDMI port on Linux, so I can't use it as a monitor (haven't tried it on windows). Also got a Lenovo Wireless Keyboard and Mouse combo to go with it, basically a monitor sized laptop.
I like a all in one that comes with a battery, the HP Envy Move. I really can use it like a laptop and it has a 23.8" touchscreen.
Both aren't that reproducible, I keep running into sha256 hash nondeterminism when upgrading packages on nixos from source after not updating for a while and guix may be better at this.
I tried it and I'd rather # make install to install a program and # make -n install | xargs rm -rf to uninstall a program.
I've tried GoboLinux, I think it's better to just # make install and to uninstall, # make -n install | xargs rm -rf or Solus Linux's package manager. (Currently using CachyOS on a comfy HP Envy Move with a comfy Lenovo Wireless Keyboard and Mouse combo, my shameless plug.)
Finally, I'm not on parole or in the slammer.
I edited my post so if two candidates get 43% or more then restart. Thanks for the correction. Or it not restart but something else, am open to changing my mind. (see ChatGPT reply below)
I changed the printf line of code to this (printf("%2x", integer);) to make it a pseudorandom number generator and made a post about it
https://news.ycombinator.com/item?id=39462913 (10 Lines of code 3.4 bits of noise per byte weak pseudo random number generator)
I compiled it, ran ./vitalixprng &> output.txt and then ran Detect It Easy's entropy measuring tool on output.txt to give me around 3.41 bits of randomness per 8 bits.
It outputs 2 hex characters (hex character = half byte = 4 bits) per clock cycle.
It gives out pseudorandom output that looks like this:
28595827262617506937569201755869372950673748294758392
Which such systems have a system where ideas that are 43% or greater usually win? I want to know.
Edit: My dad says that Ukraine has such a system where 40% or more, cool.
Posted by
pantantrant on Thursday February 22, 2024 @09:24AM
from the self-post dept.
In my previous post, I made a pseudo random number generator (licensed under the Public Domain) where every bit is 42.5% random in 10 lines of code and it outputs a byte every clock cycle. Thoughts on this?Basically, it's a filter against my simple pseudorandom number generator so it keeps narrowly losing and winning for it is an extreme rarity.To win, one idea gets 43% or more of the votes. If...
Licensed under Public Domain
Posted by
pantantrant on Wednesday February 21, 2024 @10:35PM
from the self-post dept.
#include <stdio.h>unsigned integer = 0;unsigned int i = 0;int main (char argc, char* argv[]) { while (1) {
integer = integer + i;
i = i + 1;
printf("%2x", integer);
}
};Outputs 1 byte every clock cycle
I was looking for oeis.org today thanks. (Was thinking about a online list of interesting numbers in mathematics)
Also today found out that there's one exception, it generates a 3 which is prime.
Replace the printf line with printf("%1d", integer); to turn it into a pseudorandom number generator where the seed can be changed and the size of the integer can be changed (iterations before it repeats)
Posted by
pantantrant on Wednesday February 21, 2024 @08:43PM
from the self-post dept.
#include <stdio.h>unsigned integer = 0;unsigned int i = 0;int main (char argc, char* argv[]) { while (i<1000) {
integer = integer + i;
i = i + 1;
printf("%u\n", integer);
}
};Feel free to tell me ways to improve this.
Maybe the mentors were the friends we made along the way
const int randomnumber = 4;
// It was picked with a dice roll.
Posted by
pantantrant on Wednesday February 14, 2024 @04:33PM
from the github.com dept.
Ideas like the kernel and tiny c compiler being binaries but every other program is just source code that’s interpreted but not compiled by the tiny c compiler because source code is just data and not instructions. Also this helps with ease of debugging and editing mods. And currently there is serial port input and output but I can’t get it to boot like I could years ago (I wrote this for fun to see if I could)
Donations are welcome: https://www.gofundme.com/f/a-fpga-chip-that-works-with-zero-... and https://www.gofundme.com/f/formula-one-drift-by-squirting-wa...
Edit: The kernel doesn't have to be a binary, that's right, only the tiny c compiler needs to be a binary, the kernel can be interpreted and so can everything else.
It's about executable size not lines of code that's what I mean by code size.
I figured out how to build chromium with -Oz in guix:
In chromium.scm, I edited
(cons "--enable-custom-modes"
,flags))))))
into
(cons "--enable-custom-modes -Oz"
,flags))))))
Posted by
pantantrant on Thursday February 01, 2024 @01:08PM
from the self-post dept.