Posted on Leave a comment

The Three Laws of Recursion

Like the robots of Asimov, all recursive algorithms must obey three important laws:

  • A recursive algorithm must have a base case.
  • A recursive algorithm must change its state and move toward the base case.
  • A recursive algorithm must call itself, recursively.

Recursion is the process of defining a problem (or the solution to a problem) in terms of (a simpler version of) itself. For example, we can define the operation “find your way home” as: If you are at home, stop moving. Take one step toward home.

Let’s begin our discussion of recursion by examining the first appearance of fractals in modern mathematics. In 1883, German mathematician George Cantor developed simple rules to generate an infinite set:

Cantor’s rule for an infinite set

There is a feedback loop at work here. Take a single line and break it into two. Then return to those two lines and apply the same rule, breaking each line into two, and now we’re left with four. Then return to those four lines and apply the rule. Now you’ve got eight. This process is known as recursion: the repeated application of a rule to successive results. Cantor was interested in what happens when you apply these rules an infinite number of times.

George Cantor

Dichotomy paradox – Zeno’s

“That which is in locomotion must arrive at the half-way stage before it arrives at the goal.”

— as recounted by Aristotle, Physics VI:9, 239b10

Suppose Atalanta wishes to walk to the end of a path. Before she can get there, she must get halfway there. Before she can get halfway there, she must get a quarter of the way there. Before traveling a quarter, she must travel one-eighth; before an eighth, one-sixteenth; and so on.

Zeno’s paradox was recursive by cutting the distance in half each time to the infinitesimal. This is also how the Tortoise beat the Hair by questioning time over distance.

Recursive Function Calls

The tortoise and the Hair – the paradox of time
int factorial(int n) 
{ if (n == 1) { return 1; }
else { return n * factorial(n-1); } }

A function that does call others is called a nonleaf function. … The factorial function can be rewritten recursively as factorial(n) = n × factorial(n – 1). The factorial of 1 is simply 1. The image shows an object trace of the factorial function written as a recursive function. Each call goes in the run time stack until the base case is reached, and the the stack is popped as the result is passed to each function on the stack.

Five Factorial (5!) in recursion

What Is a Fractal?

The term fractal (from the Latin fractus, meaning “broken”) was coined by the mathematician Benoit Mandelbrot in 1975. In his seminal work “The Fractal Geometry of Nature,” he defines a fractal as “a rough or fragmented geometric shape that can be split into parts, each of which is (at least approximately) a reduced-size copy of the whole.”

Recursion in Nature

Looking closely at a given section of the tree, we find that the shape of this branch resembles the tree itself. This is known as self-similarity; as Mandelbrot stated, each part is a “reduced-size copy of the whole.”

The Three Laws of Robotics

Isaac Asimov was an American writer and professor of biochemistry at Boston University. During his lifetime, Asimov was considered one of the “Big Three” science fiction writers, along with Robert A. Heinlein and Arthur C. Clarke. A prolific writer, he wrote or edited more than 500 books.

  • A robot may not injure a human being or, through inaction, allow a human being to come to harm
  • A robot must obey the orders given it by human beings except where such orders would conflict with the First Law
  • A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws
Partial sources: https://natureofcode.com/book/chapter-8-fractals/, Wikipedia, Google 
Posted on

Noise by Daniel Kahneman | 3 Distinctions

The Michael Shermer Show with Daniel Kahneman – Noise: A Flaw in Human Judgment

DESCRIPTION

Imagine that two doctors in the same city give
different diagnoses to identical patients. Now
imagine that the same doctor making a different
decision depending on whether it is morning or
afternoon, or Monday rather than Wednesday.
This is an example of noise: variability in
judgments that should be identical.

Shermer speaks with Nobel Prize winning
psychologist and economist Daniel Kahneman
about the detrimental effects of noise and what
we can do to reduce both noise and bias, and
make better decisions in: medicine, law, economic
forecasting, forensic science, bail, child
protection, strategy, performance reviews, and
personnel selection.

Video clip – 3 minutes

Noise by Daniel Kahneman | 3 Distinctions

SUPPORT THE PODCAST
If you enjoy the podcast, please show your
support by making a donation. Your patronage will
ensure that sound scientific viewpoints are heard
around the world.
https://www.skeptic.com/donate/
SPONSOR
Wondrium
https://wondrium.com/shermer
SPONSOR
Brilliant
https://brilliant.org/MichaelShermer/

