Intel's Ronler Acres Plant

Silicon Forest
If the type is too small, Ctrl+ is your friend

Showing posts with label Math. Show all posts
Showing posts with label Math. Show all posts

Tuesday, September 17, 2024

Geometry Refresher


Brilliant Geometry Puzzle
Andy Math

I am a sucker for math problems. I like the ones that are easy for me to solve, I don't much care for the really esoteric stuff, i.e. problems I can't easily solve. I started watching this video and I'm thinking I should be able to solve this. I attack with the Pythagorean Formula (which is basically the only tool in my geometry toolbox) but I get nowhere. So I resume watching to see how he is going to solve it and he immediately brings up the Intersecting Chords Theorem. The what? Never heard of it. What the heck is this thing? So, more YouTube:


Intersecting Chords Theorem! (explanation and examples)
You Can Learn Math with Alyssa

I like Alyssa, she moves a little too slowly for my taste, but she is crystal clear and she has a pleasant voice. But then she comes to Central Angles and Inscribed Angles and my brain objects, so more YouTube:


Central Angles and Inscribed Angles! (theorems AND examples)
You Can Learn Math with Alyssa

Alyssa explains what the theorem is and shows how to apply it, but she doesn't explain how the theorem is derived, what some people call 'a proof', so now we need another explanation.


Inscribed angle theorem proof | High School Geometry | High School Math | Khan Academy
Khan Academy

Now that I think about it, I probably learned about all this back in high school, but I think that was it for geometry. After that is was calculus, trig and matrices, and geometry kind of got left in the dust.

Thursday, September 12, 2024

Fun with Math

United States of Voronoi

California Bob reports:

I just learned about this. This is one of those things that's easy to see but difficult to describe.

Voronoi Cells

A Voronoi diagram partitions a plane around points or "seeds" within it.  It THINK it divides the area so that the boundaries are always halfway between one seed and the next closest seed.

The official description is, boundaries are drawn so that all points within that boundary, are closer to its seed, than to any other seed.

If each seed was a repelling magnet, would this describe the same boundaries?

Here [image at top] it's used to draw state boundaries around state capitals.

Thursday, June 20, 2024

Spindle

The red arc describes the upper side of the hull, the blue follows the lower side. The straight green, red and black straight lines are radii for the upper arc. The length of the spindle is 70 meters and the diameter at the center is 8 meters.

I was reading about the Nautilus submarine from Jules Verne's 20,000 leagues under the sea. Seems the submarine in the novel was shaped like a spindle, not at all like the one in the movie. My question is: how do you compute the volume of a spindle? There might be a formula out there somewhere, but I have not found it. So I thought I would try calculating it on my own. Last week I made up a spreadsheet to sum the volume of sequential slices.

I used the Pythagorean formula to generate a formula to compute the radius of the hull from the distance from the bow. That seemed to work fine. The next day I tried to check my work, but being short on sleep my head was full of cotton and I could not make sense of it. Now I think I understand what it's like for people who have a hard time with math. It was like part of my brain was not working. Anyway, I'm doing better today so I took another look at it.

I decided the spread sheet was too cumbersome, so I wrote a little computer program to compute the volume by cutting the spindle into slices, computing the volume of each slice and then adding them all together. The volume is in cubic meters. Ten slices gets you to the nearest meter and a thousand slices will get you to the nearest cubic centimeter. Beyond that any differences that show up might be due to the limits of double precision arithmetic.

  CPU ticks      Slices        Volume
           4             1  3,518.583,772
           4            10  1,883.743,261
          17           100  1,883.565,830
         133         1,000  1,883.565,812
       1,339        10,000  1,883.565,812
      12,929       100,000  1,883.565,812
     131,847     1,000,000  1,883.565,812
   1,110,081    10,000,000  1,883.565,813
  10,897,789   100,000,000  1,883.565,810

The volume is in cubic meters. At one hundred slices we already have the volume to the nearest liter (one one-thousandth of a cubic meter). At one thousand slices we have the volume to down to one cubic centimeter (one milliliter). At ten million slices the last digit starts changing. I suspect we have reached the limit of what can be done with floating point math without taking a closer look at the equations. I'm not going to do that. The nearest cc is close enough for me.

