vttoth

I am a software developer and author of computer books. I also work on some problems in theoretical physics. For more information, please visit my personal Web site at http://www.vttoth.com/.

Dec 242022
 

This year my simple Christmas wish seems more urgent than before. War is raging in a part of Europe that should have seen the last of its share of trenches and artillery bombardments in 1945; instead, it’s a modern war zone, with innocents killed, infrastructure wantonly destroyed, people displaced, and cruelty reigning, just to satisfy the messianic complex of a deranged tyrant.

And the risk of escalation remains very real: 2023 may not be a good year for many of us.

As always, I cannot think of more appropriate words on December 24 than those uttered by Frank Borman, commander of Apollo 8, the first manned mission to orbit the Moon (and the first vehicle in the history of humanity that carried humans to a spot cut off from all other humans who ever lived, as they disappeared behind the far side of the Moon):

[G]ood night, good luck, a Merry Christmas – and God bless all of you, all of you on the good Earth.

 Posted by at 1:26 am
Dec 162022
 

Remembering how ChatGPT failed to solve the riddle involving squirrels, a little later I asked him the following:

Bob was twice as old as his sister Alice when he was six. Today, Bob is 30 years old. How old is Alice?

When Bob was six years old, his sister Alice was half his age, so she was 6 / 2 = <<6/2=3>>3 years old.
Since then, Bob has aged by 30 – 6 = <<30-6=24>>24 years, while Alice has aged by 24 / 2 = <<24/2=12>>12 years.
Therefore, Alice’s current age is 3 + 12 = <<3+12=15>>15 years old. Answer: \boxed{15}.

Intriguing. For starters, note the weird typography: ChatGPT was trying to use math, enclosing some equations in double angle brackets (using less-than and greater-than signs as substitutes) but used LaTeX notation for its final result. Which, of course, is wrong: ChatGPT fell for the same trap that tricks some humans.

But why, I wondered? Could I present a simpler form of this riddle that ChatGPT could solve correctly? Why, let us try:

Bob was three years older than his sister Alice when he was six. Today, Bob is 30 years old. How old is Alice?

When Bob was six years old, his sister Alice was 6 – 3 = <<6-3=3>>3 years old.
Since then, Bob has aged by 30 – 6 = <<30-6=24>>24 years, while Alice has aged by 24 – 3 = <<24-3=21>>21 years.
Therefore, Alice’s current age is 3 + 21 = <<3+21=24>>24 years old. Answer: \boxed{24}.

Once again an incorrect answer but I think I can spot the pattern. Whatever the mathematical operation is, ChatGPT applies it to both the quantities in question and their difference (or ratio).

I think this is a very clear example of how a trained AI automaton that has no independent ability to reason can go astray. Incidentally, this is exactly how humans who learn by rote but without full comprehension often fail.

Before we read too much into these failures, however (which, I presume, are easily corrected with more guided training) let us notice the fact that in both cases, ChatGPT correctly understood the question and applied the concept of time in its answers. Which is quite remarkable on its own right, mistakes notwithstanding.

 Posted by at 5:55 pm
Dec 122022
 

The National Ignition Facility has achieved a net power gain in its experimental fusion reactor. This is heralded as a major breakthrough.

Does this mean that in 50 years, we will have practical nuclear fusion power our world?

Oh wait. We were told exactly that some 50 years ago:

At the beginning of the 1950s, it seemed that success is not far away. But later, difficulties arose one after another […]

Unfortunately today there are still gigantic difficulties in the path towards utilizing this fabulously rich supply of energy […]

In fourteen countries of the world, more than two thousand engineers and scientists are laboring on working out different types of fusion devices.

To date, more than a hundred different models have been devised […]

Let us introduce only one group of these: the Soviet Tokamak devices, because around the world, these are the ones in which researchers have the most faith, viewing them as prototypes of future fusion power plants.

A year and a half ago, in an experiment carried out in collaboration between Soviet and English physicists, they directly measured the temperature and density of the plasma of Tokamak-3, and it became clear that the results were even better than indicated by prior measurements. To date, no other device could produce plasma of such quality.

When will the first fusion power plants be realized, when will the investigation of controlled nuclear fusion exit the constraints of laboratory experiments? According to Professor Igor Golovin, the world-renowned expert on thermonuclear research, it will be possible to develop Tokamak devices into electricity-producing equipment by the last decade of our century. L. Hirsch, one of the leading physicists of the American Atomic Energy Commission is a little more cautious. According to him the path from the first experiments to the worldwide spread of fusion power plants is longer, and we’re lucky if they will enter the world’s energy production market in fifty years.

These are all quotes (my translations) from a 1972 Hungarian-language educational children’s publication, “Boys’ Almanac 1973”.

As I express my (probably uninformed) skepticism concerning practical fusion power generation, I note that in the deep interior of the Sun, under gravitational confinement due to the combined mass of more than 300,000 Earths, fusion progresses at the leisurely rate of a few hundred watts per cubic meter. (The power output of a well-maintained industrial compost pile.) For practical power generation, we need something that is at least a million times that, a few hundred megawatts per cubic meter… and we don’t have 300,000 Earths for gravitational confinement.

Of course I’d be delighted if they proved me wrong.

 Posted by at 1:09 pm
Dec 122022
 

I mentioned recently on Quora that I still have a Windows 98 machine. Someone asked for a picture.

Not terribly exciting, I know. Just your standard tower case with some obsolete hardware. The “security device enclosed” sticker is a joke; it’s from a DVD package.

The only remarkable thing about this box is that its motherboard was one of the earliest motherboards to support RAID out of the box. So yes, it is a Windows 98 machine with two hard drives and a RAID mirror. How about that?