Listen to The Michael Shermer Show via Apple
Podcasts, Spotify, Amazon Music, Google
Podcasts, Stitcher, iHeartRadio, and Tuneln.
https://www.skeptic.com/michael-sherm..

Full Video – Noise by Daniel Kahneman

Full video at https://youtu.be/5CFjERpwFys

Posted on

Michio Kaku: 3 mind-blowing predictions about the future

What lies in store for humanity? Theoretical physicist Michio Kaku explains how different life will be for your descendants—and maybe your future self, if the timing works out.

15 min

with
Michio Kaku

Michio Kaku: 3 mind-blowing predictions about the future
  1. We will become a space-faring species
  2. We will expand the brain’s capabilities
  3. We will defeat cancer

About

Michio Kaku (Japanese: カク ミチオ, 加来 道雄, born January 24, 1947) is an American theoretical physicist, futurist, and popularizer of science (science communicator). He is a professor of theoretical physics in the City College of New York and CUNY Graduate Center. Kaku is the author of several books about physics and related topics and has made frequent appearances on radio, television, and film. He is also a regular contributor to his own blog, as well as other popular media outlets. For his efforts to bridge science and science fiction, he is a 2021 Sir Arthur Clarke Lifetime Achievement Awardee.

Sources
Posted on

The Metre – the repeating circle & triangulation

The Metre (meaning measure) was one ten-millionth of the distance from the North Pole to the Equator! France embarked on a first large scale measurement. It took 7 years to measure the distance from Dunkirk to Barsalona. They used triangulation with an instrument called the Repeating Circle along with trigonometry.

The standardization of measurement: the Metre

Creating the Metre – a universal standard

By the 16th century, there we over 250,000 weights and measures in Europe. This effected trade, navigation, building plans, etc. Fire hoses would not connect from town to town. France chose to create a standard by measuring something unchangeable. They chose the Earth. Before this standardization, the human body (the Ruler of the land) would make new measurements upon gaining power.

The Repeating Circle

Repeating Circle
Repeating Circle

DESCRIPTION

This is one of two double repeating circles that Ferdinand Rudolph Hassler, the first superintendent of the U. S. Coast Survey, ordered from Edward Troughton in London in 1812, and that was shipped in 1815. The large circle may be angled from vertical to horizontal to the opposite vertical position. It is graduated to 10 minutes, and read by four verniers and two magnifiers to single minutes.

A repeating circle is a geodetic instrument with two telescopes that is designed to reduce errors by repeated observations taken on all parts of the circumference of a circle. The form was developed by the Chevalier de Borda, first executed by Etienne Lenoir in Paris around 1789, and popular for about 50 years.

Ref: F. R. Hassler, “Papers on Various Subjects Connected with the Survey of the Coast of the United States,” Transactions of the American Philosophical Society 2 (1825): 232-420, on 315-320 and pl. VII. “The Repeating Circle Without Reflection, as made by Troughton,” in The Cyclopaedia: or, Universal Dictionary of Arts, Sciences, and Literature, edited by Abraham Rees (London, 1819), Vol. VII, Art “Circle.”

Image credit:

NAME: repeating circle MAKER: Troughton and Simms PLACE MADE: United Kingdom: England, London MEASUREMENTS: overall: 32 1/8 in x 26 3/4 in x 17 in; 81.6356 cm x 67.945 cm x 43.18 cm upper circle: 17 1/2 in; 44.45 cm circle at base: 13 1/2 in; 34.29 cm telescope: 24 in; 60.96 cm overall; base: 16 3/4 in x 15 1/4 in x 16 in; 42.545 cm x 38.735 cm x 40.64 cm overall; horizontal circle: 13 in x 23 in x 20 in; 33.02 cm x 58.42 cm x 50.8 cm ID NUMBER PH.314640 CATALOG NUMBER 314640 ACCESSION NUMBER 208213


Continue reading The Metre – the repeating circle & triangulation
Posted on

Duck typing in python

When I see a bird that walks like a duck and swims like a duck and quacks like a duck I called that bird a duck

J. W. Riley

The Python code language is dynamically typed. In many languages (C++, Java) you do need to explicitly declare the types of variables. Python uses duck typing for all operations (function calls, method calls, and operators). You can treat an object as a duck. It raises a TypeError at runtime if an operation cannot be applied to an object because it is of an inappropriate type.

Posted on Leave a comment

The Earth’s seasons