Comma-fication

Big numbers without commas are hard to read, so I spent most of a day working out how to automatically place commas in the output. It made the program four times as long. In some versions of C you can use an apostrophe to tell printf to insert commas, but it wasn't available with the online compiler I used, so I wrote my own routines. And because I wasn't sure if it was working correctly, I wrote another one to verify the first.

I also added some rudimentary command line parsing so you can change the length, beam and number of slices without having to modify the code.

Blog post: Jules Verne - Nautilus

Desmos Calculator Graph

C program source code on github

OnlineGDB IDE (Interactive Development Environment) C compiler

The length of the Nautilus is given as 70 meters and the beam is 8 meters.



Monday, April 29, 2024

Trying to Explain Math Problems


The last question on the 2022 British GCSE maths exam
blackpenredpen

I saw this video about a geometry problem the other day and within a couple of seconds I had figured out how to solve it. Okay, good for me, but then I start watching this dude's explanation and I wonder what the devil is he doing? The solution is so simple, why is he making it so hard? So I sat down to do the calculations for my method and I had to do it two or three times before I got the right answer. You've got to be paying attention when you are working problems like this and being as I am retired (I.e. a professional slacker) it takes a bit to get the ol' brain running on all cylinders. 

So now that I have verified that my technique works, can I explain it to anybody else? The technique in the video is pretty good, just use dry-erase markers on a whiteboard and record your explanation with a video camera. I've got a white board and my smart phone has a video camera. Probably have to order some dry-erase markers and buy or make a tripod. But then you have to record your explanation, and since the first take is going to be garbage, you're going to have to do it again, possibly several times, and you are going to have to watch each of them to gauge whether they are any good or not. Bah, sounds like a giant time suck. I'm a keyboardist, probably should stick to what I know.

So now I'm looking for math symbols I can use in this blog and I found the code for Π (pi) and for √ (the radical for square roots). Funny thing is you put the html code in and Blogger turns it into a character.

Most math equations like to represent division with a horizontal line with one number above and one number below. That's great if you have an editor that supports it, but it takes extra special fiddling to do that using Blogger's editor. Computer code uses a / (slash) to represent division. It isn't as pretty and often requires parentheses, but since I'm getting tired of mucking around here, it's good enough. The radical symbol doesn't automatically carry over all the following digits, so I'm using parentheses here as well.

The last problem is what to call the slice of a circle that is cut off by a chord. There ought to be term for that. Wikipedia calls it a circular segment. That's still too long for me. I'm going to call it a sword cause it kind of reminds me of the scimitars from ancient Arabia.

Here's the original problem:

Find the area of the shaded portion

Here's the same three circles with a couple of equilateral triangles:

Geometry Problem

You can see that each of the two shaded areas are a pie shape with two swords cut out of the sides. The area of the sword is the difference between the area of a pie shape and the area of an equilateral triangle. So all we have to do is compute the area of a pie shape and the triangle and then do a little addition and subtraction. Here's the math. r, the radius of the circle, is 4.

Area of pie shape = Πr²/6

Height of equilateral triangle = √(r² - (r/2)²)
 = √(r² - r²/4)
 = √(4r²/4 - r²/4)
 = √((r²/4)4 - (r²/4)1)
 = √((r²/4)(4 - 1))
 = √(r²/4) (4 - 1)
 =    (r/2)  √(4 - 1)
 =    (r/2)  √3

Area of equilateral triangle = 1/2 x base x height
= r * (r/2) √3 / 2
= r² * √3 / 4

Area of sword (space between the triangle and the circle)
Area of pie shape - Area of equilateral triangle
Πr²/6 - r²√3 /4
r²(Π/6 - √3 /4)

Area of one shaded area
Area of pie shape - 2(Area of sword)
Π/6 - 2r²(Π/6 - √3 /4)
Π/6 - r²(Π/3 - √3 /2)
r²(Π/6 - Π/3 + √3 /2)
r²(√3 /2 - Π/6)