In case anyone is wondering, I use it (very rarely) mostly to connect to old hardware. These include an HP-IL interface card to connect old calculators; an old EPROM burner with a serial interface and Windows 95/98/ME software; and last but not least, an old Sharp Winprinter, which only works under Windows 98. I use this printer for heavy stock (e.g., business card stock) to avoid stressing or damaging my more expensive laser printers.

Oh, and once every other leap year I turn this machine on just to return to alien-infested LA in the role of the potty-mouthed hero Duke Nukem…

 Posted by at 12:50 pm
Dec 122022
 

Yes, I am rooting for Ukraine. I am not terribly fond of nationalism. I would love to live long enough to see a free and prosperous world in which national borders are a thing of the past, a quaint historical curiosity, nothing more. But that’s not the world we live in, and when a country attacks another in a form of naked territorial aggression, I root wholeheartedly for the defender.

In light of this, I was delighted to see that the supply of a particular brand of our favorite Hungarian Christmas candy (szaloncukor), which has been made in Ukraine for the past several years, remains uninterrupted.

Thank you, nameless workers in that Ukrainian factory that manufactured these delicacies.

 Posted by at 12:43 pm
Dec 092022
 

I really should stop messing with ChatGPT but…

I asked it some more physics questions and got moderately mediocre answers. For instance, when I asked it about the conformal group in four spacetime dimensions, it described it as consisting of the Lorentz-Poincare group plus dilations. Many physicists would say the same thing but this is an incomplete description, leaving out the most interesting bit, the so-called special conformal group. But when I asked it to describe the special conformal group it offered a decent answer; it did mention inversion, what it failed to mention was that it really is an inversion with respect to the unit circle, a translation, and a second inversion and as such, it introduces four additional degrees of freedom.

But then, I went back to asking programming questions. I thought by now that I had a good sense of the algorithm’s limitations. So I dug up an old utility I once wrote and asked ChatGPT about the code.

Can you tell me what the following C-language program does under Linux?

#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>

void main(void)
{
  int i, j, k, l;

  for (i = 0; i <= 32767; i++)
  {
    if (kill(i, 0) == 0 || errno == EPERM)
    {
      char s[120], f[20], c[100];
      FILE *p;

      sprintf(s, "%6d ", i);
      sprintf(f, "/proc/%d/status", i);
      if (p = fopen(f, "r"))
      {
        l = fread(c, 1, sizeof(c), p);
        fclose(p);
        for (j = 0; j < l && c[j] != '\t'; j++);
        for (k = 7, j++; j < l && c[j] != '\n'; j++) s[k++] = c[j];
        s[k] = '\0';
      }
      printf("%s\n", s);
    }
  }
}

This C-language program is a simple utility that lists the active processes on a Linux system. When run, the program will iterate through all possible process IDs from 0 to 32767, and check if a process with that ID exists on the system. If a process with the given ID exists, the program will print information about that process, including its process ID, process name, and other details.

To do this, the program uses the kill function from the signal.h library to check if a process with a given ID exists. The kill function is typically used to send signals to processes, but it can also be used to check if a process with a given ID exists by calling it with a signal value of 0.

If the kill function returns 0 or sets the errno value to EPERM, this indicates that a process with the given ID exists on the system. In this case, the program will use the sprintf function to create a string containing the process ID, and then open the /proc/[pid]/status file, where [pid] is the process ID, using the fopen function.

The status file contains information about the process, including its name and other details. The program will read the contents of this file using the fread function and extract the process name from the file using string manipulation. The extracted process name will be appended to the string containing the process ID, and the resulting string will be printed to the console using the printf function.

Overall, this program is a simple example of how to list the active processes on a Linux system using the kill and /proc functions. It is worth noting that this program is not intended for use in a production environment, as it is not robust or efficient. It is intended only as a simple demonstration of the concept.

OK, this isn’t even funny anymore. But surely, a program that actually prints two-dimensional ASCII graphics using an obscure algorithm will leave the AI baffled?

What does the following program do?

#include <stdio.h>
#include <string.h>

#define R 20

void main(void)
{
  int x, y, d, dA, dB;
  int i;

  char B[2*R+1][2*R+2];

  memset(B, ' ', sizeof(B));
  for (i = 0; i < 2*R+1; i++) B[i][2*R+1] = 0;

  x = 0;
  y = R;
  d = 5 - (R<<2);
  dA = 12;
  dB = 20 - (R<<3);
  while (x<=y)
  {
    B[R+x][R+y] = B[R+x][R-y] = B[R-x][R+y] = B[R-x][R-y] =
    B[R+y][R+x] = B[R+y][R-x] = B[R-y][R+x] = B[R-y][R-x] = 'X';
    if (d<0)
    {
      d += dA;
      dB += 8;
    }
    else
    {
      y--;
      d += dB;
      dB += 16;
    }
    x++;
    dA += 8;
  }
  for (i = 0; i < 2*R+1; i++) printf("%s\n", B[i]);
}

This program is a simple implementation of the midpoint circle algorithm, which is used to draw a circle on a two-dimensional grid. When run, the program will print a circle with a radius of 20 units, using the character ‘X’ to mark the points on the circle.

To do this, the program first defines a 2-dimensional array named B with dimensions 2*R+1 by 2*R+2, where R is the radius of the circle. The array is initialized with spaces using the memset function, and the last column of the array is set to 0 using a for loop.

Next, the program sets the initial values for the variables used in the midpoint circle algorithm. These include the current x and y coordinates of the point being considered, as well as various intermediate values used to compute the next point on the circle.

