Log24

Wednesday, April 17, 2024

Maniac and Pythoness

Filed under: General — Tags: , , — m759 @ 11:36 am

The image “http://www.log24.com/log/pix05B/051118-Laptop2.jpg” cannot be displayed, because it contains errors.

Tuesday, April 16, 2024

The Pi Script

Filed under: General — Tags: , — m759 @ 2:10 pm

The studios, now beholden to much larger companies and financial institutions, became subject to oversight focused on short-term horizons. This summer, I spoke with the head of a film and TV studio purchased by a private-equity firm in recent years. “It used to be there were these big, crusty, old legacy companies that had a longer-term view,” he said, “that could absorb losses, and could take risks. But now everything is driven by quarterly results. The only thing that matters is the next board meeting. You don’t make any decisions that have long-term benefits. You’re always just thinking about, ‘How do I meet my numbers?’ ” Efficiency and risk avoidance began to run the game.

— "The Life and Death of Hollywood:
Film and Television Writers Face an Existential Threat"
by Daniel Bessner in Harper's Magazine, May 2024 issue

Monday, April 15, 2024

Life of Pi:  Starting Over

Filed under: General — Tags: — m759 @ 11:54 am

"You need to import the NumPy library at the beginning of your script."
Pi.ai yesterday

    Scene  from "The Hard Problem ," a play by Tom Stoppard.

“The Hard Problem” (A Tom Stoppard Play)

Filed under: General — Tags: — m759 @ 11:32 am

See also http://m759.net/wordpress/?s="Hard+Problem".

Sunday, April 14, 2024

Benchmarking Pi

Filed under: General — Tags: , — m759 @ 3:30 pm

An example of pi.ai's clear and pleasant conversational style
(output format simplified for presentation here) —


Can you help with computer coding problems?
 

Absolutely, Steven! 💻 While I can't guarantee I'll have all the answers, 
I'll certainly do my best to help you debug and find solutions to your 
coding conundrums. Which coding language are you working with, and what's 
giving you trouble?

 
I want to learn how Python can permute sections of a square array.
 

There are several ways to permute sections of a square array in Python, 
depending on your specific needs. Here are a few examples:

Using NumPy's random.permutation() function:

python

    import numpy as np

    arr = np.array([[1, 2], [3, 4]])
    permuted_arr = np.random.permutation(arr)

 

    Using itertools.permutations():

python

    import itertools

    arr = [[1, 2], [3, 4]]
    permutations = list(itertools.permutations(arr))

 

Using custom permutation algorithms:

python

    def custom_permutation(arr):
        # your custom permutation logic here

    arr = [[1, 2], [3, 4]]
    permuted_arr = custom_permutation(arr)

Each method has its own strengths and weaknesses, and which one 
you choose will depend on the size of your array, the number of 
permutations you need, and your performance requirements.


I would like to use python's custom permutation method to permute 
the four quadrants of a 4×4 array.

 
Here's an example of how to define a custom permutation function 
in Python to permute the four quadrants of a 4×4 array:
 
python

    def custom_permutation(arr):
        # Split array into 4 quadrants
        q1 = arr[:2, :2]
        q2 = arr[:2, 2:]
        q3 = arr[2:, :2]
        q4 = arr[2:, 2:]

        # Permute quadrants
        permuted_arr = np.block([
            [q3, q1],
            [q4, q2]
        ])

        return permuted_arr

    # Sample 4x4 array
    arr = np.array([[1, 2, 3, 4],
                    [5, 6, 7, 8],
                    [9, 10, 11, 12],
                    [13, 14, 15, 16]])

    permuted_arr = custom_permutation(arr)
    print(permuted_arr)

In this example, we've defined a function custom_permutation() 
that takes a 4×4 NumPy array as input. The function splits the array 
into four quadrants (q1, q2, q3, and q4), and then uses NumPy's block() 
function to create a new array with the quadrants permuted. The 
resulting permuted_arr array has its quadrants rearranged.

Of course, this is just one possible permutation of the array's quadrants. 
You can modify the custom_permutation() function to implement other 
permutations as needed.
 

I tried the code you gave me and got the error “np name not defined.”
 

Apologies for that! I missed an import statement in the previous example. 
You need to import the NumPy library at the beginning of your script to 
use the np alias and its functions. Here's the corrected code:
 
