LUCK Control

Leave a comment

This collection of links and information may help you move from allowing luck to direct many of your life events. To controlling random events to achieve your goals and obtaining more success in your life. This is by no means a tutorial for being successful.  It is a collection of thoughts about luck and the control we have over it.  It is for you to explore these thoughts, and others, to find your own path to success.  It can be done; and not that difficult for most.

First we look at randomness.  Then we realize that raw randomness is not that common, and extremely difficult to achieve intentionally.  There are numerous forces that create cycles and biases which direct the random behaviors into predictable consequences.  Some of these are easily recognized, such as weather, seasons, gravity, …  others are less obvious.  It is in the recognition of, and the syncing with, these forces that will give you a reasonable amount of control over the events of your life.

We look at probability to determine the likely-hood of a particular event happening or not.  The calculations are not always intuitive, but can be very helpful in analyzing the situation.  In the Monty-Hall problem even some professional mathematicians got it wrong.  That problem is perfect for our study, it is very much counterintuitive.

Next we look at your state of mind and body required to manipulate forces to obtain the desired conclusion.  Many manipulation interventions requires skill, talent, muscle control, emotional stability, experience, self assurance, patience, maturity, unobstructed thought processes, … random luck may still play a part, but the objective is to reduce dependance upon it as much as possible.  You must think beyond the personal effects of the manipulation and account, with empathy, for everything else.  You must realize the privilege of your life, and behave without taking unfair advantage.  Taking candy from a baby is no accomplishment. You must recognize an opportunity and prepare yourself for capitalizing on them. Basically, you position yourself in the path of good luck and out of the way of bad luck.

Uncertainty will always exist and must be permitted and even encouraged.  Any worthwhile development is an iterative process.  You try something, evaluate its effectiveness, modify the manipulation, and try again.  Failures are permitted, encouraged, expected, and embraced for their educational value.  The best solution is rarely the initial attempt.  You learn by making mistakes.  Rapid prototyping is often required.

You are then ready to take the gamble, where you risk something of value, in order to potentially achieve something of more value.  Timing may be an important element in your plan.  Almost all actions, physical or otherwise, carry a degree of a gamble.  You decide to act based upon your assessment of the risk and the reward.  Usually it is a question of trade-offs.  You can’t have the best of all dimensions.  “maximize the positives, eliminate the negatives, and don’t mess with Mr. in-between.”

Now comes the magic.  From the earliest of times, people have attempted to influence or anticipate future events based upon magical manipulations and understandings.  Prediction of the future is perhaps the most basic of human activities.  What will happen next? Modern science follows from these early efforts.  Science is like magic, only real!

Determining when success has been achieved is perhaps the most difficult task.  Goals achieved commonly carry a bittersweet aspect.  Success is not an either/or situation, it is measured by degrees. What opportunities were missed in order to reach a goal?  Was it worth the sacrifices; who got hurt; how do you measure; is this the completion of a single iteration of many?  Is this success sustainable and survivable?  What was lost in the process?  Many of these questions are not answerable until considerable time has passed. Unfortunately the answer will depend upon your individual (selfish) perspective. Be aware of the choices you make.

Now it is time for you to explore the related topics, at your leisure.

CONTENTS

Luck

Chance

Randomness

Random Number Generator

Probability

Monty Hall Problem

Cell Growth

Confidence 

Self Control

Empathy

Privilege

Opportunism

Uncertainty

Gambling

Lottery

Magic

Success

Loss Function

Victory

Survival

Performance

Infinity & Beyond

The format of this collection is as follows:

A general topic is identified

A brief definition of the topic is provided

A hyperlink is provided, by clicking on a picture or word, to a wikipedia article about the topic

A table of contents of the wikipedia article is provided

The intent is that you will learn using a self directed approach.  You are encouraged and enabled to ‘drill down’ into a topic until you have satisfied or exhausted your curiosity.  The material is not intended to be consumed sequentially or in any prescribed order.  You are in control, and can jump around as you wish.  Your needs and passions are for you to determine. This approach should serve the mature student very well.