The program then enters a while loop that continues until the value of x is greater than or equal to the value of y. Inside the while loop, the program uses the midpoint circle algorithm to compute the next point on the circle, given the current point. This involves checking if the value of d is less than 0, and computing new values for d, x, and y based on the result.

Once the new values have been computed, the program sets the corresponding element in the B array to 'X', to mark the point on the circle. The program then increments the value of x and updates the values of the other intermediate variables used in the algorithm.

After the while loop ends, the program uses a for loop to print each row of the B array to the console, resulting in a grid containing a circle with a radius of 20 units, drawn using the character 'X'.

No, it’s not OpenGPT that is baffled. I am baffled. Beyond speechless.

 Posted by at 6:19 pm
Dec 092022
 

Despite my misgivings concerning the many “teacher’s pet” style answers offered by ChatGPT, I could not resist messing with it some more.

First, since everybody does it, I also asked it to describe something nontrivial in the style of the King James Bible:

Can you describe the trolley problem written in the style of the King James Bible?

Sure, I can try to describe the trolley problem in the style of the King James Bible. Here is my attempt:

Verily, there was a great dilemma that faced a righteous man. A trolley was careening down a track, and on its path were five workers, toiling on the line. The man had the power to divert the trolley onto a different track, but lo, on this track was but a single worker, also toiling on the line.

The man was torn between two choices: to do nothing and allow the trolley to continue its course, resulting in the death of five workers, or to take action and divert the trolley onto the other track, resulting in the death of a single worker.

What, then, should the man do? Should he sacrifice the life of the one to save the lives of the many, or should he let the trolley continue on its path and allow the deaths of the five?

This was a most difficult decision, and the man knew not what to do. But in the end, he made a choice, and the consequences of his actions weighed heavily upon him.

But then, I thought I’d offer it a real challenge. Can it recognize a perfectly functional, decently written but somewhat obtuse piece of C code for what it does? Note the paragraph in the answer that I highlighted in red.

Can you tell me what the following C-language code fragment does?

#include <string.h>

double Z(double z)
{
  if (z < 0 || z > 170 || z != floor(z)) return strtod("NaN", NULL);
  if (z == 0) return 1;
  else return z * Z(z - 1);
}

This code defines a recursive function named Z that takes a single double argument named z. The function first checks if the value of z is less than 0, greater than 170, or not an integer. If any of these conditions are true, the function returns the result of calling the strtod function with the string "NaN" and a NULL value as arguments. This would convert the string "NaN" to a double value representing “Not a Number”.

If the value of z is not less than 0, greater than 170, or not an integer, the function then checks if z is equal to 0. If this is the case, the function returns the value 1.

If z is not 0, the function returns the result of z multiplied by the result of calling the Z function with z - 1 as the argument. This means that the Z function calls itself with a z value that is 1 less than the current z value. This is an example of recursion, where a function calls itself with a modified input until a base case is reached. In this case, the base case is when z is equal to 0. When this happens, the function returns 1 and the recursive calls “unwind”, returning the final result of the Z function.

It is worth noting that this Z function is an implementation of the factorial function, which calculates the product of all positive integers less than or equal to a given integer n. For example, the factorial of 5, written as 5!, is equal to 5 * 4 * 3 * 2 * 1 = 120. This Z function would return the same result if it were called with an argument of 5.

Holy mackerel. Seriously.

 Posted by at 2:30 pm
Dec 092022
 

Inspired by examples I saw elsewhere, I figured I’d test ChatGPT some more. This time around, I asked it to spot a programming error, and while its answer was flawed, it was not altogether wrong.

Here is our brief conversation (ChatGPT also adds some nice colorized code formatting that I shall not attempt to reproduce here):

Can you spot the bug in the following C-language code fragment?

char *str = "SOME TEXT";
char *buf = malloc(strlen(str));
strcpy(buf, str);

The code is missing a null terminator character '\0' at the end of the string assigned to buf. The strcpy function does not automatically add a null terminator character when copying the string from str to buf, so buf will not be a properly-formatted string.

To fix the code, you can add a null terminator character to the end of buf after it has been copied from str, like this:

char *str = "SOME TEXT";
char *buf = malloc(strlen(str) + 1); // Add one to include space for the null terminator character
strcpy(buf, str);
buf[strlen(str)] = '\0'; // Add the null terminator character at the end of the string

Alternatively, you can use the strdup function to copy str into buf, which automatically adds a null terminator character to the end of the copied string, like this:

char *str = "SOME TEXT";
char *buf = strdup(str);

Note that the strdup function is not a standard C library function and may not be available on all platforms.

Pretty darn close! The AI correctly noticed that there is a problem with the terminating null character. But it’s not what it says: it’s not that strcpy won’t copy the string terminator. Quite the contrary, the problem is that strcpy does copy that terminating null, but we have not allocated memory for it: strlen returns the length of the string without that terminator.

Interestingly, the AI seems to be aware of this as in the corrected version, it adds room for that extra byte. The corrected code is error-free but redundant: the last line is not required, because strcpy would have already copied the terminating null. This line would be required, on the other hand, if we had used strncpy.

The suggestion to use strdup is a good one, except that contrary to the caveat, strdup is now part of the upcoming ISO C standard.

Still, it is doing better already than many a C programmer I knew. So how about offering it a really tricky related problem?

The following C-language code fragment works:

char *str = "SOME TEXT";
char *buf = malloc(strlen(str));
strcpy(buf, str);

but if I replace the first line with

char *str = "A DIFFERENT TEXT";

the program crashes. Can you explain why?

