lainchan / λ

Generating True Random Numbers

Arc · 2024-01-10 03:41
Is there a way to generate true random numbers automatically? Of course you can go to random.org to generate if you need so. But I want to run a program in the background that constanly generates random numbers in order to use them in meaningful data. Is there a way to do this? Or should I use the random number site as a gateway to do so?
Unnamed · 2024-01-10 08:56
>>38110 >true You'll have to elaborate on what you mean by "true" and more importantly why you want a "true" one. Most of the time when people ask for a "true" RNG they just mean "not a PRNG" which usually reflects a misunderstanding of RNG in general. There are statically random PRNGs that are indistinguishable from random data and perfectly fine for most use cases. There are CSPRNGs that are statistically random, unpredictable, and prevent seed recovery. There are hardware options that measure some natural phenomenon as a way of gaining entropy, if you're unsatisfied with (CS)PRNGs for some reason, although I highly doubt your use case needs them, and there are foothills with them that often lead to less randomness. >But I want to run a program in the background that constanly generates random numbers in order to use them in meaningful data. /dev/urandom does this and uses various different system actions to increase entropy. There is a caveat that if you use it early after booting on machines that do not have hardware or processes that affect the entropy (for example, embedded machines with no peripherals and clock which resets each boot), then it may be predictable but for a desktop or server, that's a non-issue. Note that /dev/random makes some claims about blocking until sufficient entropy is guaranteed but it's poorly implemented and is actually much worse than just using /dev/urandom, and you should almost never use it. >should I use the random number site as a gateway to do so? no. You should have asked this in the beginners thread instead of making an entire thread for it >>37650
Dozer · 2024-01-10 10:22
>>38110 >Is there a way to generate true random numbers automatically? Yes. It requires specialized hardware. >But I want to run a program in the background that constanly generates random numbers in order to use them in meaningful data. Any one who considers arithmetical methods of producing random digits is living, of course, in a state of sin. >Is there a way to do this? There's a device called fuarrrkGOATS, or FG for short, that does just this: http://nosuchlabs.com Here are some quotes from the creator: >modern man usually is not buying hammer, or rng, per se, but rather a fantasy which comes in the box with the hammer. >lamer needs a trng like dog needs beets. afaik of the 200 sold, maybe handful ever plugged in.
Davis · 2024-01-10 14:37
>>38112 > specialized hardware You need a battery, a diode, a boost converter, and a resistor. I swear, it’s not that hard.
Donna Hawthorne · 2024-01-13 04:06
>>38112 >specialized hardware On x86 it's just RDSEED (and it's "pseudorandom" equivalent RDRAND). In practice you should use it as an input to a CPRNG like ChaCha20 (Linux's /dev/urandom uses it, ChaCha12 would suffice too), which is secure *because* it looks completely random.
clutch · 2024-05-27 14:47
>>38110 One way to generate random numbers on linux machines is to poll the RNG so fast that you induce jitter. Use GPS time as a seed. Identify jitter by checking timestamp: iff n2-n1 < (your choice here... idk like 1.5KHz or something) Jitter will be fairly random and fairly often if you poll fast enough... When jitter, get random number.
Mario Rossi · 2024-05-27 15:32
>But I want to run a program in the background that constanly generates random numbers in order to use them in meaningful data. On linux the kernel already does this for you, it's called /dev/urandom. The 'entropy' (input) of this RNG is true randomness in the sense that it is usually derived from truly unpredictable circuits in hardware, as well as things that are very difficult/impossible to predict such as input timings and clock jitter, as other lainons have said. If you want to do it yourself, basically find a source of entropy (a common one is the mouse moving around) and feed it in to a hash function or stream cipher, forgetting the input. Redeed periodically by XOR'ing the current state with some new random data. Not that hard.
Roy Batty · 2024-05-27 15:40
Digital computers cant generate random numbers. Though an analogue computer maybe. Usually to get actually random numbers outside input it used as a randomizer.
Batou · 2024-05-27 18:23
>Is there a way to generate true random numbers automatically? Not if QM is deterministic. Obviously, a stochastic view is the most popular, but there isn't definitive evidence to support it. It's certainly possible that there are omnipotent beings and they have a back door into your computer.
Jens Hansen · 2024-05-29 16:28
>>39207 Digital computers have analog sensors. For example your mic. The noise on it can be sampled as rng. Niques theorem says your sample rate needs to be twice the frequency you wish to sample. That means in reverse any high frequency higher than twice your sample rate will appear as random noise.
Church · 2024-05-29 17:28
>>39230 The mic might pic up regular patterns of sound from the electric grid but yes that is one of the external methods, the others use cameras on some random like object like lava lamps or leaves blowing in the wind or use an optical sensor to detect dust particles.
Jet Black · 2024-05-30 18:06
>>39232 frequency of electric grid is always part of the mic noise on regular devices, overlayed are additional frequencies from other devices, simply switching anything on/off creates feedback into the grid. laptop running on battery avoids grid noise. Both however get noise from em fields inducing electricity in the wire.
x<->y · 2024-06-01 09:10
>>39230 >That means in reverse any high frequency higher than twice your sample rate will appear as random noise. No it doesn't. t means that you can only accurately distinguish between frequencies that are below the nyquist frequency and anything higher will alias.
The Fin · 2024-06-01 13:45
>>39258 https://www.shadertoy.com/view/4djSRW static high frequency signals sampled at low frequency appear as noise. People use it all the time for cheap pseudorandom numbers in computer graphics. Will patterns emerge? Sure but the frequency in a mic aint stable regardless because the noise sources are real world events so you wont deal with repeated patterns.
H.R. Giger · 2024-06-01 18:09
>>39260 >static high frequency signals sampled at low frequency appear as noise Exactly, noise in -> noise out but you can't "create" noise just by sampling differently, a clean signal in -> a clean signal out only it has been aliased.
Pulse · 2024-06-02 07:21
>>39267 If you sample a simple sinus curve at its frequency you get 1,-1,1,-1... , the values will keep repeating in a sequence of just 2 numbers even if you shift the window, sampling at different frequency however causes a mismatch which drastically lengthens the sequence of numbers til a pattern shows up. You "create noise" in the sense of a mismatch lengthening the period of the pattern. This is basically just a smallest common denominator problem and the easiest way to extend it further using irrational numbers which is why you see everyone use values like pi in their rng functions.
Meddler · 2024-06-02 14:32
>>39273 >1,-1,1,-1 That's twice its frequency >You "create noise" in the sense of a mismatch lengthening the period of the pattern. Still not noise, some simple analysis on a few results would make it trivial to predict future results. The "noise" you're after in order to generate entropy is unpredictable, a predictable result like this is quite low entropy -> not very useful as a prng.
Splicer · 2024-06-02 14:38
>>39273 >easiest way to extend it further using irrational numbers which is why you see everyone use values like pi in their rng functions This doesn't hold. Computers can't store irrational numbers so if the prng relied on the presence of irrational numbers it wouldn't be possible to implement correctly in a computer.
Yuki Nagato · 2024-06-02 14:50
>>39279 Sure, if you are sampling a pure sine wave. However actual sound is not a pure sine wave and has noise. Electrical equipment does too. You can do all kinds of things to amplify noise so that it drowns out signal, and sampling at a high frequency is one way to do that because a) most equipment is like kicking dead whales down the beach at picking up anything outside of adult human hearing range b) there tends to be a lot more random crap in high-frequency bands. You can also do stuff in the pre-digital stage such as amplifying and clipping your signal for "better" results -- in quotes here because basically you want your analog circuit to be as soykafty as possible. Remember that you're always going to be feeding this into a cryptographic hash function, so even though you have a very predictable 60 Hz hum (which most microphones wouldn't even pick up very well), as long as there is enough noise in the signal, patterns in the output will not be easily detectable or predictable.
Y.T · 2024-06-02 17:36
>>39281 Woah you started by claiming that Nyquist's theorem was somehow related to measuring noise and >That means in reverse any high frequency higher than twice your sample rate will appear as random noise. Which implies a lower sampling frequency will give you a better result for prng but now >sampling at a high frequency is one way to do that The rest of your post is discussing measuring noise and I'm not disputing that apart from a couple minor nitpicks.
typedef · 2024-06-02 18:32
>>39207 >>39230 Even if you're only working within the digital world, you'd be amazed how far you can get just by polling keystrokes and the time between them.
Milner · 2024-06-03 00:53
>>39279 Its increasing noise because lengthening the repeating period = need to measure longer to predict it. >>39280 All numbers suffer that limitation. Point is you know irrational numbers maximize the period length until a pattern emerges which makes using them the best option. >>39284 different posters
Lord Nikon · 2024-06-05 04:58
>>39290 >lengthening the repeating period = need to measure longer to predict it Not really. Your minimum samples depends on how many frequencies you want to differentiate between, not what their frequencies are. If you meant specifically with an FFT, that would be true but only because the FFT calculates the magnitude of fixed frequencies and isn't designed to calculate the frequencies themselves. >All numbers suffer that limitation. I don't understand your point here. >Point is you know irrational numbers maximize the period length until a pattern emerges which makes using them the best option. As I said before, once they are encoded into fixed-length binary they are no longer irrational. They are chosen here because they are easy candidates for a part of the prng process, you can't make a good prng entirely out of approximations of irrational numbers. >different posters My bad.
Koichiro · 2024-06-05 07:34
>>39302 example sequences: 111111 123123 12345671234567 you can predict first on first number, second at minimum 4 values and so on sequence length matters for predicting next number >As I said before, once they are encoded into fixed-length binary they are no longer irrational. Im just calling them irrational numbers because pi,e,... are called irrational numbers. I understand their representation in a pc isn't accurate but we don't have a special term to address this. >>I don't understand your point here. Pseudorandom function are just hash functions and rely on a mix of numbers as factors and modulo/fract shifting input to a new value. Simply easier to use known irrational numbers over creating your own values. They aren't really irrational but they are as good as it gets. You can also use primes for something like (input * 3) % 7 as primes ensure the mismatch but they aren't floating point and floating errors are used to increase noise with a combination like fraction( ( input * 7)%pi )
Bobby Newmark · 2024-06-19 22:40
481 Here's a random number just for you.
if · 2024-08-28 08:33
>>38110 Linux's getrandom function or /dev/urandom device is good enough for almost all purposes. But if you want "true" randomness, there are hardware devices for that.
swap · 2024-08-28 09:22
As far as is currently known in physics, the decay of radioactive material is *truly* random. (The deterministic theories of quantum mechanics are not generally accepted and are being slowly and steadily ruled out by experiment). That means that if you get a little bit of something radioactive, say a geiger counter test card, and a cheap cellphone plug-in geiger counter that is sensitive to it, you have a truly random input source based on the decay detections. Then it would be up to you to write a program that uses the truly random input to generate truly random numbers.
Unsigned · 2024-08-28 13:38
I am posting links to the presendation pdf and audio of a single defcon presentation dealing with the physics/hardware RNG idea, and getting into the software details. https://defcon.org/images/defcon-17/dc-17-presentations/defcon-17-sean_boyce-quantum_random.pdf https://media.defcon.org/DEF%20CON%2017/DEF%20CON%2017%20audio/DEFCON%2017%20Hacking%20Conference%20Presentation%20By%20Sean%20Boyce%20-%20Design%20and%20Implementation%20of%20a%20Quantum%20True%20number%20Generator%20-%20Audio.m4b To find more, go here https://defcon.org/html/links/dc-archives/dc-17-archive.html Then Ctrl + f "Design and Implementation of a Quantum True Random Number Generator"
Ivan Petrov · 2024-08-28 16:20
>>39893 there are usb geiger counters meant to be used as sensors attached to a phone. Beware though of fakes - since real ones are expensive and most customers dont have more sensors to compare the scammers abuse it selling cheap fakes for big profit.
array · 2024-08-28 19:01
>>39895 Point taken. Thank you. Now I will write some more stuff so I don't get a "message too short" error.
Jean Dupont · 2024-10-21 19:26
>>38110 True random numbers are uncompressible, meaning that they cannot be outputted by an algorithm that has a program size less than the random number. A number like 12345678910111213141516171819 is not random because the program: for (int i=0;i<20;i++) print(i) can output that number and is made up of less characters than the number itself. Whereas a number like 782951324901732019 is random because it could only be outputted by a program like print(782951324901732019) which consists of more characters than the number itself. In general, determining whether or not a number is random is uncomputable. Therefore, there is no algorithm that can output every random number. https://en.wikipedia.org/wiki/Kolmogorov_complexity#Kolmogorov_randomness
SHODAN · 2024-10-21 19:38
>>40222 Note that this is highly dependent on the model of computation/language you use. For instance, one could define a language where the empty string is a program which outputs 782951324901732019 . This is why a specific universal turing machine architecture is usually used. It's also closely related to the idea of information-theoretical randomness, i.e. entropy, which is usually what people mean by "random". Unlike kolmogorov complexity, there actually are reliable ways to produce this type of random number using electronic circuits.
list · 2024-10-22 07:14
>>38110 randomness is a complete illusion. slot machines aren't random, the illusion is just suspended by a lack of knowledge of how things are actually working beneath the surface. first, think about the XY problem here. WHY do you want to maximize randomness? what's the use case? then keep in mind that in order to maximize the illusion of randomness, you want to maximize the level of ignorance that the end user (or machine?) has. think about what you can do to your system to reduce the predictability. reduce the amount of information you share, or maybe increase the amount of information that needs to be obtained in order to make a prediction. as long as those two things can be increased, it's possible to make something that's "more random".
Batou · 2024-10-22 09:55
>>40222 Such a definition is bullshit because time complexity isn't considered. See https://www.angio.net/pi/whynotpi.html or any other technique to find a sequence in the digits of a transcendental number with very short formulas to compute.
car · 2024-10-22 10:06
>>40225 >randomness is a complete illusion. t. someone who has never studied elementary quantum mechanics
limited · 2024-10-22 10:09
>>40227 >randomness isn't a complete illusion. t. someone who has only studied elementary quantum mechanics
Netrunner · 2024-10-22 15:43
>>40225 "randomness" is different from "noncausality", although they are often mixed up. You are correct that hidden variables are usually the source of randomness, but that doesn't make them less random, and it doesn't mean that the more variables you hide the more random your output is. If you want to get right down to it, if we have some process p(t) and some process K for translating a number to a "randomized" number, the quality of the process K as a random number generator is the difficulty of guessing K(p(N)) given K(p(1)), K(p(2)), ... , K(p(N-1)). In other words, even if we know the precise physics of p (which we often don't), how much information does K(p) give us about the state of p? Designing a good RNG means designing a good system p so that it is very unlikely to fall in to a stable mode and is quite chaotic, and designing a process K which reveals enough information about p that a relatively small change in p can result in a substantially different K, but not enough that finding a state q so that K(q) = K(p) gives you much information about the future evolution of p. Such systems are actually quite easy to design -- the jitter in a ring oscillator circuit is a good example. >>40226 Why would that matter? In this case we're not defining numbers by some formula, such as for pi, we're defining them by a string of digits. You can always find an O(n) algorithm that prints a given finite string of digits. The question is how long that program needs to be. Additionally, if we think of the string of digits as being infinite (which makes more sense from a practical standpoint -- you want your RNG to be able to produce values indefinitely) then a string which has a high Kolmogorov complexity will be un-implementable, not just slow, on a real machine with finite memory. This is why pi is actually a poor RNG, because it has very small algorithms which generate its digits.
J.C. Denton · 2024-10-22 19:13
>>40222 Please don't listen to this Lainon. First, when people talk about randomness, they refer only to processes. Any fixed number is just as "random" as any other fixed number in that it was sampled randomly from a support of size 1. A _number_ is not random the _process of selecting the number_ is random. This covers infinite strings as we consider the process of selecting the next character. Second, if you read the Wikipedia article they link, it refutes their statement. > Whether a particular string is random, however, depends on the specific universal computer that is chosen. This is because a universal computer can have a particular string hard-coded in itself, and a program running on this universal computer can then simply refer to this hard-coded string using a short sequence of bits Third, do we say that the empty string is random? There is no shorter program which outputs it! Does this definition talk about incompressible strings? Kind of. Does this definition talk about random strings? Certainly not. Fourth > Therefore, there is no algorithm that can output every random number There is a trivial algorithm which is guaranteed to output every random number (assume here they mean natural number). Simply enumerate all natural numbers.
bit · 2024-10-22 19:21
>>40233 >do we say that the empty string is random? There is no shorter program which outputs it! Bit of a split hair there. >There is a trivial algorithm which is guaranteed to output every random number (assume here they mean natural number). >Simply enumerate all natural numbers. I assume it was meant that there is no algorithm that prints *only* the random numbers, which there certainly isn't. While not exactly what people mean by "random", this definition is very closely related. I believe the information a theoretical entropy of the remaining bits of a partial number, with the vague probability distribution of "probability of being output by a Turing machine", is directly related to its kolmogorov randomness. I also believe that the fact that the randomness is tied to the specific UTM you use is not usually considered an issue, because the set of random numbers for the machine M which are not random for the machine M' should generally have measure zero and itself be uncomputable.
list · 2024-10-23 01:39
I once made a library to pull random numbers from https://qrng.anu.edu.au/ https://pkgs.racket-lang.org/package/ANU-Web-Quantum-RNG "The random numbers are generated in real-time in our lab by measuring the quantum fluctuations of the vacuum."
HELIOS · 2024-10-23 03:10
>>40235 This is cool. I regret to inform you that I've placed a quantum backdoor in the vacuum and I am able to pinpoint exactly what the particles do, therefore being able to predict every single number produced. Shits and giggles aside, why did you choose Racket? It looks cool! but why a language like that? I'm asking perhaps because I've never touched a functional programming language and am probably scared of them
Dr. X · 2024-10-23 09:19
>>40236 racket is not a functional language. it's friendly to functional programming, the practice, but it's not enforcing any kind of purity.
Hopper · 2024-10-23 10:12
>>40238 If Haskell was the only functional language then they wouldn't have to call it a pure functional language. >>40236 >why did you choose Racket? My guess is because it's the only modern, well designed, popular, actively maintained lisp besides clojure and lain loves lisp.
Nanashi No Gombe · 2024-10-23 12:24
>>40239 racket has procedures only, not functions, but it's oriented toward having your procedures behaving like functions. haskell only has functions. scala has both iirc.
Void · 2024-10-23 13:25
>>40240 >haskell only has functions Is python an object oriented language even though not everything is an object?
Von Neumann · 2024-10-23 16:30
>>40227 wrong. I'm an electrical engineer, so I was basically forced to study basic quantum physics. it's not randomness like you think. they just use probability theory to shoehorn the belief that matter is corpuscular, when matter is actually just continuous waveforms.
HELIOS · 2024-10-23 16:48
>>40242 You are aware that there are experiments where interacting with an electron can be shown to make it behave as if it has a specific location in space, right? It's not as simple as "actually only the wavefunction exists Present Day, Present Time! AHAHAHAHAHA!".
The Oracle · 2024-10-23 21:41
>>40241 python >>> type(1) <class 'int'> >>> type(1.0) <class 'float'> >>> type("one") <class 'str'> >>> type(True) <class 'bool'> >>> type((1, 1)) <class 'tuple'> >>> type([1]) <class 'list'> >>> type({"1": 1}) <class 'dict'> >>> type({1}) <class 'set'> >>> dir() ['__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__'] >>> dir(__builtins__) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BaseExceptionGroup', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EncodingWarning', 'EnvironmentError', 'Exception', 'ExceptionGroup', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'ModuleNotFoundError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'PythonFinalizationError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'WindowsError', 'ZeroDivisionError', '_', '_IncompleteInputError', '__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'aiter', 'all', 'anext', 'any', 'ascii', 'bin', 'bool', 'breakpoint', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip'] >>> type(__builtins__) <class 'module'> >>> type(issubclass) <class 'builtin_function_or_method'> >>> def f(): pass ... >>> type(f) <class 'function'> >>> issubclass(bool, int) True >>> 5 - True 4 >>> 5 * False 0 >>> True == 1 and False == 0 True >>> bool.__mro__ (<class 'bool'>, <class 'int'>, <class 'object'>) >>> type(bool) <class 'type'> >>> type.__mro__ (<class 'type'>, <class 'object'>) >>> dir(object) ['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] >>> object.__dir__ <method '__dir__' of 'object' objects> >>> type(object.__dir__) <class 'method_descriptor'> >>> object.__dir__(object) ['__new__', '__repr__', '__call__', '__getattribute__', '__setattr__', '__delattr__', '__init__', '__or__', '__ror__', 'mro', '__subclasses__', '__prepare__', '__instancecheck__', '__subclasscheck__', '__dir__', '__sizeof__', '__basicsize__', '__itemsize__', '__flags__', '__weakrefoffset__', '__base__', '__dictoffset__', '__name__', '__qualname__', '__bases__', '__mro__', '__module__', '__abstractmethods__', '__dict__', '__doc__', '__text_signature__', '__annotations__', '__type_params__', '__hash__', '__str__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__reduce_ex__', '__reduce__', '__getstate__', '__subclasshook__', '__init_subclass__', '__format__', '__class__'] >>> dir(bool) ['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__getstate__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'as_integer_ratio', 'bit_count', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'is_integer', 'numerator', 'real', 'to_bytes'] >>> dir(int) ['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__getstate__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'as_integer_ratio', 'bit_count', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'is_integer', 'numerator', 'real', 'to_bytes'] >Everything in Python is an object, and everything can have attributes and methods. All functions have a built-in attribute __doc__, which returns the docstring defined in the function’s source code. The sys module is an object which has (among other things) an attribute called path. And so forth. >Still, this doesn’t answer the more fundamental question: what is an object? Different programming languages define “object” in different ways. In some, it means that all objects must have attributes and methods; in others, it means that all objects are subclassable. In Python, the definition is looser. Some objects have neither attributes nor methods, but they could. Not all objects are subclassable. But everything is an object in the sense that it can be assigned to a variable or passed as an argument to a function. >You may have heard the term “first-class object” in other programming contexts. In Python, functions are first-class objects. You can pass a function as an argument to another function. Modules are first-class objects. You can pass an entire module as an argument to a function. Classes are first-class objects, and individual instances of a class are also first-class objects. >This is important, so I’m going to repeat it in case you missed it the first few times: everything in Python is an object. Strings are objects. Lists are objects. Functions are objects. Classes are objects. Class instances are objects. Even modules are objects. - Dive Into Python 3 So I'd say that Python is definitely an object-oriented language. The fact that Python's version of OOP is inelegant, clunky, hacky in comparison to, say, Ruby is another matter.
Roger Pollack · 2024-10-24 03:48
>>40241 python oop is trash but the language is definitively oriented towards object since the base data structure is an object. the base data structure of haskell is a function (everything is a function). racket everything is not a function, not an object, not anything. racket is oriented towards s-expressions represented as lists, i wouldn't go further.
Liet Kynes · 2024-10-24 06:27
>>40243 which experiments? if you have to model a “particle” such that it exists in two locations at once, it’s probably not a particle.
Unnamed · 2024-10-24 14:19
>>40250 Like measurement, i.e. collapsing the wave function to a particular region. Don't you think the fact that classical physics somehow emerge from quantum theory implies particles being indeed physical objects with mass? Objects have it's wavelengths and you refuse to believe it because it's hard, perhaps impossible, to imagine.
Davis · 2024-10-24 20:39
>>40253 The things you're saying about physics are pretty much just word-salad. You don't seem to have any real knowledge of quantum mechanics.
Switch · 2024-10-24 22:20
>>40250 The basic double slit experiment... If you detect which slit an electron goes through, it stops acting like a wave and starts acting like a point charge. This is like the first thing you learn in any quantum mechanics, how have you not heard of it?
Boole · 2024-10-25 01:04
>>40256 Don't even bother to explain this to him cause he's a Terrence Howard typa guy that will simply reject empirical evidence, and tell you he's smart and you stupid. Philosopher at best, not a scientist.
Dr. X · 2024-10-25 06:33
>>40256 I'm pretty sure that's not how it works. it behaves as a point charge when you restrict to the quantity that consensus identifies as "one (1) photon". then, as you keep sending more photons, one after the other, it builds a wave distribution pattern that has full interference. this means that according to the corpuscular theory, these billiard ball particles from the future are somehow "impacting" billiard ball particles from the past. >>40257 I took EE in undergrad. I'm not a scientist
Jim Hilger · 2024-10-25 14:24
>>40259 >this means that according to the corpuscular theory, these billiard ball particles from the future are somehow "impacting" billiard ball particles from the past. Is this "corpuscular theory" your pet theory or I'd it supposed to be one that is in common scientific parlance? The diffraction pattern is usually interpreted to show that the electron is interfering with itself in the way a wave would.
swap · 2024-10-25 16:17
>>40261 that's my point. corpuscular theory is what Robert Boyle initially proposed as the simplest substance of matter. it's taken from alchemy and is the foundational principle of modern, every-day chemistry. but we know now that the simplest form of matter is a wave.
Backus · 2024-10-26 06:40
>>38110 >Is there a way to generate true random numbers automatically? Yes. Some SoCs have TRNG ability built-in, streaming a von Neumann whitened signal. The original Raspberry Pi Zero was one of the boards using those SoCs (Broadcomm BCM2835). It was a fairly esoteric build (and unusually undocumented in the spec) , so can't find the original hacks of how it was done. Probably many more options exist now though. e.g. Hook up a sensor to SBC and monitor particle decay in the radioactive source from an old fire alarm. Seems you can turn a Raspberry Pico (i.e. the RP2040 chip) into a TRNG with firmware change to make use of its sensors. https://www.picokeys.com/pico-rng/
Joey · 2024-10-26 12:33
Intel invented a TRNG back in 1999 and published a full paper about it. This is not how the instruction RDRAND is implemented.
Tomohisa "Tom" Kanezaki · 2024-10-26 12:42
more about noises in circuitry
Anamika · 2024-10-26 14:26
>>40262 But a chemist or physicist would never tell you that an electron is going back in time to bounce off itself. As far as I can tell, that is entirely of your invention. They would tell you that depending on the conditions of the experiment, the electron can be made to behave like a wave or like a particle.
Neo · 2024-10-27 16:53
>>40270 no it's not "entirely of my invention", this is what I was taught by the actual physicists and chemists, who actually taught me, at my actual school. you were not properly taught the double slit experiment. go back and re-examine your notes and get back to me. again, the contradiction within the experiment is that particles in future "interfere" with particles in the past, which, after a sufficient amount of particles have been detected, forms a perfect interference distribution. of course, particles in the future impacting particles in the past is not possible, and it doesn't happen, because particles don't exist. which is my point.
Tyrell Wellick · 2024-10-28 04:57
The whole point of wave/particle duality is that neither is the "real" aspect of matter alone. The only real real aspect of matter is wave/particle duality. You can suspect that the "real" aspect is just one or the other, but you can't verify it experimentally, so it isn't science. Yes, that's counter-intuitive and hard to accept, but that's quantum mechanics for you.
Just another Random Lainon · 2024-10-28 12:32
>>40272 Could you point me to the textbook you used? I'm very interested to read it.
overriding · 2024-10-30 19:41
>>40239 >pure functional language Here "pure" is also a comment on the language itself and not on it's functional nature so yes if Haskell was the only functional language then there's a good chance it would still be called a pure functional language.
Torvalds · 2024-10-31 00:01
>>40270 https://journals.aps.org/pr/abstract/10.1103/PhysRev.76.749 Hate Dun-Krueg pwn n00bz simple as
Chan Siu Ming · 2024-10-31 02:35
>>40288 I believe you are sorely mistaken about the meaning of this paper. The "electrons traveling back in time" are actually just time-reversed paths of positrons, which are in fact traveling forwards in time. The backwards trajectories look like a useful mathematical model, but not a claim of actual travel backwards in time. This is made quite clear in figures 2 and 3. I'm also dubious this would have any implications for the double-slit experiment, but I'm happy to be proved wrong as antiparticles are not something I know a lot about.
Roger Pollack · 2024-11-02 15:04
>>38110 Chaos is when two independent series meet. Make one program generate a pseudo random number and run another program this number of time.