Lucky – Beinging aware of something nice happening, to you; which you didn’t earn.  

You did nothing – something nice happened – you are lucky – no skill required – wishes – will

To gain success or something desirable by chance

1. The chance happening of fortunate or adverse events; fortune

2. Good fortune or prosperity; success

3. One’s personal fate or lot

  • Etymology and definition
    Lack of control
    Fallacy
    Essence
    Self-fulfilling prophecy
    Social aspects
    Games
    Lotteries
    Means of resolving issues
    Numerology
    Science
    In religion and mythology
    Buddhism
    Christianity and Judaism
    Hinduism
    Islam
    Belief measurement
    See also
    Bibliography
    References
    External links

Chance – random likely-hood of something happening – randomness

1.

a. The unknown and unpredictable element in happenings that seems to have no assignable cause.

b. A force assumed to cause events that cannot be foreseen or controlled; luck: Chance will determine the outcome.

2. often chances The likelihood of something happening; possibility or probability: Chances are good that you will win. Is there any chance of rain?

3. An accidental or unpredictable event: “He sprang to his feet and turned to run. At the same moment by a lucky chance the moon broke through the clouds” (Arthur Conan Doyle).

4. A favorable set of circumstances; an opportunity: a chance to escape.

5. A risk or hazard; a gamble: took a chance that the ice would hold me.

6. Games A raffle or lottery ticket.

7. Baseball An opportunity to make a putout or an assist that counts as an error if unsuccessful.

  • Definition
    Discrete probability distribution
    Example
    Continuous probability distribution
    Relationship between the likelihood and probability density functions
    In general
    Likelihoods for mixed continuous–discrete distributions
    Regularity conditions
    Likelihood ratio and relative likelihood
    Likelihood ratio
    Relative likelihood function
    Likelihood region
    Likelihoods that eliminate nuisance parameters
    Profile likelihood
    Conditional likelihood
    Marginal likelihood
    Partial likelihood
    Products of likelihoods
    Log-likelihood
    Graph
    Likelihood equations
    Exponential families
    Example: the gamma distribution
    Background and interpretation
    Historical remarks
    Interpretations under different foundations
    Frequentist interpretation
    Bayesian interpretation
    Likelihoodist interpretation
    AIC-based interpretation
    See also
    Notes
    References
    Further reading
    External links
  • Randomness

Whats going to happen next?

  • History
  • In science
  •           In the physical sciences
               In biology
               In mathematics
               In statistics
               In information science
               In finance
               In politics
            Randomness and religion
            Applications
            Generation
            Measures and tests
    Misconceptions and logical fallacies
    Fallacy: a number is “due”
            Fallacy: a number is “cursed” or “blessed”
            Fallacy: odds are never dynamic
    See also
    Notes
    References
    Further reading
    External links

Random Number Generator

It is VERY difficult to produce a true Random Number Generator

Patterns creep in. The recognition of these patterns will lead you to success.

  • Practical applications and uses
    “True” vs. pseudo-random number
    • Physical methods
      Computational methods
      By humans
    • Post-processing and statistical checks
      • Other considerations
        Reshaping the distribution
        Uniform distributions
        Other distributions
        Whitening
      • Low-discrepancy sequences as an alternative
        Activities and demonstrations
        Backdoors
        See also
        References
        Further reading
        External links

Probability – the statistical prediction of an events happening

1. the condition of being probable

2. an event or other thing that is probable

3. (Statistics) statistics a measure or estimate of the degree of confidence one may have in the occurrence of an event, measured on a scale from zero (impossibility) to one (certainty). It may be defined as the proportion of favorable outcomes to the total number of possibilities if these are indifferent (mathematical probability), or the proportion observed in a sample (empirical probability), or the limit of this as the sample size tends to infinity (relative frequency), or by more subjective criteria (subjective probability)

  • Interpretations
    Etymology
    History
    Theory
    Applications
    Mathematical treatment
    Independent events
    Mutually exclusive events
    Not mutually exclusive events
    Conditional probability
    Reverse probability
    Summary of probabilities
    Relation to randomness and probability in quantum mechanics
    See also
    Notes
    References
    Bibliography
    External links
