OPEN THREAD 20200331

Basically, all legal free speech is allowed. We will assist the authorities in dealing with illegal speech. You are each other’s moderators. Have fun. And don’t forget to MAGA at nuclear levels.

After going through the elements, we now enjoy a sequence of RANDOM somewhat pseudo-random topics that will be thrown out for investigation and commentary on each open thread. At some point, in a way something like composite numbers, I will accidentally hit a second occurrence of one of them – that’s just normal.

Have fun!

Citizen U

(a.k.a. W on the OTHER site)

Day 146 – Octahedral Numbers and Twin Primes

23 thoughts on “OPEN THREAD 20200331

  1. (2) Probably more than you ever wanted to know about twin primes — https://en.wikipedia.org/wiki/Twin_prime .

    This subject, by contrast, is ancient — folks have been batting around various parts of it since the 1800s. Not discussed in the Wikipoo text, however, is a practical matter regarding cryptography. Various encryption techniques involve finding the prime factors of a very large number. [Which, BTW, can lead you down the rabbit hole of RSA numbers….. https://en.wikipedia.org/wiki/RSA_numbers . The smallest RSA number has a hundred decimal digits RSA-100 = 1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139, and is factored as RSA-100 = 37975227936943673922808872755445627854565536638199 × 40094690950920881030683735292761468389214899724061 ]

    Now, here’s the thing — if you have a 200-digit number with two prime factors, and one of them is 17, this number is essentially useless for cryptography. You have to have a long product with two long prime factors…..meaning that they’re close to the same size…..meaning, “ideally”, they’d be undiscovered twin primes. What makes this not really ideal is that people are devoting more resources to finding twin primes than ones that start 379…. and 400…. Not to mention that twin primes have odd quirks like the number between them always being a multiple of six.

    There is some good news for seekers of large primes and their products — based on the work of Yitang Zhang, there are infinitely many pairs of primes that differ from each other by less than 246.

    Liked by 1 person

      1. *sigh* Back when Scientific American was a great magazine.

        Now it’s full of garbage articles about climate change and population density.

        Iowahawk’s “skin suit” quote comes to mind……

        Liked by 1 person

  2. A secret agent was sent to Ireland to pick up sensitive information from an agent called Murphy. His instructions were to walk around town using a code phrase until he met his fellow agent. He found himself on a desolate country road and finally ran into a farmer.

    “Hello,” said the agent, “I’m looking for a man called Murphy.”

    “Well you’re in luck,” said the farmer. “As it happens, there’s a village right over the hill where a butcher is called Murphy, the baker is named Murphy, and three widows are called Murphy. In fact, my name is Murphy.”

    “Aha,” thought the agent, “here’s my man.” So he whispered the secret code: “The sun is shining … the grass is growing … the cows are ready for milking.”

    “Oh,” said the farmer, “you’re looking for Murphy the spy. He’s in the village over the other direction.”

    Like

  3. My friend asked why I always talked quietly. I told them it was because I didn’t want corporations spying on me.
    They laughed, I laughed, Alexa laughed…

    (Too short, doesn’t count….)

    Liked by 1 person

  4. The only way to pull off a Sunday afternoon “quickie” with their 8-year-old son in the flat, was to send him out on the balcony with a Mars Bar and tell him to report on all the street activities.

    Their 8-year old began his commentary as his parents put their plan into operation:

    “There’s a car being towed from the car park,” he shouted.

    “An ambulance just drove past.”

    “Looks like the Andersons have visitors,” he called out.

    “Matt’s riding a new bike!”

    “Looks like the Sanders are moving!”

    “Jason is on his skateboard!”

    After a few moments he announced, “The Coopers are having a shag!”

    Startled, his mum and dad shot up in bed! Dad cautiously called out, “How do you know that?”

    “Jimmy Cooper is standing on his balcony with a Mars Bar.”

    Liked by 1 person

  5. A Bulgarian spy is caught by the Russian KGB.

    They ask him what were the procedures of the Bulgarian agency. They torture him for two weeks but he tells them nothing. On a spy exchange he returns home and his comrades ask him what happened. He said “You’d better start learning the procedures or they’ll beat the shit out of you!”

    (Doesn’t count — too short).

    Liked by 1 person

  6. So, James Bond retired and a new 007 took his place.

    She had trained all her life for this role, and was eager to do her duty for queen and country. Her first day on the job, she was introduced to Q, who debriefed her on all her new gadgets. The one he was most proud of was a dress that could perform a number of secret agent functions, including emitting a gas that would disable enemies, an electric current that would render their weapons inoperative, and of course there was a handy parachute included.

    Later that day, our new hero found herself aboard the new HQ of the sinister Spectre, a huge aircraft that had been secretly hovering in the skies over London. She fought off the leader’s henchmen, her cover having been blown as she was posing as a guest at the cocktail party being held on the plane. It was time to use the dress’s secret features. “Gas!” she commanded, just as Q had taught her to. Nothing happened. “Electricity” she commanded, but still nothing. Finally, she decided to retreat, and leapt out of the plane.

    As she fell to her death, the parachute having failed to deploy, the leader of Spectre yelled after her, “Darling, that dress does nothing for you!”

    Liked by 1 person

  7. OK, a little exploration of the joys of booting……

    To start with, “booting” a computer comes from the phrase “to lift yourself up from your bootstraps” — you spend half the process standing on air.

    As it turns out, computers of the IBMPC lineage are particularly stupid and groggy when they wake-up. They know to start executing from the ROM BIOS (typically purchased on the motherboard), but not much more — and the ROM BIOS has a hard limit on how big it can be, dating back to the original IBMPC specification. The BIOS hands-off to a Master Boot Record of just 512 bytes — that’s not 512K, 512M…..that’s 512 bytes. Somewhere in that 512 bytes are instructions to load the next needed information off of a mass-storage device…..

    Liked by 1 person

  8. OK, let me try this again when I’m somewhat more awake…..

    When an x86 processor wakes up, it resets its program counter and starts executing BIOS at the 0xFFF0. This was historically in an EPROM chip that only had 16 access lines, so the processor — even an 8-core Xeon — starts out thinking it is a single-core 16-bit chip as far as memory access is concerned. A sixteen-bit chip can only access 65,536 bytes of memory. The BIOS does a power-on self-test (POST) routine where it collects information from around it, further initializes the processor, and decides where it will boot from.

    Along the way (still in BIOS), after it has initialized the processor, it initiates X86 “real mode” memory management — in which two 16-bit registers in the processor access memory, with four bits hanging off the side, resulting in 20-bits of available memory addresses — 1M (or 65K x 16). This allows it to remember where it decides to boot from (e.g. floppy, HD, CD, USB, network).

    At this point, the BIOS hands off control to the Master Boot Record (MBR), which is the first 512 bytes on the boot drive, according to the drive. This is not in any partition. It is read through BIOS calls to INT 13H. It doesn’t know files, it doesn’t know directories, it doesn’t know partitions, it just takes the data and executes it like Gospel. If your drive is smart enough to map that data somewhere other than sector 1, cylinder 0, head 0, that could be a very good thing.

    Lest you think that you can spread out across all 512 bytes like an in-law on a couch, be advised that your bootloader needs to fit in 0x00-0x1BD. Ox1BE-0x1FD is reserved for the “partition table” with room for up to four “partitions” — mind you, these are not like modern partitions, these are BIOS partitions that essentially are offsets on the drive. The remaining couple of bytes contain a “magic number” which is easiest to comprehend and dismiss as, essentially, a checksum.

    The executable part of the MBR, in Linux, is GRUB Stage 1. At this point, GRUB could theoretically load a kernel, give you a slap on the fanny, and send you out to access data with INT 13H. Oddly enough, few people are satisfied with this.

    Like

  9. Anyhoo, GRUB Stage 1 generally shuffles about until it can execute GRUB Stage 1.5 (see how well-thought-out this is?). GRUB Stage 1.5 can either reside in the first 32K of the boot device (of which the first 512 bytes were the MBR) — which is known as the DOS Compatibility Region……or, it can reside in the filesystem so long as it is accessible by INT 13H. Again, it is loaded into RAM and run without regard to filesystem, permissions, or other niceties.

    After GRUB Stage 1.5, the computer has a basic familiarity with filesystems and is starting to act in a coordinated way, but there are a couple of *slight* problems….. First, it can still only access 1M of memory; and, second, it really only knows how to access its boot device through INT 13H. So we can now move on to GRUB Stage 2.

    The first major thing that GRUB Stage 2 does is load the kernel into memory. This means that the kernel, at this point, has to be less than 1M because we’re still in “real mode” X86 memory and there ain’t no mo’. GRUB then has to shift into “protected mode” X86 memory (32-bit access instead of 20-bit access) and move the kernel into higher memory. To somewhat put this into perspective, the processor woke up as an Intel 8080, ran all that BIOS stuff as an 8086, and is now shifting into 80386 mode to move the kernel into higher memory. It, then, has to shift back. Once the kernel has less of a memory constraint, it can either uncompress or add modules.

    The second major thing that GRUB Stage 2 does is give the kernel a suitable learning environment. When operating, a kernel might need RAID drivers, LVM drivers, graphics drivers, network drivers, various peripheral drivers, IP6 stacks, and other such items. Including them in the kernel would make the kernel larger than 1M, which would gaff the loading process, so these are put into an initial ram file system (since GRUB and the kernel understand file systems after Stage 1.5). In keeping with UNIX’s flair for documenting things for people who don’t need them documented, this can be called “initramfs” or “initrd”. This is, again, loaded into RAM by GRUB using “real mode” X86 memory. Note that many of these drivers cannot actually run in “real mode” — but they can be loaded that way.

    Control is handed from GRUB to the kernel — using systemd or init or whatever — and the kernel switches to “protected mode” and populates the actual root file system piece-by-piece, appropriately. Oddly enough, it isn’t just “light up ‘/’ and overlay” — some of the initramfs can be running until quite a ways into the booting process.

    On one level, it’s a bunch of minutiae people might want to skip……but on another, it’s like a walk through a maze. I want to move, but I don’t have enough memory; ok, I got more memory, but I can’t reach the disk; I can just barely touch the disk, but don’t know where to start; I’ve started, but don’t have enough memory to proceed; I have more memory, but don’t know what to do…..

    Liked by 1 person

Leave a comment