The Earth’s seasons are caused by three factors:

  • The Earth orbits the Sun once a year in a nearly circular orbit.
  • The Earth’s axis of rotation (the straight line through the center of the Earth between the north and south poles) is not perpendicular to the plane of the Earth’s orbit. The Earth’s axis is tilted by about 23.4° from the the direction perpendiular to the orbital plane.
  • The orientation of the Earth’s axis in space remains nearly constant even as the Earth revolves around the Sun. It always points in the general direction of the star Polaris.
Sun track

sun track

The result is that when the Earth is on one side of its orbit, the south pole is tilted toward the Sun (by as much as 23.4°) and the southern hemisphere experiences summer. Six months later, when the Earth is on the opposite side of its orbit, the north pole is tilted toward the Sun (by as much as 23.4°) and the northern hemisphere experiences summer. (Views of the Sun’s illumination on the Earth on any date are available here.) What we see from our viewpoint in the Earth’s northern hemisphere is that the Sun’s apparent daily track across the sky is much higher (that is, more northerly) in summer, and lower (more southerly) in winter. From horizon to horizon, the Sun’s track is longer in summer and shorter in winter; so that in summer, sunrises are much earlier and sunsets are much later than in winter. See, for example, the graphic above, or this photograph of the Sun’s paths through the sky at different times of the year.

The great circle The great circle

So we are used to the fact that the length of daylight is significantly longer in summer than winter, and most of us know that the “longest day” (that is, the day when the Sun is above the horizon the longest) is the summer solstice, around June 21, when the Sun has reached its most northerly and longest track in our sky; and the “shortest day” is the winter solstice, around December 21, when the Sun has reached its most southerly and shortest track in our sky.

It would make sense, then, for the summer solstice to also be the date at which sunrise is earliest and sunset is latest; and for the winter solstice to be the date when sunrise is latest and sunset is earliest. However, that is not what happens! Nature sometimes defies our expectations.

The local meridian is a great circle passing through the celestial poles and through the zenith of an observer’s location on the planet. Image Credit: Daniel V. Schroeder

And that is because we have not talked about one other factor in sunrise and sunset times that is not at all obvious. It is that the Sun moves across the sky, in its apparent daily track, at slightly different rates at different parts of the year. Most of the Sun’s east-to-west apparent motion in the sky is caused, of course, by the rotation of the Earth, which is quite uniform (to milliseconds per day). But a small part of the Sun’s apparent daily motion depends on the position of the Earth in its orbit around the Sun. This component of the Sun’s apparent motion varies by a small amount over the course of a year due to the elliptical shape of the Earth’s orbit and to the tilt of the Earth’s axis.

Earth’s axial tilt

Earth’s axial tilt

Continue reading The Earth’s seasons

Posted on

Three types of hypotheses

* Simple hypothesis

* Complex hypothesis

* Null hypothesis

What is a hypothesis

A hypothesis states your predictions about what your research will find. It is a tentative answer to your research question that has not yet been tested. For some research projects, you might have to write several hypotheses that address different aspects of your research question.

A hypothesis is not just a guess — it should be based on existing theories and knowledge. It also has to be testable, which means you can support or refute it through scientific research methods (such as experiments, observations and statistical analysis of data).

Variables in hypotheses

Hypotheses propose a relationship between two or more variables. An independent variable is something the researcher changes or controls. A dependent variable is something the researcher observes and measures.

Daily apple consumption leads to fewer doctor’s visits.

In this example, the independent variable is apple consumption — the assumed cause. The dependent variable is the frequency of doctor’s visits — the assumed effect.

Three steps to hypothesis testing

  • State the null hypothesis and alternative hypothesis
  • Decide on test static and critical value
  • Compute p-value. If P-value is less than the critical value reject the null hypothesis and accept the alternative hypothesis

Simple hypothesis

Simple hypotheses are ones which give probabilities to potential observations. The contrast here is with complex hypotheses, also known as models, which are sets of simple hypotheses such that knowing that some member of the set is true (but not which) is insufficient to specify probabilities of data points.

Normal curve​
Simple hypothesis – Bell Curve

Complex hypothesis

Complex hypothesis is that one in which there are multiple dependent as well as independent variables. Example: Global warming causes icebergs to melt which in turn causes major changes in weather patterns.

Complex hypothesis
Complex hypothesis

Null hypothesis

A null hypothesis is a hypothesis that says there is no statistical significance between the two variables in the hypothesis. … For example, a null hypothesis would be something like this: There is no statistically significant relationship between the type of water I feed the flowers and growth of the flowers.

null hypothesis
Null hypothesis

Create a Null Hypothesis