Area of total shaded area
= 2(Area of one shaded area)
= 2r²(√3 /2 - Π/6)
= r²(√3 - Π/3)

Thursday, October 5, 2023

Using Desmos Graphing Calculator to Solve a Geometry Problem

This problem comes from Mind Your Decisions. The problem is to find the length of a side of the blue square.

The problem square


The embellished square

Having worked on similar problems from Presh, I was familiar with his line of attack, so I stopped the video early on and put together my own drawing which is very similar to the one I stole from the video.

Now we have a bunch of right triangles so we can set up a couple of two-variable equations. You can see them in the video. Mine are virtually identical, but I don't want to type them out. I don't know how to solve these equations, and apparently Presh doesn't either. He turned to Wolfram Math, I turned to Desmos graphing calculator.

Desmos graph of two equations

Notice there are two gray dots where the red line intersects the blue line. Before I completed the screen shot Desmos was showing the coordinates of the rightmost intersection to be (1.598, 3.798). Use these numbers as the sides of right triangle a-b-s and the Pythagorean formula tells us the length of the side of the square is 4.120.

In the equations I used in Desmos, I used x for b and y for a.


Wednesday, October 4, 2023

A Rube Goldberg inspired useless machine


Kind of a cool little box. This kind of sums up my activity today. Be better if it did something useful, like Matt's Remote Control:


I've been working on some number puzzles from MindYourDecisions and Michael Penn. They are relatively simple number puzzles that can be solved with a little logic and algebra, but today I wasn't feeling that sharp, so I decided to write a program to solve it. For me it's basically a mindless task. It wouldn't use any complicated logic, it would just execute a loop and test each number in succession until we got an answer. Or we ran out of numbers. We can only go as high as two billion without having to get fancy. You do have to put a limit on it or it will run forever. Once it gets to the maximum value, it will roll over to the negative value and just keep going, whether it makes any sense or not. I solved one of the puzzles using this technique. The other one failed because of a faulty instruction. Haven't figured out just where the fault is. It will probably turn out to be something obvious that I won't be able to recognize until I have left it on the shelf for a week or two.

Update minutes later - fixed the start time on Matt's video.

P. S. html stuff. I just realized that YouTube will calculate start and stop times for you. Pause the video where you want it to start, click Share then Embed. In the dialog box it will have a checkbox to start at the current position/time. It shows that time in minutes and seconds format (mm:ss), but when you click the box, it converts that time into seconds and inserts it in the embed code. Copy the code and paste it on your blog or wherever. Let the video play until you get to the end of the section you want. Now you can use the same trick to get the stop time (end is the parameter name).

Monday, August 7, 2023

Antikythera Mechanism


Antikythera Mechanism V2: A Modernized Reproduction
Spencer Connor

This is just amazing. He ties the astronomy, math and mechanics all together. I've put up a couple of other posts about this machine.

Monday, January 9, 2023

Fun With Numbers

9,223,372,036,854,775,807 = nine quintillion two hundred twenty three quadrillion three hundred seventy two trillion thirty six billion eight hundred fifty four million seven hundred seventy five thousand eight hundred seven

I've been spending a little time on quora lately, looking at computer programming questions mostly. Most of them are pretty wretched, people who have no idea what they are talking about asking questions that don't make any sense, or people asking how to write elementary programs, questions that you might find in the homework for a programming class, but every once in a while you get a real question that prompts me to reply.

I used to think the requests for elementary programs were from people looking for someone to do their homework for them, but then I realized that a lot of these questions were being answered. Now I wonder if they aren't being churned out by someone looking for points from the quora masters and the people who are answering them are just looking for a little something to occupy their mind. Some people do crosswords, some people do jigsaw puzzles, some people play video games and some people write elementary computer programs.

I write basically useless computer programs, but I have a higher purpose, like I am trying to learn something, or I am trying to explain something, or I just want to see if I can do it. I post them on github, though I don't know if anyone has every bothered to look at them. They're up there if you want to take a look. They are all written in C.