Monty Hall Problem

Another way of thinking about it

  • Paradox
    Standard assumptions
    Simple solutions
    Vos Savant and the media furor
    Confusion and criticism
    Sources of confusion
    Criticism of the simple solutions
    Solutions using conditional probability and other solutions
    Refining the simple solution
    Conditional probability by direct calculation
    Bayes’ theorem
    Strategic dominance solution
    Solutions by simulation
    Variants
    Other host behaviors
    N doors
    Quantum version
    History
    See also
    Similar puzzles in probability and decision theory
    References
    Bibliography
    Further reading
    External links
Call Growth

Natural growth is the result of random behaviors encouraged in beneficial directions.

  • Mechanisms of cell growth control
    Cell growth regulation in animals
    Cell populations
    Cell size
    Yeast cell size regulation
    Linking Cdr2 to Wee1
    Cell polarity factors
    Other experimental systems for the study of cell size Regulation
    Cell division
    Comparison of the three types of cell division
    Sexual reproduction
    Disorders
    Measurement methods
    See also
    References
    Books
    External links

Confidence – pretty sure

1.

a. A belief or conviction that an outcome will be favorable

b. Belief in the certainty of something

2. Belief in the effectiveness of one’s own abilities or in one’s favorable acceptance by others; self-confidence.

3. Trust or faith in a person or thing:

4. A trusting relationship: 

5.

  1. That which is confided; a secret
  2. A feeling of assurance that a confidant will keep a secret
  • History
    Theories and correlations with other variables and factors
    Self-confidence as an intra-psychological variable
    Relationship to social influences
    Variation in different categorical groups
    Children
    Students
    Men versus women
    Stereotype threat
    Self-confidence in different cultures
    Athletes
    Measures
    Wheel of Wellness
    Implicit vs. explicit
    Extent
    Lack of self-confidence
    Confidence bias
    See also
    References
Self Control
  • As a virtue
    Research
    Counteractive
    Satiation
    Construal levels
    Human and non-human
    Alternatives
    Skinner’s survey of techniques
    Physical restraint and physical aid
    Changing the stimulus
    Depriving and satiating
    Manipulating emotional conditions
    Using aversive stimulation
    Drugs
    Operant conditioning
    Punishment
    “Doing something else”
    Brain regions involved
    Prefrontal cortex
    Outcomes as determining whether a choice is made
    Physiology of behavior
    “The Marshmallow Test”
    Ego depletion
    See also
    References
    Further reading
    External links
Empathy
  • Etymology
    Definitions
    General
    Distinctions between empathy and related concepts
    Classification
    Development
    Evolution across species
    Ontogenetic development
    Individual differences
    Sex differences
    Environmental influences
    Empathic anger and distress
    Anger
    Distress
    Influence on helping behavior
    Genetics
    General
    Neuroscientific basis of empathy
    Impairment
    Autism
    Psychopathy
    Other conditions
    In educational contexts
    In intercultural contexts
    Practical issues
    Benefits of empathizing
    Empathic inaccuracy
    Problems created by too much empathy and empathic bias
    Empathy and power
    Empathic distress fatigue
    Disciplinary approaches
    Philosophy
    Ethics
    Phenomenology
    History
    Psychotherapy
    Business and management
    Evolution of cooperation
    Measurement
    Self-report measures
    International comparison of country-wide empathy
    Other animals and empathy between species
    In fiction
    See also
    References
    Further reading
    External links
Privilege
  • Extent
    Access to the Sovereign
    Scandalum magnatum
    Trial by peers
    Freedom from arrest
    Privilege myths
    See also
    Notes and references
    Further reading