When you replace the first line of the code with char *str = "A DIFFERENT TEXT";, the length of the string assigned to str increases, but the size of the memory allocated for buf remains the same. This causes a buffer overflow, which can lead to a crash or other undefined behavior.

To fix this issue, you can use the strlen function to calculate the length of the string assigned to str and allocate enough memory for buf to hold the entire string, like this:

char *str = "A DIFFERENT TEXT";
char *buf = malloc(strlen(str) + 1); // Add one to include space for the null terminator character
strcpy(buf, str);

Alternatively, you can use the strdup function to copy str into buf, which automatically allocates enough memory for the entire string, including the null terminator character, like this:

char *str = "A DIFFERENT TEXT";
char *buf = strdup(str);

Note that the strdup function is not a standard C library function and may not be available on all platforms.

Really close! But no, it’s not that the size of the memory allocated for the buffer remains the same. It’s that in both cases, the size of the memory allocated for the buffer failed to include room for the terminating null character. However, in the first case the string was 9 bytes long, or 10 with the terminating null. On most modern platforms, memory is allocated in units of 32-bit words or larger, so at the very least, there’d he 12 bytes allocated, leaving enough room for the terminator. But in the second case, the text is exactly 16 bytes long. Chances are that the call to malloc will allocate exactly 16 bytes, and therefore, copying the terminating null will cause a buffer overflow, overwriting something else that it shouldn’t.

Still, even though its reasoning is flawed, the AI’s proposed fix is spot on: include room for the null terminator!

I am not unimpressed. Yet all these examples tend to remind me of the behavior of the “teacher’s pet” A-student who memorizes a lot, can even apply simple reasoning, but lacks in-depth understanding.

 Posted by at 12:29 pm
Dec 072022
 

I was playing a little more with GPT. There is a classic riddle that I read many years ago in, I think, an Asimov short story, in which (if I remember correctly) a child tests the AI by asking:

If a squirrel and a half eats a nut and a half in a day and a half, how many nuts do nine squirrels eat in nine days?

Asimov’s AI was smart enough to give the correct answer. GPT is not, though it makes a surprisingly human error in its reasoning:

If a squirrel and a half eats a nut and a half in a day and a half, that means that each squirrel eats one nut per day. Therefore, if there are nine squirrels, they would eat a total of nine nuts in nine days. This is because the number of squirrels and the number of days cancel out in the calculation, leaving only the number of nuts that each squirrel eats. So, the answer to the question is nine.

In case anyone is wondering, the correct answer is 54.

The illustration was generated by the same AI, with the request “Squirrels eating nuts.” Out of four images that I received in response, this one was the most realistic; in at least one of the other images the squirrels looked suspiciously like skunks.

 Posted by at 6:48 pm
Dec 072022
 

I spent a bit of time playing with the GPT chatbot at chat.openai.org.

It is frighteningly good. Yet its responses, especially its failures, reveal that ultimately, it’s just a glorified version of ELIZA. Ultimately, a ‘bot trained not to reason, not to tell the truth but simply to satisfy its audience.

My first question to the AI was political:

Explain the reasons behind the collapse of the USSR.

The collapse of the USSR was the result of a variety of factors, including political, economic, and social issues. One of the key reasons was the failure of the Soviet economic system, which was unable to compete with the economies of other developed countries. This led to widespread economic stagnation and a decline in living standards, which created discontent among the population. Additionally, the Soviet government was plagued by corruption and inefficiency, which further eroded public trust in the government. Another factor was the growing desire among the Soviet republics for greater autonomy and independence, which ultimately led to the breakup of the Soviet Union into its constituent republics.

Not a bad response, though it feels a little bit like a stock response. Reminds me of some A-students I knew, who always knew how to please the teacher, who were good at memorizing facts but often showed lack of true understanding.

Then, after a brief and unsuccessful detour asking the AI about works of literature, I switched to physics:

What is the nature of the mathematical transformation that relates the Jordan and the Einstein frames in general relativity?

In general relativity, the Jordan frame and the Einstein frame are two different ways of representing the same physical phenomena. The relationship between the two frames is described by a mathematical transformation known as a conformal transformation. This transformation rescales the metric tensor, which encodes the gravitational field, in order to switch between the two frames. In general, the Jordan and Einstein frames are equivalent, but there are certain situations in which the choice of frame can affect the physical predictions of the theory. For example, in some cases the Jordan frame may be more convenient for performing calculations, while in other cases the Einstein frame may be more useful.

Wow. A surprisingly good answer! Almost makes me want to believe that this AI knows something. I asked a few more physics questions that elicited decent but less inspired answers. Then I switched to medicine:

What was the main obstacle in the path towards the development of mRNA vaccines?

One of the main challenges in the development of mRNA vaccines was the difficulty of delivering the mRNA to the target cells in the body. mRNA is a fragile molecule that is easily degraded by enzymes in the body, making it difficult to transport it to the right location and ensure that it is effective. Additionally, the human immune system is designed to attack and destroy foreign molecules that enter the body, including mRNA. This meant that researchers had to develop effective strategies for delivering the mRNA to the right cells and protecting it from being destroyed by the immune system. Despite these challenges, researchers were able to overcome them and develop effective mRNA vaccines.

As far as I know (I am no expert), this is an accurate answer.

OK, I switched to mathematics and received some technically correct but repetitive, uninspired answers about the Riemann hypothesis. OK, how about some more physics?

What is the action principle?