Anyway, one question on quora was asking for a program that could translate a number into the corresponding version written out in English words. This is just my speed, so I set down to write one. It wasn't too difficult and I did learn a few things long the way. Supposedly it will translate an integer up to the largest value that can be held in a 64 bit integer. That's it at the top of the page. Yes, the question only asks for three digit numbers, but you know the old saying "in for a pint, in for a pound" or something like that.

That's a lot of numbers. How can I be sure it is translating them correctly? Well, you write a test program to compute the numeric value from the English words. That one was a little more difficult because I was getting tired and making stupid mistakes, but I got it done. For as much testing as I have done everything seems to check out. I could set it up to test all of the numbers, but I am not sure we have enough time. It took 3.4 seconds to test 1,000,000 (one million) numbers. At that rate it would take an hour to test a billion numbers, a week to test a trillion numbers, 25 years to test a quadrillion numbers, 2,500 years to test a quintillion numbers and 25,000 years to test nine quintillion numbers, and double that if we want to include the negative numbers. Ain't nobody got time for that.

You know, someone has probably already written a library function to do this, but I'd have to Google it, and then I'd have to figure out how to a get a hold of it, and read the instructions on how to use it, and that shit isn't any fun, unless it's something I need in order to do what I want to do. Writing it myself was actually fun.


Saturday, October 22, 2022

Prime Numbers


x/log(x) (red) Approximates the Number of Primes under x
x/9 (blue)
The green line shows the difference

Playing with a little bit of algebra and trying to write a program to solve a particular problem. I need to factor a number, which means I need a list of prime numbers, so how much space do I need given a number of certain size? x/9 (blue) approximates x/log(x) well enough for my purposes for values of x under a billion.

Friday, August 12, 2022

Will Rogers - The Ropin' Fool


Will Rogers - The Ropin' Fool
Will Rogers Memorial Museum

Just because. 

Checking the date, I noticed the copyright date in the intro: MCDCCCCXXI which Thomas's Roman numeral converter tells us is 1821. Someone stuck an extra C just after the M. Take it out and you get 1921.

Wednesday, June 15, 2022

Computer Math


Ariane 5 rocket launch explosion
Amazing Info TV

Yesterday at lunch I heard a somewhat bizarre story about how an error in a math calculation caused an industrial disaster. While there have been incidents where a computer error resulted in a disaster (the Ariane space rocket (above) being one) I haven't found any confirmation of this particular story. But while I was looking I did find a couple of curious items.

Both of these items are relatively ancient, one is from 2006 and the other is from 2015. Both contained short programs that demonstrated their problems, so I tried them out on my machine and the same problem appeared. Well, looky there, magic!

I'm only posting this as a waypoint marker. We'll see if I get any farther down this road.

My test program for 2006 problem on github.

My test program for 2015 problem on github.


Thursday, April 14, 2022

Fun With Roman Numerals


How Roman numerals broke the official dog database.
Stand-up Maths

I enjoy this guy, Matt Parker. This is a pretty silly video, but fun. I mean, who knew Roman Numerals could be so amusing?

Wednesday, March 30, 2022

Genaille Rods


Genaille Rods Review / HowTo
Chris Staecker

Never mind that I had never heard of this before, the Internet has. Google Genaille Rods and you even find Genaille Rods for sale. And of course Wikipedia has a page with this little bit:
The popularity of Genaille's rods was widespread but short-lived, as mechanical calculators soon began to displace manual arithmetic methods.

Friday, March 18, 2022

Steinhaus Longimeter


Steinhaus Longimeter Review / HowTo
Chris Staecker

Reminds me of the old mechanical gun computers and their techniques for measuring the lengths of curves.

YouTube blurb: "The Steinhaus Longimeter, invented in the 1930s by Hugo Steinhaus."


Update April 2024 fixed video embed code

Sunday, November 21, 2021

More Pie