Opportunist
  • Definitions
    Etymology
    Moral connotations
    Human behaviour
    Eight main contexts
    Five main organizational influences
    Use of the term in specific areas
    Professional
    Intellectual
    Sexual
    Evolutionary
    Biological
    Political
    Economic
    Game theory
    Social
    Marxist theory
    Legal
    Spiritual
    See also
    References

Certainty/Un – willing to bet – with little doubt – measure of degree – percentage

1. The condition of being uncertain; doubt.

2. Something uncertain: the uncertainties of modern life.

3. Statistics The estimated amount or percentage by which an estimated or calculated value may differ from the true value.

  • Concepts
    Uncertainty
    Uncertainty versus variability
    Knightian uncertainty
    Unreferenced original research
    In measurements
    In the media
    Applications
    Philosophy
    Artificial intelligence
    See also
    References
    Further reading
    External links

Gambling– risking something to achieve gain

1. A bet, wager, or other gambling venture.

2. An act or undertaking of uncertain outcome; a risk: I took a gamble that stock prices would rise.

  • History
    Great Britain
    United States
    Regulation
    Insurance
    Asset recovery
    Religious views
    Buddhism
    Hinduism
    Judaism
    Christianity
    Catholicism
    Protestantism
    Other Christian denominations
    Islam
    Bahá’í Faith
    Types
    Casino games
    Table games
    Electronic gambling
    Other gambling
    Non-casino games
    Fixed-odds betting
    Parimutuel betting
    Sports betting
    Virtual sports
    Arbitrage betting
    Other types of betting
    Staking systems
    Other uses of the term
    Negative consequences
    Psychological biases
    See also
    References
    Further reading
    External links
Lottery

More like a equal-percentage wager

the best bet for a poor gambler?

  • Classical history
    Medieval history
    Early modern history
    France, 1539–1789
    England, 1566–1826
    British North America 1612–1783
    German-speaking countries
    Spain, 1763
    Ticket gallery
    Mathematical analysis
    Probability of winning
    Scams and frauds
    Payment of prizes
    Outcomes for big winners
    See also
    References
    Further reading
    External links

Magic– remember that you are constantly being fooled

1.

a. The art or practice of using charms, spells, or rituals to attempt to produce supernatural effects or control events in nature.

b. The charms, spells, and rituals so used.

2. The exercise of sleight of hand or conjuring, as in making something seem to disappear, for entertainment.

3. A mysterious quality of enchantment

  • Etymology
    White, gray and black
    High and low
    History
    Witchcraft
  •   Magicians
    See also
    References

    Further reading
    External links

SuccessHappy Ending Performance – Satisfied wish

1. The achievement of something desired, planned, or attempted: attributed their success in business to hard work.

2.

a. The gaining of fame or prosperity: an artist spoiled by success.

b. The extent of such gain.

3. One that is successful: The plan was a success.

  • In American culture
    In biology
    In education
    In business and leadership
    In philosophy of science
    In probability
    See also
    References
    Sources
    Further reading
Loss Function
  • Examples
    Regret
    Quadratic loss function
    0-1 loss function
    Constructing loss and objective functions
    Expected loss
    Statistics
    Frequentist expected loss
    Bayesian expected loss
    Examples in statistics
    Economic choice under uncertainty
    Decision rules
    Selecting a loss function
    See also
    References
    Further reading
Victory
  • The universal sign for victory
    Religion
    See also
    References
    External links
Survival Analysis
  • Introduction to survival analysis
    Definitions of common terms in survival analysis
    Example: Acute myelogenous leukemia survival data
    Kaplan–Meier plot for the aml data
    Life table for the aml data
    Log-rank test: Testing for differences in survival in the aml data
    Cox proportional hazards (PH) regression analysis
    Example: Cox proportional hazards regression analysis for melanoma
    Cox model using a covariate in the melanoma data
    Extensions to Cox models
    Tree-structured survival models
    Example survival tree analysis
    Survival random forests
    Deep Learning survival models
    General formulation
    Survival function
    Lifetime distribution function and event density
    Hazard function and cumulative hazard function
    Quantities derived from the survival distribution
    Censoring
    Fitting parameters to data
    Non-parametric estimation
    Computer software for survival analysis
    Distributions used in survival analysis
    Applications
    See also
    References
    Further reading
    External links