The action principle is a fundamental concept in classical mechanics that is used to derive the equations of motion for a physical system. It states that the path taken by a system between two points in time is the one that maximizes the action, which is defined as the difference between the kinetic and potential energies of the system. This principle is often used in conjunction with the principle of least action, which states that the actual path taken by the system is the path that minimizes the action. The action principle can be used to derive the equations of motion for a wide variety of physical systems, including systems governed by Newton’s laws of motion.

This one is seriously wrong. There is no separate “action principle” and “principle of least action”. The two are the same. And the action is always minimized. It is possible to re-ask the same question and on the third try, I got an answer that was a bit more sensible:

What is the action principle?

The action principle is a fundamental concept in physics that is used to determine the equations of motion of a physical system. It states that the path taken by a system between two points in time is the one that minimizes the action, which is a functional that measures the difference between the kinetic and potential energies of the system. This principle is used in many areas of physics, including classical mechanics, quantum mechanics, and general relativity. It is a powerful tool for understanding the behavior of physical systems, and it has led to many important discoveries in physics.

Uninspired, but no longer technically false.

I then asked a few more questions about random topics, eliciting fairly decent responses:

What are the major modified theories of gravitation?

There are many different modified theories of gravitation that have been proposed in an effort to improve upon or extend the standard theory of gravitation, which is known as general relativity. Some of the most well-known modified theories of gravitation include scalar-tensor theories, which introduce additional scalar fields to describe the gravitational force; f(R) theories, which modify the curvature-based formulation of general relativity; and massive gravity theories, which introduce a nonzero mass for the graviton, the hypothetical particle that mediates the gravitational force. These theories are all based on general relativity, but they attempt to address some of its limitations or make predictions that are different from those of general relativity.

Why do we sleep?

We sleep in order to allow our bodies and minds to rest and recover from the activities of the day. During sleep, our bodies are able to repair and rejuvenate themselves, and our brains are able to consolidate and process the information we have learned and experienced. Sleep is also important for maintaining a healthy immune system and regulating our mood, appetite, and other functions. Additionally, sleep is thought to play a role in learning and memory, as it is during sleep that our brains are able to process and consolidate new information. Overall, sleep is essential for our physical and mental well-being, and it is an important part of our daily routine.

What does Chewbacca eat?

Chewbacca is a fictional character from the Star Wars universe, and as such, there is no definitive answer to this question. In the Star Wars movies and other works of fiction, Chewbacca is shown eating various types of food, including what appears to be roasted meat and other protein-rich foods. However, since Chewbacca is a Wookiee, a fictional alien species, it is not clear what types of food he would eat in real life. It is also worth noting that since Chewbacca is a fictional character, any information about his diet or habits should be considered purely speculative.

So this thing can tell the difference between fiction and reality. That made me wonder what it knows about itself:

What is your opinion of the classic computer program ELIZA?

As a large language model trained by OpenAI, I do not have personal opinions or feelings, and I am not capable of experiencing emotions. My primary function is to provide general information and answer questions to the best of my ability based on my training. ELIZA is a classic computer program that was developed in the 1960s as a demonstration of natural language processing. It is a simple program that uses a set of rules and patterns to simulate conversation with a human user, and it was one of the first examples of what is now known as a chatbot. Many people found ELIZA to be intriguing and engaging, and it has been studied and discussed by computer scientists and other researchers. However, because it is a very simple program, it is not capable of having deep or complex conversations, and it is not as sophisticated as modern chatbots or language models.

Do chatbots have a sense of self?

Chatbots, which are computer programs that are designed to simulate conversation with human users, do not have a sense of self in the same way that humans do. Chatbots are not conscious or self-aware, and they do not have the ability to experience emotions or have personal opinions. Instead, they are designed to follow a set of rules and patterns to generate responses to user input, and they do not have the ability to introspect or reflect on their own thoughts and actions. While some chatbots may be designed to appear as if they have a personality or a sense of self, they are ultimately just programs that follow a set of predetermined rules.

What does it mean to have a sense of self?

Having a sense of self means being aware of one’s own thoughts, feelings, and identity. It is a fundamental aspect of human consciousness, and it allows us to perceive ourselves as unique and separate from the world around us. A sense of self is closely related to other psychological concepts, such as self-esteem, self-awareness, and self-concept, and it is an important part of our mental and emotional well-being. It allows us to have a sense of agency and control over our own lives, and it is a key factor in our ability to form and maintain relationships with others. Overall, having a sense of self is an essential part of being human, and it is something that we develop and nurture throughout our lives.

Do cats have a sense of self?

It is not clear whether cats have a sense of self in the same way that humans do. While cats are intelligent and self-aware animals, they do not have the same level of consciousness and introspection as humans. Cats are able to perceive and respond to the world around them, and they are capable of forming emotional bonds with humans and other animals. However, it is not known whether they have a sense of self in the same way that humans do, or whether they are capable of introspection or self-reflection. Ultimately, the question of whether cats have a sense of self is a complex and unresolved issue, and more research is needed to fully understand the cognitive abilities of these fascinating animals.

I refrained from asking why a chatbot, who just declared that it has no personal opinions or feelings, finds cats fascinating. (I know the answer. It picked the word because it learned that the word is often used to describe cats. It has no awareness of its meaning and no recognition that by using this word, it appears to have expressed a personal opinion.)

OK, It knows about ELIZA. What does it know about programming?

What are the most common errors in C language programming and how best to avoid them?

There are many common errors that can occur when programming in C, and the best way to avoid them is to be careful and meticulous when writing and debugging code. Some of the most common errors in C programming include:

Syntax errors: These are errors in the structure of the code, such as missing or mismatched brackets, semicolons, or quotes. To avoid syntax errors, it is important to carefully check the code and make sure it follows the correct syntax.