Depending on your study, you may need to perform some statistical analysis on the data you collect. When forming your hypothesis statement using the scientific method, it’s important to know the difference between a null hypothesis vs. the alternative hypothesis, and how to create a null hypothesis. 

  • A null hypothesis, often denoted as H0, posits that there is no apparent difference or that there is no evidence to support a difference. Using the motivation example above, the null hypothesis would be that sleep hours have no effect on motivation.
  • An alternative hypothesis, often denoted as H1, states that there is a statistically significant difference, or there is evidence to support such a difference. Going back to the same carrot example, the alternative hypothesis is that a person getting six hours of sleep has less motivation than someone getting eight hours of sleep.
Posted on

Three types of Breathing

Change Your Breath, Change Your Life | Lucas Rockwood | TEDxBarcelona
Change Your Breath, Change Your Life | Lucas Rockwood | TEDxBarcelona

We do it as long as we live but mostly aren’t aware
of it: breathing. In his talk Lucas breaks down the
fundamentals of yoga breathing in a way that you
can easily remember and apply to your practice.
Lucas shows us how three breathing practices
water, whiskey, or coffee – can be used as a tool and help us to overcome any situation.

With a formal yoga training background in Hot
Yoga, Ashtanga Yoga, Gravity Yoga, and the Yoga
Trapeze®, Lucas has studied with some of the
most well-respected teachers on the planet. His
most influential teachers (all of whom he studied
with personally) include Sri K. Pattabhi Jois, Paul
Dallaghan, Alex Medin, Gabriel Cousens MD, and
SN Goenka.

Lucas founded Absolute Yoga Academy in 2006,
one of the top 10 yoga teacher training schools in
the world with 2,000 certified teachers (and
counting) and courses in Thailand, Holland, the
United Kingdom, and the Philippines.

In 2013, Lucas founded YOGABODY Fitness, a
revolutionary new yoga studio business model
that pays teachers a living wage and demystifies
yoga by making the mind-body healing benefits of
the practice accessible to everyone.

In search of nutritional products designed
specifically for achy yoga students’ bodies, Lucas
worked with senior nutritional formulator Paul
Gaylon and founded YOGABODY Naturals in the
back of his yoga studio a year later. The company
has gone from strength to strength and is now a
world-renowned nutrition, education, and
publishing organization serving 81 countries.

A foodie at heart, Lucas was a vegan chef and
owned and operated health food restaurants prior
to diving deep into the yoga world. He is also a
highly acclaimed writer, radio show host, TV
personality, business consultant, weight loss
expert, and health coach. This talk was given at a
TEDx event using the TED conference format but
independently organized by a local community.

Change Your Breath, Change Your Life | Lucas
Rockwood | TEDxBarcelona

Learn more at https://www.ted.com/tedx

Posted on

Cognitive Ease

Cognitive ease or fluency is the measure of how easy it is for our brains to process information. … The Cognitive ease principle reveals that when people have to switch to the second system of thinking, causing cognitive strain, they become more vigilant and suspicious.

Frequent repetition can be enough to convince people to believe things that are not true because familiarity generates a sense of cognitive ease. Called the mere-exposure effect, advertisers make use of it, but they aren’t the only ones. Information that is easy to understand also gives us a sense of cognitive ease.

Humans tend to avoid stressful and demanding cognitive strain, often making them vulnerable to many biases. This “laziness” and desire for cognitive ease often invites individuals to a world of irrationality where the decisions made can be detrimental.

Cognitive Ease – Veritasium
Posted on

Cantor’s threefold division of infinity

Excerpts from Infinity and the Mind

Rudy Rucker
Infinity and the mind by Rudy Rucker
Infinity and the Mind

… This threefold division [of infinity] is due to Cantor, who, in the following passage, distinguishes between the:

  • Absolute Infinite
  • Physical infinities
  • Mathematical infinities

The actual infinite arises in three contexts: first when it is realized in the most complete form, in a fully indepen dent other-worldly being, in Deo, where I call it the Absolute Infinite or simply Absolute; second when it occurs in the contingent, created world; third when the mind grasps it in abstracto as a mathematical magnitude, number, or order type. I wish to make a sharp contrast between the Absolute and what I call the Transfinite, that is, the actual infinities of the last two sorts, which are clearly limited, subject to further increase, and thus related to the finite,

PHYSICAL INFINITIES

There are three ways in which our world appears to be un bounded and thus, perhaps, infinite. It seems that time cannot end. It seems that space cannot end. And it seems that any interval of space or time can be divided and subdivided endlessly. We will consider these three apparent physical infinities in three subsections.