Performance Indicator
  • Categorization of indicators
    Points of measurement
    Identifying indicators
    Examples
    Accounts
    Marketing and sales
    Manufacturing
    Professional services
    System operations
    Project execution
    Supply chain management
    Government
    Further performance indicators
    Problems
    See also
    References
    Further reading
Infinity & Beyond
  • History
    Early Greek
    Zeno: Achilles and the tortoise
    Early Indian
    17th century
    Mathematics
    Symbol
    Calculus
    Real analysis
    Complex analysis
    Nonstandard analysis
    Set theory
    Cardinality of the continuum
    Geometry
    Infinite dimension
    Fractals
    Mathematics without infinity
    Physics
    Cosmology
    Logic
    Computing
    Arts, games, and cognitive sciences
    See also
    References
    Bibliography
    Sources
    External links

Making Magic Squares

Leave a comment

I carry, attached to my keys, a Magic Square; the original can be found displayed on the Sagrada Familia Basilica in Barcelona Spain.  See: a later post titled “Sagrada Familia, Barcelona” for further speculation about this particular Magic Square:

MagicSquare2

This square is considered magic because adding each row, or each column, or either diagonal, or other groups of 4 numbers yield the same sum.

Here is how you can use a spreadsheet to create a Magic Square.

As with all spreadsheets; the Columns are A, B, C, D, & E and the Rows 1, 2, 3, 4, & 5.    Now; we enter values and perform calculations in your Spreadsheet:

You may enter any values you wish into the cells in the first row; A1, B1, C1, and D1.

Then enter the following formulas into your spreadsheet:

E1 = A1+B1+C1+D1

A2 = C1-2,  B2 = D1+2,  C2 = A1-2,  D2 = B1+2,  E2 = A2+B2+C2+D2

A3 = D1+1,  B3 = C1+1,  C3 = B1-1,  D3 = A1-1,  E3 = A3+B3+C3+D3

A4 = B1+1,  B4 = A1-3,  C4 = D1+3,  D4 = C1-1,  E4 = A4+B4+C4+D4

A5 = A1+A2+A3+A4,  B5 = B1+B2+B3+B4,  C5 = C1+C2+C3+C4

D5 = D1+D2+D3+D4, and E5 = A1+B2+C3+D4

If you wish, the cells in the 1st row can contain your birthday and another number.

For Example: Here is a Magic Square using the birthdate of September 29, 2008 and 0:

MagicSquare2

Try it with some birthdates!  Then ponder how it all works.

Now try entering other numbers, like zeros and negatives into A1, B1, C1 and D1.  Maybe it will be clearer now how it all works.

There is more information about Magic Squares HERE. You may notice that the Wikipedia article contains a ‘Birthday Magic Square’ which is very similar to your spreadsheet.  It uses the date convention of Day/Month/Year and it contains the Century value, yet it is using basically the same method of construction as your spreadsheet.

Incidentally; if your birthday is 5/4/8 (May 4, 2008), you may have noticed that South American relatives send their birthday wishes a month early on April 5th.  A reason for this can be found HERE, A very confusing lack of standards, which has led to many misunderstandings!

HERE is a web site that presents a Mind Reading trick using Magic Squares.

 

 

Magic Cards, Explained

Leave a comment

I found the Binary Notation connection to this card trick very interesting.  I was struck by the educational possibilities for people who have had an introduction to Number Theory, but needing a practical application to make sense of it.  Young people of the age of ‘formal thought’ are attracted to magic and the challenge of ‘how it is done’ understanding. I put together this brief explanation of the math involved in creating this card trick.

