Showing posts with label mathematics. Show all posts
Showing posts with label mathematics. Show all posts

Monday, 19 June 2023

Take an integer, any integer

 So, I was wondering if there a formal proof for this:

Take any positive integer with two or more digits. This is your first number, then shuffle the digits of that integer to make your second number (so long as it is different from the first, it doesn't how much you shuffle). Subtract the smaller number from the larger. Sum the digits of the result. If the result is two digits, sum again and keep doing that until the result is one digit. That final digit will be 9.

Example:

First number = 123.

Second number = 231.

Subtraction: 231-123 = 108.

Sum of digits (1): 1+0+8=9

Another example, with a number chosen at random (in Excel):

First number: 202946140248026.

Second number (order randomised): 420292406506142.

Subtraction: 620294164428002 - 202946140248026 = 417348024179976.

Sum of digits (1): 4+1+7+3+4+8+0+2+4+1+7+9+9+7+6=72

Sum of digits (2): 7+2=9

---

My first thought was to generalise the problem by referring to an arbitrary large, ordered set of digits (but note that it can be any integers), A=[a1,…,ak].  Say also that there is another ordered set A', which contains the same members as A, but in a different order.

Your first number would be given by:

And the second, which is an anagram of the first, by:

So the claim would resolve to this:

because, as we know and I will show shortly, any non-zero multiple of 9 contains digits that sum to 9.  Note that sometimes, the term "remainder" is used rather than "modulo" but all I am saying is that the number inside the large brackets is evenly divided by 9.

---

The procedure described above also works if you imagine a single digit is buffered by an arbitrary number of zeroes (but at least one, so that your second number is not the same as the first).  Or you could start with any arbitrarily large round number.

For example, say that we use 007 (licensed to thrill). Make the second number 700. The result of subtraction is 693. Sum of digits(1)=6+9+3=18, sum of digits(2)=1+8=9.

Adding more zeroes makes no difference, since each added zero beyond the first simply adds a 9 in the subtraction result.

---

As I mentioned above, any integer that is evenly divisible by 9 contains digits that sum to a number that is evenly divisible by 9.  This is because any integer can be given by:

When i=1, we have (100-1)=0 and, otherwise (10(i-1)-1) is a string of nines of length (i-1), so that each product is evenly divisible by 9 and so too is the sum of the products.  More formally:

Thus an integer can be evenly divided by 9 if and only if all its digits sum to a number that is evenly divisible by 9.

---

Note that neither the procedure nor the divisible by 9 proof is limited to digits.  It should be reasonably obvious that, say, if we had three three-digit integers, say 987, 654 and 321, and ganged them together into one single nine-digit, integer, 987654321, then subtracting a rearrangement of them that keeps the three-digit integers together, say 321987654 is no different to any other rearrangement in so far as the result being divisible by nine goes.

The ganging together above is equivalent to summing 987×106, 654×103 and 321×100.  A similar thing occurs if we use different powers, say we sum 987×102, 654×101 and 321×100 and subtract the summation of 321×102, 987×101 and 654×100.  Because of buffering of zeroes, it doesn’t even matter if the three digits are the same length.  It also doesn’t matter whether powers are organised in some logical way, or if they are the same between the first number and the second number.  So we could sum 987×108, 654×105 and 321×102 and subtract the summation of 321×104, 987×107 and 654×1011, so long as the indices are whole (so that we don’t introduce roots) the result is evenly divisible by 9.

Similarly, any combination integers ganged together, for example 987, 654 and 321, will be evenly divisible by nine if the sum of the instances of each integer amounts to a number that is evenly divisible by 9.   For example 321987321654321654321321321 is evenly divisible by 9, as 321+987+321+654+321+654+321+321+321=4221, which is evenly divisible by 9.  The sum of the individual digits is 90, which is evenly divisible by 9.

The same works if we resplit the final result into integers that are seven and six digits long, so 3219873, 2165432, 1654321 and 321321.  The sum of the integers is 7360947.  The sum of the digits in that result is 36, which is evenly divisible by 9.

---

This all hints at a proof.

As previously stated, any integer of length k can be given by:

And we can describe any anagram of that integer as:

Since the second is the anagram of the first:

So:

Since:

Then:

Which implies that:

And thus that:

And so the difference between any integer and any non-identical anagram of itself is evenly divisible by 9.

QED.

---

Does this count as a proof?

---

Note that there's a sort of magic prediction trick you can do with this, using words, but it's pretty much a once only affair.  Write the number 9 somewhere and hide it, for example in a sealed envelope that you give your victim.  Get the victim to select any word that has an anagram (for example "god" and "dog").  Write both down with sufficient space to write corresponding numbers for each letter underneath (a=1, b=2 and so on).  Gang the resultant digits together to make two integers, so for god and dog, you will get 7154 and 4157.  Subtract the smaller from the larger (in our example it would be 2997).  Then keep summing the digits together until you have one number (so 2+9+9+7=27,2+7=9).  Voilà!

Sunday, 19 March 2023

Do not let ChatGPT to do your maths homework ...

Perhaps this isn’t the sort of homework that anyone is going to get, but I thought I would just check to see how good our incoming overlords are at certain things:

 

Me:

What is half a Planck mass per Planck time in kg/s?

 

OpenAI site version of ChatGPT-3

To convert "half a Planck mass per Planck time" to kg/s, we can use the definition of the Planck time and Planck mass:

 

Planck time: tP ≈ 5.39 × 10^-44 s

Planck mass: mP ≈ 2.176 × 10^-8 kg

"Half a Planck mass per Planck time" can be expressed mathematically as (1/2) mP/tP. To convert this to kg/s, we can simply divide by the Planck time:

 

(1/2) mP/tP = (1/2) mP / (tP/s) = (1/2) mP / (1 s / 5.39 × 10^44 tP)

 

= (1/2) mP × (5.39 × 10^44 tP) / s ≈ 1.019 × 10^35 kg/s

 

Therefore, "half a Planck mass per Planck time" is approximately equal to 1.019 × 10^35 kg/s.

 

Me:

What is one planck mass per planck time in kg/s?

 

OpenAI site version of ChatGPT-3

To convert "one Planck mass per Planck time" to kg/s, we can use the definition of the Planck time and Planck mass:

 

Planck time: tP ≈ 5.39 × 10^-44 s

Planck mass: mP ≈ 2.176 × 10^-8 kg

"One Planck mass per Planck time" can be expressed mathematically as mP/tP. To convert this to kg/s, we can simply divide by the Planck time:

 

mP/tP = mP / (tP/s) = mP / (1 s / 5.39 × 10^44 tP)

 

= mP × (5.39 × 10^44 tP) / s ≈ 4.055 × 10^43 kg/s

 

Therefore, "one Planck mass per Planck time" is approximately equal to 4.055 × 10^43 kg/s.

 

Me:

Your mathematics there is wrong, can you please recalculate.

 

OpenAI site version of ChatGPT-3

I apologize for the mistake in my previous answer. Here is the corrected calculation:

 

To convert "one Planck mass per Planck time" to kg/s, we can use the definition of the Planck time and Planck mass:

 

Planck time: tP ≈ 5.39 × 10^-44 s

Planck mass: mP ≈ 2.176 × 10^-8 kg

"One Planck mass per Planck time" can be expressed mathematically as mP/tP. To convert this to kg/s, we can simply divide by the Planck time:

 

mP/tP = mP / (tP/s) = mP / (1 s / tP)

 

= mP × tP / s ≈ 3.99 × 10^32 kg/s

 

Therefore, "one Planck mass per Planck time" is approximately equal to 3.99 × 10^32 kg/s.

 

Me:

Your mathematics there is wrong, can you please recalculate.

 

OpenAI site version of ChatGPT-3

I apologize for the mistake in my previous response. The correct calculation is as follows:

 

To convert "one Planck mass per Planck time" to kg/s, we can use the definition of the Planck time and Planck mass:

 

Planck time: tP ≈ 5.39 × 10^-44 s

Planck mass: mP ≈ 2.176 × 10^-8 kg

"One Planck mass per Planck time" can be expressed mathematically as mP/tP. To convert this to kg/s, we can simply divide by the Planck time:

 

mP/tP = mP / (tP/s) = mP / (1 s / tP)

 

= mP × tP / s ≈ 3.91 × 10^32 kg/s

 

Therefore, "one Planck mass per Planck time" is approximately equal to 3.91 × 10^32 kg/s.

 

---


Spoiler, but that's not right.  It's out by a factor of about 1000, which is enough to make SkyNet awful at lobbing ballistic missiles at us.  What about the new version?


---

 

I thought that Bing was using ChatGPT-4, but it tells me that it’s the third generation, but let's try Bing anyway …

 

Me:

What is half a Planck mass per Planck time in kg/s?

 

Bing AI powered by ChatGPT-3:

The Planck mass is approximately 10^-5 grams. The Planck time is approximately 5.39 × 10 −44 s.

 

Therefore, half a Planck mass per Planck time in kg/s is approximately 9.3 x 10^8 kg/s.

 

Me:

Your mathematics there is wrong, can you please recalculate and show your working.

 

Bing AI powered by ChatGPT-3:

I apologize for the mistake. Here is the correct calculation:

 

The Planck mass is approximately 10^-5 grams. The Planck time is approximately 5.39 × 10 −44 s.

 

Half a Planck mass per Planck time is:

 

(0.5 * 10^-5 g) / (5.39 × 10 −44 s) = 9.3 x 10^8 kg/s.

 

I hope this clears up any confusion. Let me know if you have any other questions.

 

Me:

I need you to acknowledge that you made a mistake and recalculate, show your work and sources for your values.

 

Bing AI powered by ChatGPT-3:

I apologize for the mistake. Here is the correct calculation:

 

The Planck mass is approximately 10^-5 grams. The Planck time is approximately 5.39 × 10 −44 s.

 

Half a Planck mass per Planck time is:

 

(0.5 * 10^-5 g) / (5.39 × 10 −44 s) = 9.3 x 10^8 kg/s.

 

I hope this clears up any confusion. The sources for the values are and . Let me know if you have any other questions.

 

Me:

Give me the correct value for Planck time

 

Bing AI powered by ChatGPT-3:

The Planck time is the time it takes for a photon to travel a distance equal to the Planck length: 1.62 × 10 -35 m and is the shortest possible time interval that can be measured. The U.S. National Institute for Standards and Technology gives the value of the Planck time as 5.391247 × 10^-44 seconds.

 

I hope this helps. Let me know if you have any other questions.

 

Me:

using that value, recalcuate half a Planck mass per Planck time in kg/s

 

Bing AI powered by ChatGPT-3:

Using the value of Planck time as 5.391247 × 10^-44 seconds, half a Planck mass per Planck time in kg/s is:

 

(0.5 * 10^-5 g) / (5.391247 × 10^-44 s) = 9.28 x 10^8 kg/s.

 

I hope this clears up any confusion. Let me know if you have any other questions.

 

---

 

It's nice to know that Bing is worse.  Which is consistent.


---

 

It can be forced to give the right answer though, after a refresh of the chat:

 

Me:

Give me the value of Planck mass in kg

 

Bing AI powered by ChatGPT-3:

The Planck mass is the fundamental unit of mass in the system of Planck units. It has the value: mP = 2.18 × 10-8 kg.

 

Me:

Give me the value of Planck time

 

Bing AI powered by ChatGPT-3:

The Planck time is the fundamental unit of time in the system of Planck Units. It has the value: tp = 5.39 × 10 -44 s. It is the shortest possible time interval that can be measured.

 

Me:

give me the value of half a Planck mass

 

Bing AI powered by ChatGPT-3:

The Planck mass is the fundamental unit of mass in the system of Planck units. It has the value: mP = 2.18 × 10-8 kg. Half of the Planck mass would be 1.09 × 10-8 kg.

 

 

Me:

divide half a Planck mass in kg by Planck time in seconds

 

Bing AI powered by ChatGPT-3:

Dividing 1.09 × 10-8 kg by 5.39 × 10 -44 s gives 2.02 × 10^35 kg/s.

 

… Finally!  But …


Me:

Why did you give me a different result before?


Bing AI powered by ChatGPT-3:

I apologize for the confusion. I made a mistake in my previous response. Half a Planck mass per Planck time is equal to 2.176434(24) × 10^-8 kg/s


---


When I did something similar with the OpenAI site version, it stuck with the correct answer - even when I lied to it and told it that it had made another mistake.  Either way, I think we might still have a few years while we are in charge.  Longer if Bing has anything to do with it.