Type errors: These are errors that occur when the data type of a variable or expression does not match the expected type. To avoid type errors, it is important to carefully check the data types of all variables and expressions, and to make sure they are correct.

Memory errors: These are errors that occur when the program tries to access memory that it is not allowed to access, or when it tries to use memory that has already been freed. To avoid memory errors, it is important to use the correct memory allocation and deallocation functions, and to carefully track the state of memory as the program runs.

Logic errors: These are errors that occur when the code produces the wrong results, even though it is syntactically correct. To avoid logic errors, it is important to carefully design and test the code, and to make sure it is doing what it is supposed to do.

Serious meh. The answer is not technically wrong but it misses the point: C has very unique traps for the unwary or the inexperienced, such as failing to allocate an extra byte for a terminating null character, failure to deallocate memory allocated “by hand”, reusing a pointer after the object to which it refers goes out of scope, etc. This answer really reminded me of the proverbial teacher’s pet who barfs back what he heard in class with no real understanding.

But then, I was in for a surprise. After asking it to show me an example C program (predictably, it showed the archetypal Hello, World! example) I asked the following question:

Can you show me a C program that implements a function computing the Gamma-function of a double precision argument?

Sure! Here is an example of a C program that implements a function for computing the Gamma-function of a double precision argument:

#include <math.h>
#include <stdio.h>

double gamma(double x) {
  return tgamma(x);
}

int main() {
  double x = 3.0;
  printf("Gamma(%f) = %f\n", x, gamma(x));
  return 0;
}

This program includes the math.h header file, which provides access to the tgamma function that computes the Gamma-function. The gamma function simply wraps the tgamma function, and can be called from other parts of the program. The main function shows an example of how the gamma function can be used, by computing the Gamma-function of the number 3.0 and printing the result to the screen. To compile and run this program, you would need to use a C compiler, such as the gcc compiler on Linux or the cl compiler on Windows.

Not only is this a flawlessly correct answer… I didn’t even know about tgamma! Apparently it was added to the standard math library just over 20 years ago, as part of the C99 standard… But I never knew.

Yet, before we get too enthusiastic, next came this answer:

Can you write a C program that calculate the complete elliptic integral of the first kind for a double precision argument?

Sure! Here is an example of a C program that calculates the complete elliptic integral of the first kind for a double precision argument:

#include <math.h>
#include <stdio.h>

double ellipk(double x) {
  return K(x);
}

int main() {
  double x = 0.5;
  printf("ellipk(%f) = %f\n", x, ellipk(x));
  return 0;
}

This program includes the math.h header file, which provides access to the K function that calculates the complete elliptic integral of the first kind. The ellipk function simply wraps the K function, and can be called from other parts of the program. The main function shows an example of how the ellipk function can be used, by computing the complete elliptic integral of the first kind for the number 0.5 and printing the result to the screen. To compile and run this program, you would need to use a C compiler, such as the gcc compiler on Linux or the cl compiler on Windows.

Nice try but no cigar. There is no K function in the standard math library. And even if such an implementation existed, it would likely have a name more descriptive than a single capital letter.

Well, it was an educational experience. This chatbot obviously has access to vast repositories of information so it can appear quite knowledgeable. But in the end, I must say, it’s just as dumb as ELIZA was 50-odd years ago… if it appears smarter, it’s only because it has a more extensive vocabulary.

Compare it to self-driving cars. For all their limitations, their AI has a degree of self-awareness and situational awareness, as it plans its actions, literally imagining itself on the road a few seconds into the future, extrapolating the movements of itself and of other vehicles, trying to get to its destination safely. It may not be able to offer an erudite response about the action principle, but it might already be more capable of taking you home safely late at night than that sleepy taxi driver at the end of a long shift.

 Posted by at 12:36 pm
Nov 272022
 

Someone just sent me a YouTube link to a video, made in May 2022, showing some of the nightlife in a Tehran shopping district.

What I found especially interesting is the youth of the crowd, but also how ordinary, how “Western” most of them appeared. Were it not for the Persian script and the (rather loosely worn, I noted) headscarves, it could be a scene from any Western metropolis.

And not a single Muslim terrorist in sight! Scandalous, really.

No, I have no illusions about the ayatollahs’ regime. But looking at these scenes makes me wonder: how much longer will a population this young, this full of energy, endure being ruled by senile septuagenarian religious ultraconservatives?

 Posted by at 1:46 am
Nov 152022
 

CNN reports a Russian attack (likely unintentional, but an attack nonetheless) on a Polish farm, killing two.

That’s an attack on the territory of a NATO state.

 Posted by at 2:56 pm
Nov 072022
 

Every so often, I am presented with questions about physics that go beyond physics: philosophical questions of an existential nature, such as the reasons why the universe has certain properties, or the meaning of existence in light of the far future.

I usually evade such questions by pointing out that they represent the domain of priests or philosophers, not physicists. I do not mean this disparagingly; rather, it is a recognition of the fact that physics is about how the universe works, not why, nor what it all means for us humans.

Yesterday, I came across a wonderful 1915 painting by Russian avant-garde painter Lyubov Popova, entitled Portrait of a Philosopher:

What can I say? This painting sums up how I feel perfectly.

 Posted by at 1:19 am
Nov 052022
 

Today is November 5, 2022. Here we are in Ottawa, supposedly the second coldest capital city in the world after Ulan Bator. It is 9:15 PM.

And it is 21 degrees (centigrade — 70 F, for my American friends.)

Our A/C ran several times today, especially while we were baking something.

This is beyond incredible. I’ve seen snowstorms in this town in October. I’ve never seen summer-like weather in November.