To see the trick and my explanation click here:

I wanted to use my new laser cutter, so I made boxes to serve the same function as the cards above:

Each box contains the appropriate number of beads (0,1,2,4,8,16, or 32). The subject chooses a secret number, then empties the box(s) containing that number on its face, counts the beads, and amazingly they add to the secret number!

Here is a little aside video of an analog computer doing arithmetic in Binary …

So you want more…..

THE MAGIC CUBE TRICK:

To amaze your friends:

State that you will discover the month of their birth, as well as the day.

Show the Magic Cube, and ask if the number of their birth month (1 – 12) is on any of the 4 side panels.

If they report “YES” (selected), you add all the numbers in the upper left corners of each selected panel to get a total count.

Continue for the other 3 side panels.

The sum of numbers in the upper left corner of the YES panels, is the number of their birth month.

Next; 

Reset the total count to Zero.

Repeat the above process for the day value (1 – 31).  This time using the 4 side panels AND the bottom panel.

The sum of numbers in the upper left corner of the “YES” (selected) panels, is the number of their birth day.

How does it work?  

Click on the “Magic Cards” link above, which describes the same trick, in a playing card format.

To make your own “Magic Cube”:

Goto Thingiverse.com, search for GeeEaZy, select “Magic Cube” and download the “STL” file; permitting you to 3D print your own Magic Cube.  You may want to scale for readability

I think that this small piece of code has vast applications, requiring only minor modifications to make it suitable for many uses:

Think about a McDonalds counter; where virtual tiles with pictures of French fries, soda, …; pressing initiates price calculation applications, plus cooking room order applications, plus inventory control applications, plus … all made possible because little training is required to obtain accurate ordering information,

Even another variation … :

The following is a “work in progress” … – … my effort is complete and correct – while WordPress needs to remove its JavaScript content filtering / sanitization system (KSES) to enable my code. oh well! I am very disappointed that this version didn’t work – it was to be my grand finally.

You can Identify the Tiles containing the NUMBER of your Birth MONTH by CLICKING on the TILE(s):

// data about data – special characters Image Value Selector
    These are the valid Month Numbers
  1. January
  2. February
  3. March
  4. April
  5. May
  6. June
  7. July
  8. August
  9. September
  10. October
  11. November
  12. December
… This is your Birth Month: …

Now; you can Identify the Tiles containing your Birth DAY by CLICKING on the TILE(s):

… This is your Birth Day: …

Now; … I have magically (using binary math knowledge) determine your Birth Month: …

and your Birth Day: …

THANK YOU

And now for one LAST variation …

This version benefits from the fact that all the magic is done by the tiles, with help from the participant. No involvement from the performer. The participant selects the tiles containing their secret number – turns them over and adds the numbers on the back sides – and magically they add to the secret number!

Aside: the best card trick I’ve seen in a long time …

and Thanks to:

“profhankd” for the hinged box design, and to 

“Zagatorz” for guiding me to a cube presentation of an old card trick.

and to the wonderful binary counting device: “Turing Tumbler”

and to the unnamed inventor of the Magic Card trick available at most magic stores

SO … HERE’S THE DEAL …

I’m tired of working on this.

The problem is: That the last incarnation of this trick, required actual coding beyond my comfort zone

I never wanted to code in HTML/CSS/JavaScript on the WordPress platform in the first place!

So … everything is pretty much working … except …

In edit mode, using preview, += works fine … while after publishing it is treated as a =, and gives only the add-on value.

Like in:  sum += add-on; OR sum = sum + add-on; OR old = sum;    sum = old + add-on;

And … there are scripting problems, that I would learn to live with.

So … here’s the code – put it into your WordPress creation – solve my problems and clean up my mess,

AND

turns out that WordPress does not allow the kind of code that I am trying to use

so … until I find a new way to do things … this is it. Enjoy what I have!

HERE’S the HTML/CSS/JS code:

<!DOCTYPE html>