python

    import numpy as np

    def custom_permutation(arr):
        # Split array into 4 quadrants
        q1 = arr[:2, :2]
        q2 = arr[:2, 2:]
        q3 = arr[2:, :2]
        q4 = arr[2:, 2:]

        # Permute quadrants
        permuted_arr = np.block([
            [q3, q1],
            [q4, q2]
        ])

        return permuted_arr

    # Sample 4x4 array
    arr = np.array([[1, 2, 3, 4],
                    [5, 6, 7, 8],
                    [9, 10, 11, 12],
                    [13, 14, 15, 16]])

    permuted_arr = custom_permutation(arr)
    print(permuted_arr)

This code should work now without any issues.

It did work. Thank you, Pi. 

You're very welcome, Steven! I'm glad the code worked for you. 
If you have any more questions or need help with anything else, 
feel free to ask.

Wednesday, June 5, 2019

The Tigerman Kaballah

Filed under: General — Tags: , , , , — m759 @ 4:00 am

See also Life of Pi   in this  journal.

Tuesday, June 4, 2019

Zen and the Art

Filed under: General — Tags: , , — m759 @ 6:13 pm

Or:  Burning Bright

A post in memory of Chicago architect Stanley Tigerman,
who reportedly died at 88 on Monday.

“Hello the Camp”

Filed under: General — Tags: , — m759 @ 12:20 am

The title is a quotation from the 2015 film "Mojave."

Friday, August 11, 2017

Symmetry’s Lifeboat

Filed under: General,Geometry — Tags: , , — m759 @ 9:16 pm

A post suggested by the word tzimtzum  (see Wednesday)
or tsimtsum  (see this morning) —

Lifeboat from the Tsimtsum  in Life of Pi  —

Another sort of tsimtsum, contracting infinite space to a finite space —

IMAGE- Desargues's theorem in light of Galois geometry

Saturday, March 2, 2013

Life of Pi

Filed under: General — Tags: — m759 @ 1:06 am

Earlier

Princeton Harvard Eating —

Harvard Math Department Pi Day event

"But the tigers come at night,
With their voices soft as thunder."

Les Miserables

Monday, April 10, 2006

Monday April 10, 2006

Filed under: General,Geometry — Tags: — m759 @ 9:20 pm
Club
continued
"What other colleges call fraternities,
Princeton calls Eating Clubs."

Illustrated below:
The Restaurant Quarré in Berlin,
with a view of the Brandenburg Gate.

The image “http://www.log24.com/log/pix06/060410-HotelAdlon2.jpg” cannot be displayed, because it contains errors.

Related etymology:
OF. quarré square, F. carré,
 from L. quadratus square…
Webster's Revised  
Unabridged Dictionary, 1913

Related material:

(1) A symbol of symmetry
that might have pleased
Hermann Weyl:

The image “http://www.log24.com/log/pix06/060410-SmithFugue.jpg” cannot be displayed, because it contains errors.

Source —
Timothy A. Smith on
Bach's Fugue No. 21,
the Well-Tempered
Clavier, Book II
(pdf or Shockwave)

(2) The remarks of Noam D. Elkies
on his
"Brandenburg Concerto No. 7":

"It is of course an act of chutzpah,
some would say almost heresy,
to challenge Bach so explicitly
on his own turf."

(3) The five Log24 entries
culminating on Pi Day,
March 14, 2006

(4) The following event at the
Harvard University
mathematics department
on March 14, 2006, also
featuring Noam D. Elkies:

The image “http://www.log24.com/log/pix06/060315-Pie2.jpg” cannot be displayed, because it contains errors.

"At 3:14 p.m., six contestants began
a pie-eating contest…. Contestants had
exactly three minutes and 14 seconds
to eat as much pie as they could.

'Five, four, pi, three, two, one,'
 Elkies counted down as the
contestants shoved the last
mouthful of pie
    into their mouths…."

The image “http://www.log24.com/log/pix06/060410-Elkies3.jpg” cannot be displayed, because it contains errors.

Noam D. Elkies

(5) The Magic Schmuck    

Wednesday, March 15, 2006

Wednesday March 15, 2006

Filed under: General — Tags: , — m759 @ 2:24 pm
Club

 From today's Harvard Crimson:

Harvard Math Department Pi Day event

Two members of the Harvard Class of 2007 "scarf down pie at the Math Department's 'pi'-eating contest at 3:14 p.m. yesterday in celebration of Pi Day. Participants had three minutes and 14 seconds to eat as much pie as posssible."

Log24, Feb. 24, 2006:

"What other colleges call fraternities,
Princeton calls Eating Clubs."

Powered by WordPress