If this is global warming… well, if folks who will likely be swept away by the sea in places like Florida don’t care, who am I to complain?

Still… weather like this in November is a bit creepy.

[And yes, I still use Windows gadgets, with the help of third-party software. What can I say? I like them.]

 Posted by at 9:23 pm
Oct 272022
 

To those who know my city of birth, Budapest, this is an astonishing picture that I came across on Facebook.

In the foreground is Margaret Bridge, spanning the Danube. The kink in the bridge is where it touches Margaret Island. Beyond that, on the Pest side, it’s Saint Stephen’s Boulevard, named after Stephen I, Hungary’s first king. The two small domes on the left are part of the Western (“Nyugati”) railway station building, designed by none other than Gustave Eiffel (yes, that Eiffel).

But then… thanks to the magic of the telephoto lens, in the background we see another major railway station, the Eastern (“Keleti”) station. I never before realized that these two railway stations, which are actually miles apart, line up like this.

Not only that but behind that second railway station, we can even see some housing projects that are quite some distance away, near the terminus of the city’s #2 subway line.

Telephoto lenses are really tricky. By the way, in case anyone wonders, the image is from 1982. There’s plenty of traffic on the bridge, but notice that most of the cars are characteristic East Bloc models: Ladas, Trabants, a Skoda, a Moskvich if I am not mistaken, a Wartburg. The buses are the same Ikarus models that once roamed the streets even here in Ottawa. The streetcars were built by Hungary’s Ganz. That streetcar line is supposedly the world’s busiest, today served by rather nice-looking, very long, high-capacity Siemens trains.

 Posted by at 1:41 am
Oct 242022
 

Oh, moments after posting about not having worthwhile subjects to post about, I suddenly remembered something that I have been meaning to post about for some time. That is to say, Moore’s law in computing, the idea that the capabilities of computer technology roughly double every 18-24 months or so.

It has been true for a long while. Gordon Moore made this observation back in 1965, when I was just two years old.

I observed a form of Moore’s law as I was swapping computer hardware over the years. My first major planned upgrade took place in 1992, when I built a really high end desktop computer (it even had a CD-ROM drive!) for many thousands of dollars. Months later, my older desktop machine found a new life as my first ever Linux server, soon to be connected to the Internet using on-demand dial-up.

The new desktop machine I built in ’92 lasted until 1998, when it was time to replace it. For the first time, I now had a computer that could play back DVDs without the help of external hardware. It also had the ability to capture and display video from cable. Ever since, I’ve been watching TV mostly on my computer screen. I watched the disaster unfolding on September 11, 2001 and the tragic end of the space shuttle Columbia on February 1, 2003 on that computer.

Next came 2004, when I executed a planned upgrade of workstation and server, along with some backup hardware. Then, like clockwork, 2010 and finally, 2016, when I built these fine machines, with really decent but low power (hence low thermal stress) Xeon CPUs, three of them.

And now here we are, in late 2022. More than six years have passed. And these computers do not feel the least bit obsolete. Their processors are fast. Their 32 GB of RAM is more than adequate. Sure, the 1 TB SSDs are SATA, but so what? It’s not like they ever felt slow. Video? The main limitation is not age, simply finding fanless video cards of decent capabilities that a) make no noise, b) don’t become a maintenance nightmare with dust-clogged fans.

I don’t feel like upgrading at all. Would feel like a waste of money. The only concern I have is that my server runs a still supported, but soon-to-be-obsoleted version of CentOS Linux. My workstation runs Windows 10 but support won’t be an issue there for quite a while.

And then there are the aging SSDs. Perfectly healthy as far as I can tell but should I risk relying on them after more than 6 years? Even high-end SSDs are becoming dirt cheap nowadays, so perhaps it’s time to make a small investment and upgrade?

Moore’s Law was originally about transistor counts, and transistor counts continue to rise. But transistor counts mean nothing unless you’re interested in counting transistors. Things that have meaning include execution speed, memory capacity, bandwidth, etc. And on all these fronts, the hardware that I built back in 2016 does not feel obsolete or limiting. In fact, when I look at what I would presently buy to build new machines, quite surprisingly the specs would only differ marginally from my six year old hardware. Prices aren’t that different either. So then, what’s the point, so long as the old hardware remains reliable?

 Posted by at 8:10 pm
Oct 242022
 

There are only about six days left of the month of October and I have not yet written anything in this blog of mine this month. I wonder why.

Ran out of topics? Not really, but…

… When it comes to politics, what can I say that hasn’t been said before? That the murderous mess in Ukraine remains as horrifying as ever, carrying with it the threat of escalation each and every day? That it may already be the opening battle of WW3?

Or should I lament how the new American radical right — masquerading as conservatives, but in reality anti-democratic, illiberal authoritarianists who are busy dismantling the core institutions of the American republic — is on the verge of gaining control of both houses of Congress?

Do I feel like commenting on what has been a foregone conclusion for months, Xi “Winnie-the-pooh” Jinping anointing himself dictator for life in the Middle Kingdom, ruining the chances of continuing liberalization in that great country, also gravely harming their flourishing economy?

Or should I comment on the fact that prevalent climate denialism notwithstanding, for the first time in the 35 years that I’ve lived in Ottawa, Canada, our air conditioner came online in the last week of October because the house was getting too hot in this near summerlike heat wave?

Naw. I should stick to physics. Trouble is, apart from the fact that I still feel quite unproductive, having battled a cold/flu/COVID (frankly, I don’t care what it was, I just want to recover fully) my physics time is still consumed with wrapping up a few lose ends of our Solar Gravitational Lens study, now that the NIAC Phase III effort has formally come to a close.