<!–       HTML code.  —

<html lang=”en”>

<body>

  <meta charset=”UTF-8″>  // data about data – special characters 

  <title>Image Value Selector</title>

<!– Ordered List –>

<ol id=”numberList”>

These are the valid Month Numbers

  <li>January</li>

  <li>February</li>

  <li>March</li>

  <li>April</li>

  <li>May</li>

  <li>June</li>

  <li>July</li>

  <li>August</li>

  <li>September</li>

  <li>October</li>

  <li>November</li>

  <li>December</li>

</ol>

<div id=”image-container”>

<label class=”selectable-image”>

<input type=”checkbox” name=”selected-image”>

<img src=”https://jorgezimmerman.org/wp-content/uploads/2025/07/box8.jpeg&#8221; height=”50″ width=”50″ data-value=”8″ data-id=”4″ id=”4″ label:’8′ alt=”8″ value=”8″ class=”selectable-image”>

</label>

<label class=”selectable-image”>

<input type=”checkbox” name=”selected-image”>

<img src=”https://jorgezimmerman.org/wp-content/uploads/2025/07/box4.jpeg&#8221; height=”50″ width=”50″ data-value=”4″ data-id=”3″ id=”3″ label:’4′ alt=”4″ value=”4″ class=”selectable-image”>

</label>

<label class=”selectable-image”>

<input type=”checkbox” name=”selected-image”>

<img src=”https://jorgezimmerman.org/wp-content/uploads/2025/07/box2.jpeg&#8221; height=”50″ width=”50″ data-value=”2″ data-id=”2″ id=”2″ label:’2′ alt=”2″ value=”2″ class=”selectable-image”>

</label>

<label class=”selectable-image”>

<input type=”checkbox” name=”selected-image”>

<img src=”https://jorgezimmerman.org/wp-content/uploads/2025/07/box1.jpeg&#8221; height=”50″ width=”50″ data-value=”1″ data-id=”1″ id=”1″ label:’1′ alt=”1″ value=”1″ class=”selectable-image”>

</label>

</div>

<style>

    .image-container {  // CSS properties for image display 

      display: flex;    // flexible box layout

      gap: 20px;        // creates spaces between items 

      margin-bottom: 20px;

    }

    .image-box {                   // imbed image – but not insert into web page  

      border: 2px solid #FBEC5D;   // element border of solid style, 2px wide, light gray  

      padding: 10px;               // right border only 

      text-align: center;

    }

.image-selector {         // CSS class attribute  

display: inline-block;    // CSS property value combines characteristics of both inline and block elements   

margin: 5px;

cursor: pointer;          // visual appearance of the mouse cursor when hovering  

}

.image-selector img {     // descendant of element with class .image-selector  

border: 2px solid transparent;

width: 60px;

transition: border 0.2s;

}

.image-selector input[type=”checkbox”]:checked + img {

border: 4px solid #0073e6;  // blue 

}

<!–  #image-container {

    display: flex;

    gap: 20px;

  }

–>

  .selectable-image {

    width: 75px;

    height: auto;

    cursor: pointer;

    border: 3px solid transparent;

    transition: border-color 0.3s ease;

    user-select: none;

  }

  .selectable-image.selected {

    border-color: #0073aa; /* WordPress blue */

  }

</style>

<!–      JavaScript code      –>