Temporal Infinities

One of the chief consequences of Einstein’s Special Theory of Relativity is that it is space-time that is fundamental, not isolated space which evolves as time passes. I will not argue this point in detail here, but let me repeat that on the basis of modern physical theory we have every reason to think of the passage of time as an illusion. Past, present, and future all exist together in space-time.

So the question of the infinitude of time is not one that is to be dodged by denying that time can be treated as a fixed dimension such as space. The question still remains: is time infinite? If we take the entire space-time of our universe, is the time dimension infinitely extended or not?

Möbius strip ​
Möbius strip

Spatial Infinities

Whether or not our space is actually infinite is a question that could conceivably be resolved in the next few decades. Assuming that Einstein’s theory of gravitation is correct, there are basically two types of universe: i) a hyperspherical (closed and
unbounded) space that expands, and then contracts back to a point; ii) an infinite space that expands forever. It is my guess that case i) will come to be most widely accepted, if only because the notion of an actually infinite space extending out in every direction is so unsettling.

The fate of the universe in case i) is certainly more interesting, since such a universe collapses back to an infinitely dense space-time singularity that may serve as the seed for a whole new universe. In case il), on the other hand, we simply have cooling and dying suns drifting further and further apart in an utterly empty black immensity … and in the end there are only ashes and cinders in an absolute and eternal night.

The question we are concerned with here is whether or not space is infinitely large. There seem to be three options: i) There is some level n for which -dimensional space is real and infinitely extended. The situation where our three-dimensional space is infinitely large falls under this case. ii). There is some n such that there is only one n-dimensional space. This space is to be finite and unbounded, and there is to be no reality to n + 1 dimensional space.

The situation where our three-dimensional space is finite and unbounded, and the reality of four-dimensional space denied, falls under this case. iii). There are real spaces of every dimension, and each of these spaces is finite and unbounded. In this case we either have an infinite number of universes, duoverses, triverses, etc., or we reach a level after which there is only one n-verse for each n.

Read more in his book Infinity and the Mind

Posted on Leave a comment

Three geometries – Euclidean, Hyperbolic, Elliptical

Three geometries - Euclidean, Hyperbolic, Elliptical
Three geometries – Euclidean, Hyperbolic, Elliptical

There are precisely three different classes of three-dimensional constant-curvature geometry: Euclidean, hyperbolic and elliptic geometry. The three geometries are all built on the same first four axioms, but each has a unique version of the fifth axiom, also known as the parallel postulate. The 1868 Essay on an Interpretation of Non-Euclidean Geometry by Eugenio Beltrami (1835 – 1900) proved the logical consistency of the two Non-Euclidean geometries, hyperbolic and elliptical.

The parallel postulate is as follows for the corresponding geometries.

Euclidean geometry: Playfair’s version: “Given a line l and a point P not on l, there exists a unique line m through P that is parallel to l.” Euclid’s version: “Suppose that a line l meets two other lines m and nso that the sum of the interior angles on one side of lis less than 180°. Then m and n intersect in a point on that side of l.” These two versions are equivalent; though Playfair’s may be easier to conceive, Euclid’s is often useful for proofs.

Hyperbolic geometry: Given an arbitrary infinite line l and any point P not on l, there exist two or more distinct lines which pass through P and are parallel to l.

Elliptic geometry: Given an arbitrary infinite line land any point P not on l, there does not exist a line which passes through P and is parallel to l.

Source and more info: https://en.m.wikibooks.org/wiki/Geometry/Hyperbolic_and_Elliptic_Geometry

Posted on Leave a comment

Trifid Nebula

Trifid Nebula

In the Center of the Trifid Nebula Image Credit: Subaru Telescope (NAOJ), Hubble Space Telescope, Martin Pugh; Processing: Robert Gendler

What’s happening at the center of the Trifid Nebula? Three prominent dust lanes that give the Trifid its name all come together. Mountains of opaque dust appear near the bottom, while other dark filaments of dust are visible threaded throughout the nebula. A single massive star visible near the center causes much of the Trifid’s glow. The Trifid, cataloged as M20, is only about 300,000 years old, making it among the youngest emission nebulas known. The star forming nebula lies about 9,000 light years away toward the constellation of the Archer (Sagittarius). The region pictured here spans about 10 light years. The featured image is a composite with luminance taken from an image by the 8.2-m ground-based Subaru Telescope, detail provided by the 2.4-m orbiting Hubble Space Telescope, color data provided by Martin Pugh and image

Trifid Nebula