Whatever I feel is interesting - use the white search bar or post labels to find more - see my Facebook page for other content
Saturday, May 2, 2026
The Collatz conjecture and cryptographically secure random number generators (one-way functions exist!)
The Collatz Conjecture is an iterative process with two equations whereby given any initial integer, the eventual result will be 1. No counterexample has been found since the conjecture was made in 1937 despite testing every positive integer up to and far beyond a trillion. The conjecture remains unproven. It is also impossible to predict how many iterations it will take for any starting value to converge to 1.
I believe cryptographically secure random numbers can also be made through an iterative process. Alternating the natural logarithm and sine seem to work particularly well as they consistently produce a decimal with at least 10 digits. Before explaining it further, I will give a brief overview of the one-time pad method of cryptography. This is the only encryption method which is theoretically unbreakable.
Here's how it works. First, a plaintext dictionary is made where each unique word is assigned a 4-digit code between 0000 and 9999. That gives a vocabulary of 10,000 words, which is more than enough for clear communication. In any language, a vocabulary of 6,000 words covers about 95% of what is written or spoken. When the message is being encrypted, a random 4-digit number from a pad is added to each code word. Because there are two unknowns (the code word and the random number) but only one "equation" (the encrypted message), there is no way for an interceptor to decode the message. The only times encrypted messages from one-time pads have been cracked happened when the same set of random numbers were used for multiple messages.
I don't know how the KGB generated its random numbers, but I suspect they started out with something like tables of square roots, trigonometric functions, or logarithms. Those were worked out to 4 decimal places in old reference books such as Machinery's Handbook.
The problem with trying to use an equation or a group of them to produce random numbers through iteration is if the number of digits being iterated is the same as the seed value, eventually the seed value will be produced by one of the iterations. The obvious solution to this is to make the seed value a different number of digits than the iteration values. Here are a few examples to clarify:
If I use the calculator on my phone take the sine, logarithm, or square root of almost any 2-digit number, I will get a 10-digit decimal. I can use the first 8 digits to make two 4-digit code groups and use the last 2 digits to iterate the process.
sin(10) = 0.1736481777
sin(77) = 0.9743700648
sin(48) = 0.7431448255
I get the following as random numbers: 1736, 4817, 9743, 7006, 7431, 4482.
If I iterate further, I get stuck in a loop of sin(42), sin(64), and sin(63). This pattern, I suspect, plays out for every function similar to the Collatz conjecture. It probably also plays out for any combination of functions.
For the purposes of cryptography, it doesn't matter if a function or set of functions gets stuck in a loop so long as that takes several hundred iterations to happen.
If I start with a 3-digit seed value, and alternate ln and sin, I get something like this:
ln(123) = 4.8121843554
sin(54) = 0.8090169944
ln(44) = 3.7841896339
sin(39) = 0.6293203910
With this method, it is impossible for the iteration to produce the seed value because the number of digits is different. It is possible, even likely, that this set of equations will get stuck in a loop after enough iterations. A computer program would be useful for checking that. Thus, to send an encrypted
message using this system, all the two communicants need are a shared code group dictionary, seed value, set of equations, and their phone calculators.
It would take some work to identify which combinations of equations and seed values produce the most random numbers before getting stuck in a loop. Here again computers would be useful. Finding the right combination of equations and seed values would be akin to the search for large prime numbers.
Even if the nature of the encryption algorithm was public knowledge, this method would still require a brute force attack to break. An attacker would need to try different equations and different seed values. The number of possibilities for both are very large. For example, both the functions above could be multiplied by some constant or have some value added. That would introduce even more unknowns.
I used to believe any code produced by a machine could be broken by a machine. Some algorithms really have the secret sauce. In short, one-way functions exist.
Thursday, April 30, 2026
Obi Wan tells Luke the truth
"Luke, Darth Vader is your father."
"What?! Isn't Vader the second in command of the Empire?"
"Yes, but before that he was a Jedi like me. Here's his light saber. I ganked it from him after he tried to kill me. He also killed a bunch of sand people and their children with it. To be honest, he was kind of a dick."
"Holy shit! I don't want it."
"Too bad, take it. I'm tired of lugging it around. Speaking of sand people, they probably know you're his son, so it's best to stay the hell away from them."
"How do you know all this?"
"Your father, Anakin Skywalker, AKA Darth Vader, was my apprentice. Things were going OK until this douchebag Palpatine talked him into joining the bad guys. Palpatine is now the emperor."
"So what am I supposed to do about all that?"
"I want you to fight them both. Hopefully you can kill Palpatine and redeem your father with a beatdown. It's not a great plan, I admit, but I'll help you, and it will get you off this rock you hate anyway."
"Well, I guess I'm in. What's next?"
"We hire a ship a head for a rebel base. Once we explain things, they'll make you a space fighter pilot, and you can get some combat experience. I'll also teach you about Jedi stuff like the Force. Sound good?"
"What's the Force?"
"Eh, the short answer is you can use it to move stuff with your mind, jump farther, and hypnotize dumb people."
"Sweet! Maybe I can use a Jedi mind trick to get away from my uncle."
"That's a damn find idea. Next time you see him, just wave your hand slowly in front of his face and say, 'you don't need me on this farm anymore'. When you're done doing that and whatever else you want to do here, hit me up so we can get a move on."
"What about the droids?"
"OK, so you figured out already that lady in the hologram was talking about me. Good job. Her name is Princess Leia and she's your sister. Pretty crazy, eh? Anyway, once we get to a rebel base, we can show them the hologram, we'll be in with the big shots."
"Is Jedi training hard?"
"Not really. Most of it is irrelevant or unnecessary. In hindsight, the Jedi were not the sharpest tools in the shed. That's how your dad was able to wipe out all of them except for me and this guy named Yoda."
"Yoda?"
"He's this weird little old dude who ran off to Dagobah when everything went to hell in a handbasket. We haven't kept in touch. Honestly, I think the guy is kind of useless. He might have some pointers for you though."
"How do we get to a rebel base?"
"We hire a ship from one of the local smugglers. I found this guy named Han Solo. He seems solid, and his pal Chewbacca is big enough to beat up anybody. At this point, we might as well leave right now. Imperial stormtroopers will be looking for the droids, and anyone they find along the way is in deep shit. Like I said, we should both just peace out now. I have a bad feeling already about your aunt and uncle. Sorry."
"OK. I'm ready. Lead the way, Ben."
Wednesday, April 29, 2026
how to get away with murder
THIS IS FOR ENTERTAINMENT PURPOSES ONLY.
If you want to kill someone, chances are it is someone you already know well. In that case, you will be the number one suspect unless you can make the murder look like an accident or a random killing. Thus, if you want to murder someone, it's best to do it in a big city that has a high homicide rate, so your crime doesn't stand out as much.
Let's assume your target is in a big city or you somehow lure them there. There are still the questions of how, when, and where to do it. Mob hitman Richard Kuklinski liked to dissolve sodium cyanide in a drink, pretend to be drunk and spill it on his target. The poison would be absorbed through the victim's skin. It's a cheap, simple, and ingenious method. The best part is it attracts very little attention. Drunk people in crowded bars spill things all the time. Another advantage is that since the poison takes several hours to kill, there is no need to dispose of a body.
Guns, knives, clubs etc. should be avoided because they cause injuries that point to foul play. That leads to an autopsy and a criminal investigation if the body is found which it likely will be. Accomplices should be avoided as well since they can make mistakes as well as betray you to the police. Do not try to hire a hitman unless you are already deeply involved in organized crime. Many law enforcement organizations have phony assassins-for-hire businesses to entrap the gullible. Human remains are usually found unless they are disposed of very carefully, as in the case of Jimmy Hoffa.
If your target is out in the boonies, it's to wait for them to be about to leave for a long vacation. Since they will be expected to be gone, no one will notice they are missing for a week or two, and this allows you to get far enough away after the deed is done to have a reasonable alibi. You could also wait for a snowstorm or hurricane since most people will be too distracted at the time to notice a sudden death. In this case, sodium cyanide dissolved in water and loaded in a squirt gun would be my weapon of choice. It would be easy enough to play it off as a joke and thus avoid suspicion. The lethal dosage of sodium cyanide is about 6.4 mg per kg of body weight, so you would need to soak the target's skin with maybe half a pint worth of liquid for it to be lethal.
Given the difficulties and possible consequences of homicide, consider getting revenge in alternative ways. Can you get someone fired from their job or ruin the relationships with friends and family? If so, that will likely be easier and more satisfying than killing them. The Stasi, the secret police of East Germany, rarely killed people. Instead, it tried to drive them to madness or suicide via a process of long-term harassment called Zersetzung.
Remember also that living well is the best revenge.
Monday, April 27, 2026
ecology and medical research
Nature gives clues about where to find medicines. For example, one would expect the rainforest to have both natural pesticides as well as defenses against those pesticides. The many species of cordyceps fungi are natural laboratories for pesticides, as well as other useful chemicals.
When we look at what a tree uses to defend itself from insects, bacteria, or fungi, that points the way to chemicals that could defend people and domesticated plants and animals.
Insects and rodents are useful for research because they can be bred cheaply and quickly in captivity, but still more useful would be to understand the mechanisms by which they resist the pathogens found in their natural environments.
To put it another way, many infectious diseases only affect humans, because those germs and parasites are adapted to circumvent our immune systems. I have never heard of a case of tuberculosis among pigs or HIV/AIDS in chickens. Large wild animals appear healthier still. Whales that survive to adulthood rarely die of infections. Elephants don't get polio.
Defeating a disease means augmenting the human immune system, as was done with vaccines and antibiotics. The way to forward is to carefully study the immune systems of many kinds of living things.
Bats and other flying animals have high metabolisms. This gives them an edge against viruses but often leaves them vulnerable to fungi. Why is that? What might a study of a hummingbird's immune system reveal about cancer?
These questions perplex me, and I do what I can to answer them with what I can find online.
new medicines from bacteria and fungi that infect insects?
Colistin is an antibiotic derived from the bacteria that causes American foulbrood disease in honeybees. I wonder what other medicines could be derived from the bacteria and fungi found on and in insects.
It's well known that flies, cockroaches, ants, and mosquitoes spread disease. What might they contain that could cure disease? Many insects defend themselves with antimicrobial peptides. To the best of my knowledge, none of these have been isolated and synthesized for use as medicine.
Beauveria bassiana is an interesting candidate. It is a fungus that infects many arthropods throughout the world. There has been some research in using it for mosquito control.
Nature is a wonderful laboratory. It takes a keen eye to reveal its secrets.
medicines from plants found in dry climates?
Vinca alkaloids are a well-known family of medicinal compounds from vinca plants, which grow in dry climates. Cactus too has been found to have medical uses. I suspect dry climates force plants to develop defenses for their water supply. These defenses include the spines of the cactus, but also the chemicals they produce in their roots and shoots to keep animals, bacteria, fungi, and other plants away.
I wonder about what medicinal compounds might be found in bristlecone pines, acacia, and baobab trees.
All three are found in dry climates. Olive trees are also found in dry climates. The health benefits of olive oil were known in ancient times, but what about the trees themselves?
It seems that olive tree leaves are underused as a medicine.
Thursday, April 23, 2026
Monday, April 20, 2026
what would be the effect of adding fluorine to doxycycline?
Some antibiotics have fluorine. Doxycycline is non-beta lactam and does not have fluorine.
risperidone and paliperidone comparison
They are both used to treat schizophrenia. The only difference is the alcohol group on paliperidone. I wonder what effect a methyl group in the same place would have.
what would be the effects of fludrotestosterone or fludroestrogen?
Fludrocortisone and dexamethasone are corticosteroids already in use.
Friday, April 17, 2026
Thursday, April 16, 2026
carbamazepine and tricyclic antidepressants
Is there a relationship? Carbamazepine is used to treat epilepsy.
Wednesday, April 15, 2026
aciclovir, ganciclovir, valganciclovir, and valaciclovir comparison
All are antivirals. What would be the effect of replacing an alcohol group with a fluorine or a chlorine atom?
chlorambucil - a melphalan cousin
It is a chemotherapy drug and has structural similarities with several others.
Tuesday, April 14, 2026
cephalosporins, beta lactams, and fluorouracil
Below are the general structural formulas for cephalosporin and beta lactam antibiotics. What would be the effect of substituting the sulfur ring with fluorouracil?
Monday, April 13, 2026
norepinephrine, methyldopa, dopamine, and epinephrine comparison
Norepinephrine increases blood pressure and methyldopa reduces it. But why? Could new blood pressure medicines be made by substituting a carboxylic acid group for an amino group?
zidovudine - another fluorouracil cousin
It is used to prevent and treat HIV/AIDS. I wonder about the effect of adding a fluorine to it.
Sunday, April 12, 2026
coping with mortality
Religion, with its various teachings about an afterlife, is the traditional way people have coped with knowledge that they will die. The other popular method is parenthood. In this way, people know part of them will live on in their offspring. However, there have always been those for whom religion and children have not been enough to soothe death anxiety. They try to make an immortal legacy through conquests, monuments, inventions, discoveries, great works of art, or other achievements. The growth of scientific knowledge has eroded religious belief, and so denial has become the most popular method of dealing with death anxiety, at least in the industrialized world (the panic over COVID-19 made that clear).
In my view, all these methods are wrong. The first step is to acknowledge that not only do we die, but we will almost certainly be forgotten not long after. There are only a few hundred people still remembered millennia after their deaths. Even if we have children, whatever was unique about our DNA will be diluted to insignificance after a few generations. There are people who try to attach their identity to a nation or even the human race as a whole, but even that is flawed. Nations come and go. Few last more than a few centuries. If humanity follows the same path as 99% of other species, it will go extinct within a few million years.
I find solace in looking at the natural world. Through evolution, every living thing is related to me in some way, and this has been proven through DNA analysis. Life on earth has survived for billions of years through many cataclysms, and it will almost certainly continue into the far future regardless of what humans do. Everyone could benefit from looking at the big picture as shown in natural history museums. Enjoy the moment. Don't cry because it's over, smile because it happened. Life finds a way.
Friday, April 10, 2026
on jumping through hoops
Bertrand Russell said that after survival needs are met, people desire only four things: stuff, attention, status, and power. Stuff is money and what it can buy. The need for attention is what drives the behavior of actors, rock stars, etc. Status is what you get by proving you are better than someone else. Power is the ability to make people do things they don't want to do.
Everyone is in a social hierarchy. Your position in it is based on your status. Generally, you gain status by jumping through hoops, that is, completing tasks, often ones that are needlessly difficult. For example, the members of the military with the highest status (generals, fighter pilots, Navy SEALs, etc.) are the ones who completed the longest and most difficult courses. Because the tasks are hard, few complete them, and as such the ones who do have higher status because there are fewer of them.
In a similar way, doctors and lawyers have more status than cooks or drivers because the former must go through much more training and there far fewer of them.
So why do people desire status? I think it is mainly because it is a good way to fulfill the other three desires. Billionaires and celebrities have an easy time getting stuff, attention, and power. Prisoners and homeless people do not. An old saying goes that money and power always find each other. Another one guys that men lose money if they chase women, but they never lose women if they chase money.
It all boils down to knowledge. Seek that instead of jumping through hoops.
Thursday, April 9, 2026
4-aminosalicylic acid, isoniazid, and ethionamide comparison
All are used to treat tuberculosis. All have a keto (thioketone in one case) group, an amino group, and a 6-sided ring. I suspect there are other potential tuberculosis drugs that have the same functional groups.
chronology of common anesthetics
Once the first two were discovered and analyzed, there was a gradual push to combine them and make different asymmetrical halogenated ethers. The last one is a somewhat asymmetrical ester salt. I suspect another anesthetic could be made by chlorinating and/or fluorinating diethyl ether.
19th century
20th century
Subscribe to:
Posts (Atom)