<script>

  document.addEventListener(‘DOMContentLoaded’, () => {

    const images = document.querySelectorAll(‘.selectable-image’);

    var sumDisplay = document.getElementById(‘sum’);

    function updateSum() {

      var sum = 0;

      var old = 0;

      images.forEach(img => {

        if (img.classList.contains(‘selected’)) {      

                   old = sum;

                    sum = old + Number(img.getAttribute(‘data-value’));

                    itemNumber = sum – 1;

    // Get all list items

      var items = document.querySelectorAll(‘#numberList li’);

    // Get the text of the specified item

      var selectedText = items[itemNumber].textContent;

      document.getElementById(‘displayItem’).textContent = 

      “The Birth Month ” + (itemNumber + 1) + ” is: ” + selectedText;

        }

      });

    }

    images.forEach(img => {

      img.addEventListener(‘click’, () => {

        img.classList.toggle(‘selected’);

        updateSum();

      });

    });

  });

</script>

This is your Birth Month:

<!– Display Area –>

<p id=”displayItem”></p>

</body>

</html>

Next, you will find one of the first of many discussions that I had with ChatGPT.

I enjoyed our collaboration – it started a lot of lines-of-thought and ChatGPT explained it’s thinking very well. I look forward to working on many more projects with “Chat”.

CODE:

### **Overview**

You want to:

1. Display five pictures on your WordPress site.

2. Let users select any number of them (like checkboxes or clickable images).

3. When the user is done, perform different mathematical operations depending on which pictures were selected.

### **How to Approach This**

#### **1. Displaying Selectable Pictures**

You can use HTML and JavaScript for this. Each image can be clickable, toggling its “selected” state.

#### **2. Detecting Selections**

You’ll need JavaScript to keep track of which images are selected.

#### **3. Performing Calculations**

When the user submits (or clicks a button), your JavaScript code checks which images are selected and runs the appropriate math.

### **Example Code**

You can add this code to your WordPress site using a Custom HTML block (for the HTML) and a plugin like “Insert Headers and Footers” or your theme’s custom JS area (for the JavaScript).

#### **HTML (put in a Custom HTML block):**

“`html

<div id=”picture-selector”>

 <img src=”URL1.jpg” class=”selectable-pic” data-value=”1″ alt=”Pic 1″>

 <img src=”URL2.jpg” class=”selectable-pic” data-value=”2″ alt=”Pic 2″>

 <img src=”URL3.jpg” class=”selectable-pic” data-value=”3″ alt=”Pic 3″>

 <img src=”URL4.jpg” class=”selectable-pic” data-value=”4″ alt=”Pic 4″>

 <img src=”URL5.jpg” class=”selectable-pic” data-value=”5″ alt=”Pic 5″>

</div>

<button id=”calculate-btn”>Calculate</button>

<div id=”result”></div>

“`

*Replace `URL1.jpg` etc. with your actual image URLs.*

#### **CSS (optional, for highlighting selection):**

“`html

<style>

.selectable-pic {

 border: 2px solid transparent;

 width: 100px;

 margin: 5px;

 cursor: pointer;

 transition: border 0.2s;

}

.selectable-pic.selected {

 border: 2px solid #0073aa;

}

</style>

“`

#### **JavaScript (put in your custom JS area):**

“`javascript

document.addEventListener(‘DOMContentLoaded’, function() {

 const pics = document.querySelectorAll(‘.selectable-pic’);

 pics.forEach(pic => {

   pic.addEventListener(‘click’, function() {

     pic.classList.toggle(‘selected’);

   });

 });

 document.getElementById(‘calculate-btn’).addEventListener(‘click’, function() {

   const selected = Array.from(document.querySelectorAll(‘.selectable-pic.selected’));

   const values = selected.map(img => parseInt(img.getAttribute(‘data-value’)));

   // Example: Different operations based on selection

   let result;

   if (values.length === 0) {

     result = “Please select at least one picture.”;

   } else if (values.length === 1) {

     result = “Square: ” + (values[0] ** 2);

   } else if (values.length === 2) {

     result = “Sum: ” + (values[0] + values[1]);

   } else if (values.length === 3) {

     result = “Product: ” + (values[0] * values[1] * values[2]);

   } else {

     result = “Total: ” + values.reduce((a, b) => a + b, 0);

   }

   document.getElementById(‘result’).textContent = result;

 });

});

“`

### **How It Works**

– Users click images to select/deselect them (they get a border).

– When the button is clicked, the script checks which images are selected.

– It performs a different operation depending on how many are selected (you can customize the logic).