Still, there are a few physics topics that I am eager to revisit. And it’s a nice form of escapism from the “real” world, which is becoming more surreal each and every day.

 Posted by at 7:41 pm
Sep 302022
 

I cannot escape the sensation that the unthinkable is drawing closer and closer with the passing of each and every day.

Today, the Institute for the Study of War released a special update, titled Assessing Putin’s Implicit Nuclear Threats After Annexation.

They assess that “Putin likely intends annexation to freeze the war along the current frontlines” and that if successful, “the Kremlin could reconstitute its forces and renew its invasion“.

They stress that although Putin mentioned nuclear weapons as he did in past speeches, he was “avoiding making the direct threats that would be highly likely to precede nuclear use“.

Nonetheless, the situation is wide open for miscalculation. As the ISW asserts, Putin “likely incorrectly assesses that his nuclear brinksmanship will lead the United States and its allies to pressure Ukraine to negotiate“.

The ISW then informs us that they “cannot forecast the point at which Putin would decide to use nuclear weapons“. That language is perhaps scarier than intended and not just because it raises the obvious question, if they cannot, who can? But also because it may be an accurate reflection of reality, as the question is not “if” but “when”.

Concerning Putin’s efforts, the ISW states that “rushing thousands of untrained and unmotivated Russian men to the front will not meaningfully increase Russian combat power“. And that while “Europe is in for a cold and difficult winter, yet the leaders of NATO and non-NATO European states have not faltered“.

In short: Putin is maneuvering himself and the West into a situation with fewer and fewer options, none of which are palatable.

In the end, the ISW comes to a conclusion that I wholly agree with: “The more confident Putin is that nuclear use will not achieve decisive effects but will draw direct Western conventional military intervention in the conflict, the less likely he is to conduct a nuclear attack“. This is why the West must make it abundantly clear that such a conventional intervention is a foregone certainty if nuclear weapons are used.

Is this enough? I have no idea. But it is the one option that might yet help us avoid turning this mess into WW3. Otherwise, the unthinkable just might happen… not in years, not in months, but possibly within weeks or less.

The trouble is, deep inside I suspect Putin already knows that there are no good outcomes left for him personally. And this is why he may decide, like other pathetic despots have done throughout history, that if he must burn, the world must burn with him. The trouble is, unlike despots of the past, Putin indeed wields the power to burn much of the world.

 Posted by at 4:08 pm
Sep 282022
 

I don’t always agree with Sabine Hossenfelder but every once in a while, she hits the nail spot on.

Case in point: Her article, published in The Guardian on September 26, about the state of particle physics.

Imagine going to a zoology conference, she says, where a researcher discusses a hypothesis (complete with a computer-generated 3D model) of a 12-legged purple spider living in the Arctic. Probably doesn’t exist but still, how about proposing a mission to the Arctic to search for one? After all, a null result also contains valuable data. Or how about a flying earthworm that lives in caves? Martian octopuses, anyone?

Zoology conferences do not usually discuss such imaginary monsters but, Sabine argues (and she is spot on) this is pretty much what particle physics conferences are like: “invent new particles for which there is no evidence, publish papers about them, write more papers about these particles’ properties, and demand the hypothesis be experimentally tested”. Worse yet, real money is being spent (wasted might be a better word) on carrying out such experiments.

She points out that while it is true that good science is falsifiable, the opposite isn’t always the case: Just because something is falsifiable does not make it good science.

And not just particle physics, I hasten to add. How about cosmology and gravitation? Discussions about what may or may not have happened during the Planck epoch? Exploring exotic spacetime topologies, often in dimensions other than four? And let me not even mention quantum computing or fusion energy…

Perhaps I am a born skeptic lacking imagination, but to me, these are all 12-legged purple Arctic spiders. The science we actually know and have the ability to confirm are general relativity in a spacetime that is by and large the perturbed Minkowski metric; and the Standard Model of particle physics, extended with a neutrino mass mixing matrix. These are the things that work. Not perfectly, mind you. General relativity needs “dark matter” (name aside, we don’t know what it is except that it has a dust equation of state) and “dark energy” (again, it has a name but beyond that, we don’t know what it is beyond its equation of state) to account for galaxy dynamics and cosmic evolution. The Hubble tension, the discrepancy between values of the Hubble parameter measured using different methods, is real. Observations by the James Webb space telescope suggest that we do not understand the “dark ages”, the first few hundred million years after the surface of last scattering (i.e., the epoch when the cosmic microwave background radiation was produced), well. Massive neutrinos invite the question about the apparent absence right-handed neutrinos.

And yes, we are very much in the blind concerning these issues. Nature has not yet provided hints and we are not smart enough to figure out the answers entirely on our own. But how is that an excuse for inventing 12-legged spiders?

I think it isn’t.

 Posted by at 6:40 pm
Sep 262022
 

Putting aside Trumpism, woke-ism, the politics of the day, populism, the whole kaboodle, here’s something to contemplate.

Tonight, Russia is continuing its efforts to subjugate the independent nation of Ukraine, not refraining from committing serious, intentional, criminal acts against the country’s civilian population to further its goals.

Also tonight, the space agency of the United States, NASA, is conducting a ground-breaking experiment, the first of its kind testing a method that might one day avert a global disaster, protecting the entire planet from an asteroid impact.

DART: View of the asteroid Dimophos 20 minutes to impact

I think it speaks volumes about the different ways in which these countries see their respective roles in the world.

I almost long for Soviet times. The regime was assuredly brutal, but at least it professed to seek noble goals. Not anymore, I guess.

 Posted by at 7:18 pm