Why do calculators get this wrong? (We don't know!)
Stand-up Maths

Sometimes I like Matt Parker and sometimes he's just a little too much. I found this video to be pretty entertaining.

I ran a couple calculations on Google just to verify that this isn't just all horse puckey, and it seems to check out.

11^6 / 13 = 136273.923077

I put up a couple of posts about Farey Additon a couple of years ago.

 

Sunday, October 24, 2021

Web

Knit Hat

I just realized that this blog is my knitting project. Some people knit with yarn, whereas here I knit with web links. I am not sure if anyone even notices. Some people might use some of the links I post, and there might be someone out there who appreciates the complexity of the web I have created. Actually, complex is not the right word, chaotic would probably be a better choice. It would be nice to have a graph to see if there was any kind of pattern to it. I suspect there would be if it was all filled in, but my technique has changed a bit, dare I say 'evolved'? I don't think links were as pervasive in my older posts. I suspect any graph drawn would look something like a picture of the Milky Way, a picture made of a mosaic of photographs, except large swaths of photographs would be black because the photographer went on vacation. 

Fractal Tree

Then again it might just look like the root of a plant, it just continually reaches out and forks.

P.S. Titling this post 'Web' brought to mind the phrase 'web of lies', and I thought that surely someone had made a movie about the web of lies engulfing our country, but all I found was some lame computer hacker movie and a TV series about interpersonal disasters.

P.P.S. Sorry about the background on the Fractal Tree. Usually that comes from some kind of vector image and disappears when you post it. I think this one had a conventional picture image suffix like .png or .jpg and that's why the checkerboard didn't disappear. Maybe it will disappear when this gets posted, but I doubt it.


Monday, August 9, 2021

Square Cross Puzzle


How did Ramanujan solve the STRAND puzzle?
Mathologer

I started watching this video the yesterday. I got as far as the square cross puzzle (timestamp 1:45 to 2:20), and that intrigued me. I stewed on it overnight and this morning I came up with this analysis.

Square Cross Problem

We start with a drawing of a cross. The cross is composed of five squares. The center of the cross is a square. Attached to each side of the central square is another square of the same size.

Our mission, should we choose to accept it, is to cut the cross into five pieces and then reassemble those pieces into two crosses with the same shape. These two new crosses are the same size as each other.

Since we are making two crosses from the original larger cross, each of the smaller crosses must be one half of the area of the original larger cross.

If the length of the side of one of the component squares of the larger cross is one, a little algebra will show us the the length of the side of one of the component squares of the smaller crosses must by the (2^0.5)/2 (the square root of two divided by two).

Cutting each of the component squares of the original square on both diagonals will give us 20 right isosceles triangles. Two of those triangles joined together along their hypotenuse will give us a square the same size as one of the component squares of the smaller crosses. Two triangles for each of five squares requires ten triangles to make one smaller cross. Two times ten is twenty, the number of triangles we got by cutting up the larger cross.

This is the brute force method. It shows we can cut up the larger cross into smaller pieces and reassemble them into two, smaller, crosses. However, we have twenty pieces, not five, so we do not have a solution to the stated problem.

The trick is to find cuts that do not need to be made so that when we cut up the larger square we only have five pieces. Now I'm thinking a computer program could make short work of this if I can just figure out how to encode it.


Tuesday, April 13, 2021

Does Not Compute


The REAL Answer To The Viral Chinese Math Problem "How Old Is The Captain?"
MindYourDecisions

Presh Talwalkar emphasizes clarity in his speaking voice over smoothness which means listening to him is not as pleasant as it could be, but then there shouldn't be any confusion over what he is saying, which is kind of important when you are dealing with something as persnickety as math.

He must have a zillion videos up on YouTube. Most of them are straight up math problems. This is the first one I have encountered that veers off into psychology. The math problems that he posts range from trivial to esoteric. I like the mid-range ones, though I am sometimes mistaken in my initial impression and find after working on it for a few minutes that I am not going to be able to solve it without digging up some obscure mathematical knowledge.

Tuesday, December 1, 2020

The unexpectedly hard windmill question (2011 IMO, Q2)


The unexpectedly hard windmill question (2011 IMO, Q2)

Another math video. The problem itself is not that interesting, but the problems this problem caused, that's another story.