LeetCode - Algorithms - 54. Spiral Matrix

Problem

54. Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.

Java

solution by myself

Although it is slow, it is pass on Leetcode by myself after attempting six times.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Solution {
public List<Integer> spiralOrder(int[][] matrix) {
int m = matrix.length;
int n = m>0?matrix[0].length:0;
List<Integer> list = new ArrayList<Integer>();
for(int delta=0;delta<Math.ceil(Math.min(m, n)/2)+1;delta++) {
for(int i=delta;m>=2*delta+1 && i<n-delta;i++) {
list.add(new Integer(matrix[delta][i]));
}
for(int i=delta+1;n>=2*delta+1 && i<m-delta;i++) {
list.add(new Integer(matrix[i][n-delta-1]));
}
for(int i=n-delta-2;m>=2*delta+2 && i>=delta;i--) {
list.add(new Integer(matrix[m-delta-1][i]));
}
for(int i=m-delta-2;n>=2*delta+2 && i>delta;i--) {
list.add(new Integer(matrix[i][delta]));
}
}
return list;
}
}

Submission Detail

  • 22 / 22 test cases passed.
  • Runtime: 1 ms, faster than 6.37% of Java online submissions for Spiral Matrix.
  • Memory Usage: 34.4 MB, less than 100.00% of Java online submissions for Spiral Matrix.

better solution

盘点今年秋招那些“送命”的算法面试题 - 极客大学

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Solution {
public List<Integer> spiralOrder(int[][] matrix) {
List<Integer> result = new ArrayList<>();
int height = matrix.length, width = height == 0 ? 0 : matrix[0].length;
int size = height * width;

int[] dirX = { 0, 1, 0, -1 };
int[] dirY = { 1, 0, -1, 0 };

int x = 0, y = -1, dir = 0;
for (int step, total = 0; total < size; total += step) {
if (dir == 0 || dir == 2) {
step = width;
height--;
} else {
step = height;
width--;
}
for (int i = step; i > 0; i--) {
x += dirX[dir];
y += dirY[dir];
result.add(matrix[x][y]);
}
dir = ++dir % 4;
}
return result;
}
}

Submission Detail

  • 22 / 22 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Spiral Matrix.
  • Memory Usage: 34.2 MB, less than 100.00% of Java online submissions for Spiral Matrix.

C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class Solution {
public IList<int> SpiralOrder(int[][] matrix) {
IList<int> list = new List<int>();
int height = matrix.Length;
int width = height == 0 ? 0 : matrix[0].Length;
int size = height * width;

int[] dirX = { 0, 1, 0, -1 };
int[] dirY = { 1, 0, -1, 0 };

int x = 0, y = -1, dir = 0;
for (int step, total = 0; total < size; total += step)
{
if (dir == 0 || dir == 2)
{
step = width;
height--;
}
else
{
step = height;
width--;
}
for (int i = step; i > 0; i--)
{
x += dirX[dir];
y += dirY[dir];
list.Add(matrix[x][y]);
}
dir = ++dir % 4;
}

return list;
}
}

Submission Detail

  • 23 / 23 test cases passed.
  • Runtime: 176 ms, faster than 71.81% of C# online submissions for Spiral Matrix.
  • Memory Usage: 40.5 MB, less than 95.65% of C# online submissions for Spiral Matrix.

Why We Struggle Learning Languages - Gabriel Wyner - TEDxNewBedford - Transcript

So, there’s a myth when it comes to language. And that myth is that children are exceptionally good at learning languages and that we lose that gift when we grow up. We have good reason for believing in this myth.

Many of us have had this experience. We’ve picked a language in high school or college, studied hard for three, four, five years, and then we take a trip to France, and we meet a five-year-old French child, and she speaks way better French then we do. (Laughter) And it’s not fair. I mean, we have struggled so hard, and she has never worked a day in her life, and yet here she is correcting our grammar. And you’re right. It’s not fair. It’s not fair because you are comparing yourself to a child who has had 15,000 hours of French exposure, and you have had 100, maybe 200, maybe 50. It depends upon how much of your classes were actually spent in French instead of in English talking about French. When you make the fair comparison - you take a five-year-old child, transplant them to Spain, give them 500 hours of exposure there; adult gets a job in Spain, 500 hours of exposure - what you’ll find is that the adult beats the child every time. We are better at learning languages than children. We are smarter than them. We’ve learned how to learn. It’s one of the perks of growing up.

That’s not to say there are no advantages to being a kid; there are three. Between the ages of 6 months and 12 months, in that tiny window, children can hear sounds in new languages in a way that we lose. Significant advantage there. Advantage two, children are fearless. They will walk into any conversation, whether they know the words or not, where we will hold ourselves back; we’ll be afraid. Huge advantage. Yet neither of those two advantages outweighs our superior ability to learn. The third advantage of being a child is the advantage of time.

We don’t have 15,000 hours to spend learning French. And so, to succeed at this, we need something that works better than what children use. And to talk about what that might look like, I want to talk about some of my own experiences.

I began my language learning journey with Hebrew, in kindergarten and elementary school. I studied for seven years, and at the end of those seven years of study, I could read the Hebrew … alphabet. (Laughter) So I try it again. In junior high and high school, I was fortunate; I went to a high school that offered Russian with really good teachers, and so I took Russian for five and a half years. I studied hard; I did well on my tests; I did all of my homework; and at the end of those five and a half years, I could read the Russian alphabet. I retained, maybe, 40 words, and I came to the conclusion that this whole language thing was not for me. And then I made a poor decision. I was always a science nerd. I loved science and engineering; I wanted to be a nuclear engineer, focused on plasma physics so I could make fusion reactors. That was my thing as a kid. But I had this hobby, and that hobby was singing. I sang musical theater and opera. And as I was applying to engineering schools for college, I applied to one that had a music conservatory, and I thought, “Wouldn’t it be weird to study opera and mechanical engineering? Wouldn’t that be out there?” And so I did. One of the side effects of that is that I needed to take language courses. For that opera degree, I needed German, French, and Italian. And a French friend of mine came to me and said, “Hey, you know, you can get two semesters of credit in one summer at this school in Vermont.” And I thought, “That sounds great.” So I signed right up for this program. And the way this program works is that you sign a contract on the very first day. It says that if I speak one word that is not German, if I write anything, if I read anything, if I listen to a voicemail that’s not in German, I will get kicked out of the school with no refund. And I thought, “I guess that sounds like fun.” (Laughter) And so I went, and I signed that contract, and I realized that I did not actually speak any German, and so, I stopped talking. (Laughter) And someone came up to me, and he said, “Hallo, ich heiße Joshua. Wie heißt du?” And I said, “Eh?” (Laughter) And he said, “Hallo, ich heiße Joshua. Wie heißt du?” And I said, “Ich heiße Gabriel?” And I learned German that way. Seven weeks later, I could hold a solid conversation in the language, and I became addicted to the feeling of thinking in a completely new way. And so, I went back the following summer to reach fluency in German. In 2007, I moved to Vienna, Austria, to pursue a degree in opera and in song. In 2008, I went to Perugia, Italy, to study Italian. And in 2010, I cheated on a French test. And that’s where all of this comes from. You see, I wanted to go back to that school with the contracts in Vermont because, in a sort of stressful, masochistic way, it was actually kind of fun. And they had a Level 1 for people who weren’t familiar with French, which was appropriate for my level, but they also had Level 1.5 that was a little bit faster. And I thought, this was my third language. Italian is close to French. I can probably manage 1.5. So they sent me a placement test online, and I cheated on it as much as I possibly could. I figured me not knowing French and cheating as much as I could might get me in Level 1.5. And so, I used About.com’s “French grammar” to cheat on the multiple-choice section. I wrote an essay in Google Translate and submitted this thing. (Laughter) I sent it off. I didn’t think about any more of it. And three months later I got an email, and that email said, “Congratulations! You did really well on your placement test! We’re placing you in the intermediate level.” (Laughter) “You have three months. In three months, we’re going to put you in a room with a French speaker. We’ll talk to you for about 15 minutes to make sure you did not do anything stupid, like cheat on your placement test.” (Laughter)

And so, I panicked. And when I panic, I go to the internet because, clearly, someone there has an answer for everything, and as it turns out, there were some good answers. There are these systems called spaced repetition systems. They’re basically like flashcards. You know those cards with, like, “chat - cat” that you used in school? These are computerized versions of these, but they test you right at the optimal moment, right before you forget any piece of information, so they’re extremely efficient. Now, what people use these space repetitions programs for is they use them with translations. And I knew from my experiences with Hebrew and Russian that that wasn’t going to work for me, and so I did something else. And to explain that, let’s talk about two words. The first word, we learn in a classroom. We’re learning Hungarian. Our teacher comes to the board. She writes fényképezőgép is the Hungarian word for camera. And then she writes 39 other words on the board and says, “This will be your vocabulary for the week. You’ll have a quiz at the end of the week.” The second word, we learn quite differently. You are on an adventure with your best friend. You’re in Scandinavia. You find yourselves in an old bar. There are six grizzled old patrons. You sit at the bar, and the barkeep, he is definitely a Viking. He has a giant red beard, and he is smiling at you in a very disturbing manner as he puts out three shot glasses and pulls out a bottle, and on the bottle you see written M O K T O R, as the barkeep says, “Moktor” and starts pouring something into these shot glasses. And it’s a sort of green liquid, but not a nice, emerald green liquid; it’s a kind of brownish yellowish viscous green liquid. And he puts the bottle away, and he pulls out a white jar. From the white jar, he starts spooning out something into each shot glass. From the scent, you realize this is definitely rotting fish, as he repeats, “Moktor,” and all the patrons now are turning and looking at you and laughing. The barkeep now pulls out a match. He lights it, he lights the three shot glasses on fire, and he repeats, “Moktor,” as all of the patrons now start chanting “Moktor! Moktor! Moktor!” And your friend, your stupid friend, he picks up his shot glass and he shouts “Moktor!” and he blows it out, and he drinks it. And the barkeep, he blows his out, and he shouts “Moktor!” and he drinks it. And now everyone is staring at you, chanting “Moktor! Moktor!” And you pick up your glass - “Moktor!” - and you blow it out - “Moktor!” - and you scream “Moktor!” and you drink it. And it’s the worst thing you’ve ever had in your life. And you will remember the word moktor forever - (Laughter)

where you have already forgotten the Hungarian word for camera. (Laughter) Why? Memories are fascinating things. They’re not stored in any particular location in your brain; they’re actually stored in the connections between regions of your brain. When you saw that glass, you saw the bottle and it said M O K T O R, and the barkeep said, “Moktor,” that sound and that spelling, they interconnected; they formed a memory. Those connections connected to other sounds: the sound of moktor getting poured into those shot glasses, the sound of everyone chanting in the room “Moktor! Moktor!” All of those sounds and that spelling, they interconnected, and they also connected to images. They connected to images of this green bottle. They connected to the shot glasses. They connected to this decaying fish. They connected to the face of that barkeep; that Viking face, that is a part of that word now. And those, in turn, connect to sensory experiences, like that awful taste in your mouth, the smell of burning, decaying fish, the heat of the fire. Those connect to emotional content: to disgust, to anger at your friend, to excitement. They connect to your journey. They connect to what is alcohol, what is Scandinavia, what is friendship, what is adventure. All of these things are now a part of this word, and they make it so that that word is going to stick with you, where the Hungarian word for camera, well, you don’t even remember what it sounds like. This non-memory isn’t associated with iPhone cameras and SLR cameras and the sound of a shutter, and the feelings you get when you look at photos from your past. No, those associations exist; they’re connected to another word, to the word camera. But fényképezőgép has none of that right now. And so, you can’t hold on to it. So what can you do with this?

Well, let’s return to where I was with French. My situation was as follows: I was taking two master’s degrees, one in song, one in opera, and so I had six days of class a week. My only free time was an hour a day on the subway, Sundays, and Austrian national holidays, of which, thankfully, there were many. And during that time, I did one thing: I built and reviewed flashcards in one of these computerized spaced repetition systems. But instead of using translations on those flashcards, I began with pictures. If I wanted to learn the French word for dog, chien, then I would search on Google Images for chien, and I would find that French bloggers didn’t choose the dogs I would expect. Their dogs were smaller and cuter and, somehow, more French. (Laughter) And so, I used these dogs to learn chien and built a vocabulary out of these pictures from French bloggers. And as I built that vocabulary, I graduated over to sentences. And I started learning abstract words and grammar that way, using fill-in-the-blank sentences. If I wanted to learn a word, like, went is the past tense of to go, I would use a story. Yesterday, I blank to school - with a picture of a schoolhouse. And so, I learned my abstract grammar in that way. And then, three months later, I had that interview. And I found myself in this room with this French person, who began our conversation with “Bonjour.” And then, the first thing that came to my mind was, “Bonjour.” And she started speaking to me in French, and I realized I understood what she was saying, and what’s more, I knew what to say back. And it wasn’t fluent; it was a bit stunted, but this was the first time I had spoken French in my life, and I was speaking in French, and I was thinking in French, and we had a 15-minute conversation, and at the end of this conversation, the teacher tells me, “You know, there something wrong with your placement test. It says you should be in the intermediate level, but we’re placing you in the advanced level.” And so, over the next seven weeks, I read 10 books, I wrote 70 pages of essays, and by the end of that summer, I was fully fluent in French. And I realized that I had found something important. And so I started writing about it and creating computerized tools around it and tinkering.

In 2012, I learned Russian. I had my revenge on that language. In 2013 through 2015, I learned Hungarian. In 2015, I started Japanese, then stopped, learned Spanish, came back, and started Japanese again because Japanese is endless. In each of these experiences, I learned a lot. I learned ways of tweaking the system to find efficiency boosts here and there, but the overall concept has always remained exactly the same. If you want to learn a language efficiently, then you need to give that language life. Every word needs to connect to sounds and images and scents and tastes and emotions. Every bit of grammar can’t be some kind of abstract grammatical code; it needs to be something that can help you tell your story. And if you do this, you will find that the words begin to stick in your mind, and the grammar, it begins to stick too. And you start to realize that you don’t need some kind of language gene, some gift from God to accomplish this. This is something that everyone has both the time and the ability to do. Thank you.

What Bruce Lee can teach us about living fully - Shannon Lee - TED Salon - Transcript

Bruce Lee is my father, and he is best well-known as a martial artist and an action film star, as I’m sure most of you know. He died when I was four years old, but I have a really deep memory of him. I don’t have those long-form, storied memories that you do when you’re older, but the memory that I do have is of the feeling of him. I remember his energy, his presence, his love – the safety of it, the power of it, the radiance of it. And to me that memory is very deep and personal. And it is the memory of the quality of his essential nature.

What a lot of people don’t know about my father is that he was also a philosopher. He had a very ever-evolving philosophy that he lived, and it is that distinction – that he lived his philosophy and didn’t just espouse his philosophy – that made him the force of nature that he was, and still engages us today. His wisdom has salvaged me many times in my life: when my brother died, when my heart’s been broken, whenever I have faced a challenge to my mind, my body or my spirit, the way that he expressed himself has lifted me up. And so I come to you today not as a researcher or an educator or a guru or even a life coach, but as a student of Bruce Lee – as his daughter, and also as a student of my own life.

So … my big burning question that I want you all to consider today is … how are you? Let me elaborate. Whenever anyone would ask my mom what my father was like, she would say, “How he was in front of the camera, how you saw him in his films, how you saw him in his interviews was, in fact, exactly how he was.” There were not multiple Bruce Lees. There was not public Bruce Lee and private Bruce Lee, or teacher Bruce Lee and actor Bruce Lee and family man Bruce Lee. There was just one unified, total Bruce Lee. And that Bruce Lee had a very deep, philosophical life practice called self-actualization. You’ve probably heard that term before. It’s also known as how to be yourself in the best way possible. And that Bruce Lee said this: “When I look around, I always learn something and that is to be always yourself, and to express yourself and have faith in yourself. Don’t go out and find a successful personality and duplicate it, but rather start from the very root of your being, which is ‘How can I be me?’

Many of us have done some soul-searching or at least some incessant thinking and worrying about things like our purpose, our passion, our impact, our values and our “reason for being.” And that is sometimes considered our why. Why am I here? Why this life? What am I meant to be doing? If we can grab a little piece of that information, it can help to ground us and root us, and it can also point us in a direction, and typically what it points us to is our what. What we manifest in the world, what we have. So our job, our home, our hobbies and the like. But there’s this little space in between the why and the what that often doesn’t get our full attention, and that is our … how. How we get there and the quality of that doing. And I want to offer that this is actually the most important part of the equation when it comes to our personal growth, our sense of wholeness and even the long-term impact that we make.

How is the action that bridges the gap from the internal to the external. And bridging the gap is a very important concept for martial artists like my father. It’s how you get from point A to point B. It’s how you get from here to your target under the most vital of circumstances. And so it makes all the difference. Do you get there as an amateur? Are you sloppy? Are you wild, chaotic, sometimes you get lucky, sometimes you’re not lucky? Or are you a warrior? Are you confident? Are you focused? Are you skilled? Are you intuitive? Are you expressive, creative, aware? So I want to talk to you today about your how in your life.

So we do a little bit of – we spend a little time in existential crisis over “Why am I here? What am I meant to be doing?” and we put a ton of effort into our what – our job, our career, our partner that we have and the hobbies we pursue. But I want us to consider that our how is the expression of our why in every what, whether we’re aware of it or not. And so let’s take an example. Let’s say that I have a value of kindness. I’m all about kindness, I feel really natural being kind, I want to see more kindness in the world. Is that kindness – is that value in the result or is it in the doing? Are you trying to be kind when it’s hard to be kind? Can you do something you don’t want to do kindly, like fire someone? Can you leave a relationship with kindness? If kindness is the value, then are you trying to express it in the whole spectrum of your doing – and trying to do that? Or are you just doing it when it’s easy? So I want us to think about that for a moment and consider, you know, if we come home and we’re kind and generous and loving with our kids, but then we go to work and we are dismissive and rude to our assistant and we treat them like a subhuman, then there is a fragmentation in the beingness of our value. And so I want us to consider that how we are in our lives is in fact how we are. Meaning, if I am the kind of person that walks down the street and smiles at people and says “hi” as I walk past them on the sidewalk, then that is how I am. But if I’m also the kind of person who makes fun of my brother every chance that I get behind his back, that is also the kind of person that I am. And ultimately how we are makes up the totality of the picture of who we are. And so I want to talk about how do we unite these pieces if we have any fragmentation. I want to understand how we embody ourselves as our one and only self.

How do we actualize the whole self? My father said, “All goals apart from the means are an illusion. There will never be means to ends – only means. And I am means. I am what I started with and when it is all over, I will be all that is left.“ So you can employ a systematic approach to training and practicing, but you can’t employ a systematic approach to actually living because life is a process not a goal. It is a means and not an end. So “to obtain enlightenment” – and I’m going to say self-actualize, to be self-actualized or to obtain wholeness – “emphasis should fall NOT on the cultivation of the particular department” – all of our whats – “which then merges into the totality of who we are as a total human being, but rather, on the total human being that then enters into and unites those particular departments.” You are your how.

You – if you have some consciousness and you want to bring some practice, if you want to step into that warrior space around your how – how you express in every aspect of your life – then you get to be the artist of that expression. You get to step into that and claim it and exercise it and bring that beingness through your doingness into your havingness. And there you will find the most profound of your growth, you will find a sense of wholeness and ultimately, you will leave a lasting impact on your environment.

My father was his how. He applied the execution of who he was to every aspect of his life. He was way more than that kung fu guy from the ‘70s. He was someone who worked very hard at actualizing his inner self and expressing it out into the world. And that laid the foundation for what continues to inspire us, engage us, excite us and attract us to him. He was the embodied example of living fully. He said, “I am means.“ And there are only means.

So I’m going to ask you one more time. Thank you for listening, and please consider, for you, across the spectrum of your doing, how are you?

Thank you.


Walking Along the Bank of Lake Washington

by Bruce Lee

The breeze on the bank
Already blows cool and mild;
The distant merging of lake and sky
Is but a red trace of sunset.

The deep silence of the lake,
Cuts of all tumult from me.
Along the lonely bank
I move with slow footsteps:

Alone the disturbed frogs scurry off.
Here and there are houses,
Cool beads of light spring out from them.

A dazzling moon
Snines down from the lonely depths of the sky.
In the moonlight slowly I move to a gung fu form.
Body and soul are fused into one.

Conceptual Blockbusting - A Guide To Better Ideas

the programmer’s main problem was not so much technical as psychological: he couldn’t make progress because he was trying to solve the wrong problem. We finally solved his problem by breaking through his conceptual block and solving an easier problem. Conceptual Blockbusting by James L. Adams studies this kind of leap and is generally a pleasant prod towards more creative thinking. Although it was not written with programmers in mind, many of its lessons are particularly appropriate for programming problems. Adams defines conceptual blocks as “metal walls that block the problem-solver from correctly perceiving a problem or conceiving its solution”. - Programming Pearls, by Jon Bentley


texts below are from © Conceptual Blockbusting 4th Edition, by James L. Adams

Chapter One Introduction

We spend little time monitoring our own thinking and comparing it with a more sophisticated ideal.

Thinking form

Conceptual blocks still control us. Much of thinking is quite automatic.

The following puzzle, which originates with Carl Duncker, is taken from The Arc of Creation by Arthur Koestler.

Puzzle: One morning, exactly at sunrise, a Buddhist monk began to climb a tall mountain. A narrow path, no more than a foot or two wide, spiraled around the mountain to a glittering temple at the summit. The monk ascended at varying rates of speed, stopping many times along the way to rest and eat dried fruit he carried with him. He reached the temple shortly before sunset. After several days of fasting and meditation he began his journey back along the same path, starting at sunrise and again walking at variable speeds with many pauses along the way His average speed descending was, of course, greater than his average climbing speed. Prove that there is a spot along the path that the monk will occupy on both trips at precisely the same time of day.

Solutions to Problems That Don’t Exist

Conceptual Blocks

mental walls that blocks the problem-solver from correctly perceiving a problem or conceiving its solutions.

Once again, please do the exercises and problems. The only way you will identify your own conceptual blocks is to try activities that are impeded by their existence.

Chapter Two Perceptual Blocks

Perceptual Blocks are obstacles that prevent the problem-solver from clearly perceiving either the problem itself or the information needed to solve the problem.

One: Detecting What You Expect - Stereotyping

Context is a key element in many memory techniques.

Two: Difficulty in isolating the Problem

Three: Tendency to Delimit the Problem Area Poorly

Puzzle: Draw no more than four straight lines(without lifting the pencil from the paper) which cross through all nine dots.

the widespread nature of this block is what makes this puzzle classic.

Four: Inability to See the Problem from Various Viewpoints

Five: Saturation

Six: Failure to Utilize all Sensory Inputs

Chapter Three Emotional blocks

The Mystery of Emotion

Freud

The Humanistic Psychologists

Fear of Taking a Risk

No Appetite for Chaos

Judging Rather than Generating ideas

inability Or Unwillingness to Incubate

Lack of challenge versus Excessive Zeal

Reality and Fantasy

of Flow and Angst

Chapter Four Cultural and Environmental blocks

Taboos

Humor in Problem-Solving

Reason and Intuition

Left-Handed and Right-Handed thinking

Primary and Secondary Creativity

Everybody Should Be Just Like Me

Cyber Is Better

Adria Anuzis looked at three aspects of communication, which she called
personal(same location, personal interaction),
cultural(commonalties of interest, background, and values),
cyber(interacting electronically).
she found that the most successful professional interaction made use of all three.

the best creative work comes from people who are not only electronically interconnected, but also share cultural values and interact personally in the same physical space.

Tradition and Change

Thinking Through Blocks

Environmental Blocks

Supportive Environments

Accepting and Incorporating Criticism

Autocratic Bosses

Non-Support

Chapter Five Intellectual and Expressive Blocks

Choosing Your Problem-Solving Language

Flexibility in Your Use of Strategies

Build upDisplaySimulate
EliminateOrganizeTest
Work ForwardListPlay
Work BackwardCheckManipulate
AssociateDiagramCopy
ClassifyChartInterpret
GeneralizeVerbalizeTransform
ExemplifyVisualizeTranslate
CompareMemorizeExpand
RelateRecallReduce
CommitRecordExaggerate
DeferRetrieveUnderstate
Leap InSearchAdapt
Hold backselectsubstitute
FocusPlancombine
releasepredictseparate
forceassumeChange
relaxquestionvary
dreamhypothesiscycle
imagineguessrepeat
purgedefinesystemize
incubatesymbolizerandomize

The Computer

Importance of Correct Information

Expressive Blocks

Chapter Six Alternate Thinking Languages

Visual Thinking

Other Sensory Languages

Cognitive Diversity

The Problems of Specialization

Analysis-Synthesis

Convergence-Divergence

Deduction-Induction

Jung and the Myers-Briggs Test

Chapter Seven Kinds of Blockbusters

A Questioning Attitude

Working on the Right Problem

Time and Effort Focusers

Set Breakers

Using other People’s ideas

Crossing Disciplines

Crossing Cultures and Changing Environments

Unconscious Blockbusting

Maslow

Barron

Other Paths for Freeing the Unconscious

Chapter Eight Groups

The Process

Synectics

Affiliation / Ego Needs

Leadership

Group Membership

Proper Support

Chapter Nine Organizations

Control vs. Creativity

The Pattern of Growth

Tradition and Past Success

Reward System and Support

Psychological Rewards

Support

Culture

LeetCode - Concurrency - 1114. Print in Order

An example of multiple solutions selected from discuss.

Java

volatile

Using volatile variables reduces the risk of memory consistency errors, because any write to a volatile variable establishes a happens-before relationship with subsequent reads of that same variable. This means that changes to a volatile variable are always visible to other threads. What’s more, it also means that when a thread reads a volatile variable, it sees not just the latest change to the volatile, but also the side effects of the code that led up the change.

volatile has semantics for memory visibility. Basically, the value of a volatile field becomes visible to all readers (other threads in particular) after a write operation completes on it. Without volatile, readers could see some non-updated value.

In programming, an atomic action is one that effectively happens all at once. An atomic action cannot stop in the middle: it either happens completely, or it doesn’t happen at all. No side effects of an atomic action are visible until the action is complete.

  • Reads and writes are atomic for reference variables and for most primitive variables (all types except long and double).
  • Reads and writes are atomic for all variables declared volatile (including long and double variables).

&#91;Java&#93; Simple, yet effective. Using volatile without lock

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Foo {
private volatile int flag;

public Foo() {
flag = 1;
}

public void first(Runnable printFirst) throws InterruptedException {
for(;;) {
if (flag==1) {
printFirst.run();
flag = 2;
break;
}
}
}

public void second(Runnable printSecond) throws InterruptedException {
for(;;) {
if (flag==2) {
printSecond.run();
flag=3;
break;
}
}
}

public void third(Runnable printThird) throws InterruptedException {
for(;;) {
if (flag==3) {
printThird.run();
flag = 1;
break;
}
}
}
}

36 / 36 test cases passed.
Runtime: 9 ms, faster than 88.93% of Java online submissions for Print in Order.
Memory Usage: 35.9 MB, less than 100.00% of Java online submissions for Print in Order.

Semaphore

Conceptually, a semaphore maintains a set of permits. Each acquire() blocks if necessary until a permit is available, and then takes it. Each release() adds a permit, potentially releasing a blocking acquirer. However, no actual permit objects are used; the Semaphore just keeps a count of the number available and acts accordingly.

Semaphores are often used to restrict the number of threads that can access some (physical or logical) resource.

[Java/Go] Implements

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.concurrent.Semaphore;

class Foo {
Semaphore semaphore1 = new Semaphore(0);
Semaphore semaphore2 = new Semaphore(0);

public Foo() {

}

public void first(Runnable printFirst) throws InterruptedException {
printFirst.run();
semaphore1.release();

}

public void second(Runnable printSecond) throws InterruptedException {
semaphore1.acquire();
printSecond.run();
semaphore2.release();

}

public void third(Runnable printThird) throws InterruptedException {
semaphore2.acquire();
printThird.run();
}
}

36 / 36 test cases passed.
Runtime: 9 ms, faster than 89.05% of Java online submissions for Print in Order.
Memory Usage: 35.7 MB, less than 100.00% of Java online submissions for Print in Order.

synchronized

The Java programming language provides two basic synchronization idioms: synchronized methods and synchronized statements.

Unlike synchronized methods, synchronized statements must specify the object that provides the intrinsic lock.

Synchronized statements are also useful for improving concurrency with fine-grained synchronization.

[Java] Basic version with just a synchronized block & a counter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Foo {
private String mutex = new String("");
private int counter = 1;

public Foo() {
}

public void first(Runnable printFirst) throws InterruptedException {
boolean loop = true;
while (loop) {
synchronized(mutex) {
if (counter == 1) {
printFirst.run();
++counter;
loop = false;
}
}
}
}

public void second(Runnable printSecond) throws InterruptedException {
boolean loop = true;
while (loop) {
synchronized(mutex) {
if (counter == 2) {
printSecond.run();
++counter;
loop = false;
}
}
}
}

public void third(Runnable printThird) throws InterruptedException {
boolean loop = true;
while (loop) {
synchronized(mutex) {
if (counter == 3) {
printThird.run();
++counter;
loop = false;
}
}
}
}
}

36 / 36 test cases passed.
Runtime: 9 ms, faster than 89.16% of Java online submissions for Print in Order.
Memory Usage: 36 MB, less than 100.00% of Java online submissions for Print in Order.

CountDownLatch

A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.

A CountDownLatch is initialized with a given count. The await methods block until the current count reaches zero due to invocations of the countDown() method, after which all waiting threads are released and any subsequent invocations of await return immediately. This is a one-shot phenomenon – the count cannot be reset.

A CountDownLatch is a versatile synchronization tool and can be used for a number of purposes. A CountDownLatch initialized with a count of one serves as a simple on/off latch, or gate: all threads invoking await wait at the gate until it is opened by a thread invoking countDown(). A CountDownLatch initialized to N can be used to make one thread wait until N threads have completed some action, or some action has been completed N times.

A useful property of a CountDownLatch is that it doesn’t require that threads calling countDown wait for the count to reach zero before proceeding, it simply prevents any thread from proceeding past an await until all threads could pass.

Another typical usage would be to divide a problem into N parts, describe each part with a Runnable that executes that portion and counts down on the latch, and queue all the Runnables to an Executor. When all sub-parts are complete, the coordinating thread will be able to pass through await.

[Java] 7ms CountDownLatch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.concurrent.CountDownLatch;

class Foo {
private final CountDownLatch L1 = new CountDownLatch(1);
private final CountDownLatch L2 = new CountDownLatch(1);

public Foo() {
}

public void first(Runnable printFirst) throws InterruptedException {
printFirst.run();
L1.countDown();
}

public void second(Runnable printSecond) throws InterruptedException {
L1.await();
printSecond.run();
L2.countDown();

}

public void third(Runnable printThird) throws InterruptedException {
L2.await();
printThird.run();
}
}

36 / 36 test cases passed.
Runtime: 9 ms, faster than 89.16% of Java online submissions for Print in Order.
Memory Usage: 35.4 MB, less than 100.00% of Java online submissions for Print in Order.

Phaser

A reusable synchronization barrier, similar in functionality to CyclicBarrier and CountDownLatch but supporting more flexible usage.

Methods arrive() and arriveAndDeregister() record arrival. These methods do not block, but return an associated arrival phase number; that is, the phase number of the phaser to which the arrival applied.

Method awaitAdvance(int) requires an argument indicating an arrival phase number, and returns when the phaser advances to (or is already at) a different phase.

Java Phaser solution, very fast

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.concurrent.Phaser;

class Foo {
private Phaser phaser;

public Foo() {
phaser = new Phaser(3);
}

public void first(Runnable printFirst) throws InterruptedException {
phaser.arrive();
phaser.awaitAdvance(0);
printFirst.run();
phaser.arrive();
phaser.arrive();

}

public void second(Runnable printSecond) throws InterruptedException {
phaser.arrive();
phaser.awaitAdvance(0);
phaser.arrive();
phaser.awaitAdvance(1);
printSecond.run();
phaser.arrive();

}

public void third(Runnable printThird) throws InterruptedException {
phaser.arrive();
phaser.awaitAdvance(0);
phaser.arrive();
phaser.awaitAdvance(1);
phaser.arrive();
phaser.awaitAdvance(2);
printThird.run();
}
}

36 / 36 test cases passed.
Runtime: 10 ms, faster than 55.92% of Java online submissions for Print in Order.
Memory Usage: 36 MB, less than 100.00% of Java online submissions for Print in Order.

妄人妄语

Twitter

The equations that evolved in the minds of geniuses are the sonnets of God. Newton’s universal inversesquare law of gravity was superseded by Einstein equations. Dirac equation was as prophetic as Maxwell–Heaviside equations.

\(\displaystyle \huge F=G{\frac {m_{1}m_{2}}{r^{2}}}\)

\(\displaystyle \huge R_{\mu \nu }-{\frac {1}{2}}Rg_{\mu \nu } = 8 \pi T_{\mu \nu } \)

\(
\displaystyle \huge
\begin{align}
\nabla \cdot \mathbf {E} &={\frac {\rho }{\varepsilon _{0}}} \\
\nabla \cdot \mathbf {B} &=0 \\
\nabla \times \mathbf {E} &=-{\frac {\partial \mathbf {B} }{\partial t}} \\
\nabla \times \mathbf {B} &=\mu _{0}\left(\mathbf {J} +\varepsilon _{0}{\frac {\partial \mathbf {E} }{\partial t}}\right)
\end{align}
\)

\( \displaystyle \huge (i\hbar \gamma ^{\mu }\partial _{\mu }-mc)\psi =0 \)

Many men have had intuitions well ahead of their time … Gibbs rather than Einstein or Heisenberg or Planck to whom we must attribute the first great revolution of twentieth-century physics. (Norbert Wiener)

Science has no national borders. National boundaries are not evident when we view the Earth from space. (Carl Sagan)

There are two avenues by which opinions are received into the soul, which are its two principal powers: the understanding and the will. (Blaise Pascal)

Two things fill the mind with ever-increasing wonder and awe, the more often and the more intensely the mind of thought is drawn to them: the starry heavens above me and the moral law within me. — Immanuel Kant, Critique of Practical Reason (1788)

The world won’t care about your self-esteem. The world will expect you to accomplish something before you feel good about yourself. (Charlie Sykes)

whereas in thinking of God, a man must abstract Him from all substance, and not think of Him as a form of extension, but as an order of events. God was no Being, but pure Act — the principle of a transcendental world-order. — Heinrich Heine, Reisebilder

人念及上帝时,应该把祂抽离一切实在,而不将祂想象为占空间的形式,上帝不是存在,而是世易时移之力,一个形而上世界的秩序的原素。— 海涅,《游记》

For we are mistaken when we look forward to death; the major portion of death has already passed. Whatever years be behind us are in death’s hands. (Seneca the Younger)

Before you were born your parents weren’t as boring as they are now. They got that way paying bills, cleaning your room, and listening to you tell them how idealistic you are. … — Charles Sykes(author of DUMBING DOWN OUR KIDS)

Democracy is the worst form of government, except for all the others. ― Winston S. Churchill

Winston Churchill: The empires of the future are the empires of the mind.

Winston Churchill: The price of greatness is responsibility.

Winston Churchill: Where there is great power there is great responsibility.

American Dream: that dream of a land in which life should be better and richer and fuller for everyone, with opportunity for each according to ability or achievement. - The Epic of America, James Truslow Adams

To die is only to be as we were before we were born; [on the fear of death] (William Hazlitt)

A wealth of information creates a poverty of attention. — Herbert A. Simon

We are all of us more or less the slaves of opinion. - William Hazlitt

Newton was far from the crude thought that explanation of phenomena could be attained by abstraction. — Bernhard Riemann

The word hypothesis has now a somewhat different significance from that given it by Newton. We are now accustomed to understand by hypothesis all thoughts connected with the phenomena. — Bernhard Riemann

Natural science is the attempt to comprehend nature by precise concepts. — Bernhard Riemann

I have always depended on the kindness of strangers. — Blanche DuBois in play A Streetcar Named Desire

Nothing will work unless you do. — Maya Angelou

I started to realize that maybe Thomas Edison did a lot more to improve the world than Karl Marx and Neem Karoli Baba put together. — Steve Jobs

Men are judged by what they do. A man must take the consequence of his own deeds.

There isn’t time, so brief is life, for bickerings, apologies, heartburnings, callings to account. There is only time for loving, and but an instant, so to speak, for that. — Mark Twain

I don’t know who my grandfather was; I am much more concerned to know what his grandson will be. - Abraham Lincoln

I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. ― Albert Einstein

第三次世界大戰將要使用的武器我並不知道,但是第四次世界大戰將會用木棍和石頭開戰。(愛因斯坦)

Internet的确产生了大众文化,但是我们不应该忽略,它也可能降低创造性,因为许多人在寻求信息,而自己却没有时间进行思考。 – Ilya Prigogine

前乌克兰党魁伽弗里洛夫是个业余数学家,20世纪60年代利用大权在握,设法让他给出的黎曼假设的错误证明发表出来,蓋爾范德为此差点心脏病发作,因为他认为这一黎曼假设错误证明的发表,对苏联的数学造成了很大的伤害。

‘It’s really hard to find maintainers…’ Linus Torvalds ponders the future of Linux

Science is the only news. — Stewart Brand

John Polkinghorne suggests that the mechanistic explanations of the world that have continued from Laplace to Richard Dawkins should be replaced by an understanding that most of nature is cloud-like rather than clock-like.

René Descartes is a philosopher who created analytic geometry, by contrast, Hegel is just a philosopher who was ignorant in mathematics, ‘Such things are nowhere more at home than among philosophers who are not mathematicians’,as Gauss put it. Schopenhauer is better than Hegel.

A Time for Leadership by Margaret Thatcher - China will not become a superpower to match the United States — at least, not while it is held back by the deadweight of socialism.

The tides caused by the moon are key to life forming on earth. As Maggie concluded “the moon is the mother of us all

Your smartphone is making you stupid, antisocial and unhealthy. So why can’t you put it down?

In the fight against climate change, we pay now or our children pay later

豆瓣

电视时代,沙发上的土豆。触屏时代,低头的屏奴。娱乐至死的时代。唯一能安慰我们之可悲的东西就是消遣,可是它也是我们可悲之中的最大的可悲。……若是没有它,我们就会陷于无聊,而这种无聊就会推动我们去寻找一种更牢靠的解脱办法了。可是消遣却使得我们开心,并使我们不知不觉地走到死亡。

乔治·华盛顿曾经说过:”如果被剥夺了言论自由,我们就会变得愚笨沉默,如绵羊般被拉向屠宰场。”

Well-being and happiness never appeared to me as an absolute aim. I am even inclined to compare such moral aims to the ambitions of a pig.

David Hilbert: Every boy in the streets of our mathematical Göttingen understands more about four-dimensional geometry than Einstein. Yet, despite that, Einstein did the work and not the mathematicians.

陈省身:我不久即看到爱因斯坦所遭遇的问题之极度困难以及数学与物理的不同,数学中有名的问题通常是已经提得很明确的,但在物理学中,问题的提法也是问题的一部分。不知道他试图实现统一场论的物理学洞见如何?手头的数学工具也就那样。丛和联络这两个几何概念都很简洁,我相信爱因斯坦会喜欢它们。

浮生若梦,人生几何?有首流行歌曲叫《光阴的故事》,有部情景喜剧叫《成长的烦恼》

耶稣会的教士都接受过良好的欧洲人文教育并经受过准军事训练,利玛窦汤若望南怀仁都是这一组织中出类拔萃的人才,他们身后有足够的支持,供他们以精密的仪器、华美的书籍、先进的技术赢得中国上流社会的青睐。

有时我觉得自己学习中文非常有益,陶冶性灵,但更多的时候,我觉得自己是中毒太深,不敢再把情绪放纵到诗与文里面,以免如梦如幻,贻误终身。

工作撵跑三个魔鬼:无聊、堕落和贫穷。

浮生若梦,人生最大的痛苦是梦醒了发现自己无路可走。

微博

《道德经》中“修之于身,其德乃真”的本义,似乎不是在嘲笑那些伪君子言行不一“说一套、做一套”、仁义道德嘴把式,而是:尽管你认同那些更有利于使你“做最好的自己”的种种道理,你却不能够把它们身体力行,这些能够“德润身”的道理就只是些虚的道理,而坏习惯依旧像鬼魂一样形影不离地跟随着你。 ​​​​

明-洪应明-菜根谭:迷则乐境成苦海,悟则苦海为乐境。John Milton, Paradise Lost: The mind is its own place, and in it self Can make a Heav’n of Hell, a Hell of Heav’n.

“饭吃七分饱”的富兰克林表达法:在我见到的人中,饿死的人寥寥无几,撑死的人倒有成千上万。 Eat not to Dulness. Drink not to Elevation.

相当一部分中国公民以经济为惟一生活目标。科名之心不可有,经济之才不可无。Money talks. In God we trust, the rest pay cash. Money changed hands. ​​​​

子不语怪、力、乱、神。知之为知之,不知为不知,是知也。子曰:未知生,焉知死?未能事人,焉能事鬼?敬鬼神而远之。~ 疑邻偷斧,疑心生暗鬼。~ 精气为物,游魂为变。~ 一念之善,吉神随之;一念之恶,厉鬼尾之。~ 暗示能作用于心理,人的知觉伴生错觉甚至幻觉,居心不良的人就有可能在其中搞鬼。 ​

美国很有创造性的微分几何学家 H.惠特尼对数学的研究与学习的方法论方面有相当独到的见解,他认为最好的学习方法是学以致用,没有自己的想法那不是真正的学习,他对研究过程的描述相当吻合认知心理学关于知识的心理表征、认知地图、图式、问题解决与创造性的观点。​

在科学天才的头脑中进化着的科学方程,是造物主的十四行诗。牛顿以横绝一世的数学才能综合出让天文学家奉为圭臬的万有引力定律,爱因斯坦以彰显理性思维极致的广义相对论引力场方程超越之。麦克斯韦与赫维赛德提炼出以对称之美著称的电磁场方程组,狄拉克以魔法般的相对论性量子电动力学方程组令人叹为观止。

工作是银,健康是金。1992年世界卫生组织在加拿大维多利亚召开的国际心脏健康会议上发表的关于保健的《维多利亚宣言》认为健康的四大基石是:1、均衡膳食,2、戒烟限酒,3、适量运动,4、心理平衡。

1976年愚人节,乔布斯和沃兹尼克、Ronald Wayne 一起创建了苹果公司,11天后 Ronald Wayne 选择了退出,并把他名下如今价值220亿美元的10%股权以800美元卖给了乔布斯和沃兹尼克。 ​​​​有个CNN记者采访了与巨额财富失之交臂的 Ronald Wayne,Ronald Wayne 说道:”What can I say? You make a decision based on your understanding of the circumstances, and you live with it, But when you’re at a focal point of history, you don’t realize you’re at a focal point of history.”

React Native Cheat Sheet

Accessing console logs

  • react-native log-ios
  • react-native log-android

xcrun simctl list devices

  • react-native run-ios –simulator “iPhone 8”
  • react-native run-android

Sometimes you may need to reset or clear the React Native packager’s cache. To do so, you can pass the –reset-cache flag to the start script:

  • npm start – –reset-cache
  • yarn start – –reset-cache

人人都能用英语 - 李笑来

怎样才能学好英语?
一个字:“”。

digested from © 人人都能用英语

不要再 “学” 英语,你就该 “用” 英语!

你英文发音再难听,听的人也不会因此猝死;你英文语法错误再多,读的人也不会因此疼痛;别人对你说英文你没听懂或者给你看英文你没读懂,若非极端情况,你也不会因此就从此真的无颜见人。
只 “学” 不 “用”(这是大多数中国学生的写照)的下场就是在十几年之后依然在学依然无用(这是大多数中国学生的现实)。
只有不断地 “用”,才能真正地 “学”,因为所有技能的习得,都要靠试错(Trial and Error)。很多人宁愿 “学一辈子”,却坚持 “一辈子不用” 的原因就在于害怕犯错。儿时犯错往往招致惩罚,成年之后,就算没有来自他人的惩罚,还有因为犯错而导致自己自卑和尴尬,所以,很多人是 “不惜一切代价” 避免出错的。然而,要知道知识的习得过程离不开试错,没有试错,就不可能有全面而真实的进步。所以,要知道犯错是正常的,甚至是不可或缺的。做事的时候,出错是必然的,如果正在做事却一点错都没有,那不是做事──那是在做梦。

我是如何摆脱哑巴英语的?

我以前总以为学生的问题是 “不知道怎么说”(HOW)──我曾以为我自己的问题也是如此;现在我认为学生所面临的问题不仅仅是这个,更重要的是他们 “没什么话可说”(WHAT)。
后来我就养成了习惯,不再指望自己能够脱口而出,而是希望自己有备无患。每当我遇到一些要讲英文的正式场合,我一定会提前花时间先写 “逐字稿”,不会写的就去查查词典,查词典查不到的,就用 Google 搜索,连 Google 都搜不到,那就想想看有没有可替代的说法 …… 而后再花时间修订,熟悉,复述。如此这般之后,到了现场,基本上能够做到 “自如” 应对。
请允许我重复一遍:你的问题也许不在于你不会说,而在于你没什么话可说。

其实连哑巴英语都并不那么坏

说得形象点,说不出像哑巴,听不懂像聋子,读不懂像瞎子;而写不出呢?——大多数文化并不默认一个人写不了字是一种残疾。先不管能否写得出,只谈哑巴、聋子和瞎子。如果你必须成为这三种 “残疾” 中的一种,你会选哪个?我认真想过,我会选 “聋子” —— 因为不瞎不哑,起码还保留了输入和输出的渠道。我最怕成为 “瞎子” —— 因为那是最重要的输入手段,尤其是因为文字输入几乎占所有有效输入的绝大部分。某种意义上来说,学习一门外语最大的公用莫过于增加一个不一样的信息获得渠道。从这一点上来看,哑巴比聋子、瞎子强多了,而后两者之中,瞎子又远不如聋子。

发音很重要,但显然不是最重要的

中国学生往往不是不会说英文,也不是不愿说英文,更不是不能说英文,基本上都是不敢说英文。为什么不敢呢?很多原因。其中有一个是最普遍的,害怕自己的发音不标准。可是第二语言习得者发音不准不是很正常的事情么?就算是母语,我们都是花了很长时间才可以做到基本上说清楚的。当你能够用母语清楚地表达自己的时候,多大了?那凭什么一个人可以从一开始就能用第二语言做到清楚准确表达呢?并且还要 “发音标准”?
全世界所有的语言都是如此,每种语言都有各种各样的口音。英语也许是地球上口音最多的语言。在美国,南加利福尼亚和北加利福尼亚的口音就已经非常不同,大 抵上相当于在中国山东人之间山西人讲中文的差异。纽约人和底特律人的发音当然也非常不一样。在伦敦,东部和南部的口音差异就已经非常明显。更不消说还有 “苏格兰口音”、“加拿大口音”、“澳大利亚口音”、“新西兰口音”、“印度口音”……
为将英语作为第二语言使用的人,完全不必因为自己的发音不标准、不好听、不清楚感到自卑,那其实是正常的、自然的、不可避免的。而语言使用,本质上以沟通为目的。要知道仅仅发音标准,并不意味着说就肯定可以有效沟通。有效沟通还需要用词、文法、逻辑、内容等等更多因素,而后面提到的所有这些因素,无一不比 “标准发音” 更重要。想像一下吧,联合国开会的时候,难道每个国家的发言人都用的是 “标准英音”?或者 “标准美音”?尽管每个国家的发言人都要用英文发言,但全都用掺杂自己特定口音,可是从未影响有效沟通。

多听多听再多听

最有效的方法其实是零成本的 —— 大幅度提高听觉输入量。
我常常建议自己的学生不要把自己的输入材料只限制于 “标准美音” 或者 “标准英音”;其实无所谓的,连颇具特色的 “黑人英语” 都可以听,甚至,越杂越好。我常常推荐的是CNN的广播,里面有各种各样腔调的英语,真的可以大开 “耳” 界。
有一个小技巧,听英语音频的时候不要两只耳朵全都戴上耳机 —— 只用一只耳朵戴耳机。因为自然语音输入和耳机输入是不一样的。在自然环境中,我们听到的语言语音从来都不是 “单独” 的 —— 总是伴随着各种各样的背景声音。戴着耳机的时候却基本上就只有 “纯粹的语音” 了,这对我们重建自己的语音过滤器来说并不是好事。只用一只耳朵戴耳机的另外一个好处是可以经常换着耳朵听,不至于损伤耳朵。
至少要坚持六个月,我个人建议每天的输入时间不要低于四个小时 —— 只要开始做,就会发现其实并不难,因为 “哪怕听不懂都无所谓”。听得多了,听得久了,早晚有一天想听不懂都不太容易。当然,即便是最初的时候,为了效果更佳,可以有意识地渐渐提高文本难度,并且最好配合精读。这期间几乎所有的人都会感觉没什么进步,但是,这种 “感觉” 是不靠谱的 —— 事实上,我们的感觉几乎总是极不靠谱。

一定要学会音标

中国学生学习音标还有另外一个苦恼。我们的课本里大多所使用的是 D.J.音标(英音),但这并不是唯一的音标体系。除了 D.J.之外,有些地方的教材使用的是 K.K.音标(美音);牛津词典和剑桥词典尽管都声称自己使用的是 IPA 国际音标,但多多少少各不相同;而有些学生在准备 SAT 或者 GRE 的时候,根据学长的建议开始使用 Merriam-Webster 词典,结果发现里面是彻头彻尾另外一个体系的音标 —— 事实上,几乎市面上所有的词典都在使用各不相同的音标体系。原本就不太好学的东西却又有那么多的版本 —— 当然更加令人气馁。

跟读训练具体步骤

拿来跟读材料之后,第一步是精读文本。不认识的词全部都要查过,然后确定该单词在当前句子中的确切含义,而后抄写在文本边上。当然,今天我们还有 MS Word,可以很方便地在文本上添加 “批注”。而在 Word 里,还有一个内建的词典,非常好用 …… 如果每个单词全都查过,却依然搞不懂句意,那么往往应该是有词组存在,再逐一查过。
查每一个生词的时候,都要记录重音和元音长度(必要时把整个音标写下来,也可以使用简化标记法)。
第二步是反复听录音,做自然语流修正标记。
第三步了。反复跟读。刚开始可以录音放一句,自己跟几遍,细心纠正自己的前提是大声朗读。熟悉了之后再录音放一句就跟一句,再熟悉一点之后就 “异步” 朗读。所谓的异步朗读,就是 “慢一拍跟读”。听到录音说了一个词之后我们再开始,嘴里重复的是录音里刚刚说完的那个词,而耳朵里同时听到的是自己的声音和录音里所说的下一个词,然后循环往复,在录音说完一句话的时候,我们再说一个词也就正好结束。这种训练可以很微妙地提高我们的英语瞬间记忆力。再熟悉到一定程度的时候,就可以 “同步” 朗读了。
第四步是录音矫正。每隔一段时间,可以把自己的朗读声音录下来存好,过上一个星期之后再翻出来听。很多人事倍功半的原因是录下来之后马上就去听,但这样的话,基本上没有什么矫正余地 —— 因为录音之后和录音之前的你还没有任何变化呢。当时你就觉得那么说是对的所以才那么说的,仅仅两三分钟之后,你不可能有什么巨大的或者哪怕是足够的进步;于是,没有变化的你,其实根本听不出自己哪儿不对了,也没有能力为自己进行矫正。但是,你一直在练,每天都在练,一个星期之后,你的进步就算不是巨大也是足够,于是你可能就会很容易地听出若干出过去出错的地方。

朗读

朗读是语文教育的最古老、最普及、成本最低、效果最好的训练方式。
说来可惜,但大多数人确实并不重视朗读训练 —— 无论是母语还是外语的习得过程中都是如此。朗读训练既简单又有效,并且可以解决很多许多人花很多钱去各种各样的培训班解决不了的问题。
朗读训练是提高文字理解能力的最有效方式。
朗读训练会潜移默化地提高阅读理解速度
不必专门练习听力,朗读就够了
大量的朗读训练,可以使学生不必专门练习 “听力”。某种意义上,很多学生花费时间去专门练习听力其实非常荒谬。不聋不哑的正常人是没必要专门训练什么听力的,事实上也没办法专门练 —— 大家的耳朵构造是相同的,怎么练耳廓也不会增大,耳膜也不会变得更薄……
其实道理很简单,只要说得出,就能听得懂 —— 不管是哪一种语言。所以,只需要练说,而没必要专门练听。很多人所谓的 “听力不好” 其实是说得不好造成的,然而,他们舍本求末,就是不说,而后专门练听,这不是荒唐是什么?事实上,哪怕说得不好,也一样能够听懂。举例来说,我国有很多地区的人普通话说得并不标准,讲话掺杂着浓重的本地口音,甚至使用大量的本地特有词汇,但是,你遇到过他们之中的哪一个向你抱怨说中央电视台的新闻联播听不懂么?
听写训练几乎是最浪费时间最无效果的所谓方法了。
朗读训练可以提高语言文字记忆能力
朗读训练能够提高表达能力
朗读训练可以提高语言文字模式识别能力

词典

查词典与朗读一样是提高阅读理解能力的最直接有效的手段之一。
英语老师与学生最大的不同可能只有一个,英语老师必须查词典(如果还有别的话,就是语法书之类的参考书),而学生却有除了查词典之外的另外一个选择 ——参加各种各样的课程。英语课上老师做什么呢?其实大抵上只不过是把昨天晚上他查过的单词、词组,以及他通过查词典(以及其它的工具书)再动脑才搞明白的句子给学生们讲一遍。而学生呢?做在下面听。学生们倒是听了,然而,本质上却没有参与阅读理解的过程 —— 那个过程里应该有苦恼、迷失、无助、慌张(人人都讨厌这些)和恍然大悟(人人都想只要这个);所以大多学生根本就没有动脑,于是顶多是以为自己搞懂了(事实上,没有之前的两个境界的铺垫,“蓦然回首” 根本看不见 “那人站在灯火阑珊处” 的。)
查词典并不难。但多一点点细心和耐心,却并不像想象得那么容易。
中国学生为什么总是疏于去查 “phrasal verb dictionary” 或者 “dictionary of idioms”
关于 Merriam-Webster 的权威性,基本上不容置疑。Merriam-Webster 的电子版,目前在网上可以找得到的有两种版本:2.5 版和 3.0 版。我个人认为 3.0 版并没有什么真正有意义的改进。2.5 版反倒相对更好用一些。
Merriam-Webster 电子版的 “真人发音”,是我个人认为目前可以找到的所有电子版词典中制作最为精良的 —— 发音最清晰(准确当然不用提),音量最稳定。
最后,Merriam-Webster 最牛的地方在于它有一个 “Spelling Help”。查找英文单词的时候,一个常见的窘境是,我们只知道某个单词的发音却不知道拼写,于是无法查到那个单词。然而,有了 “Spelling Help”,就非常方便了。
Collins Cobuild – Lexicon on CD-ROM我所推荐使用的是这部词典电子版的第三版,而非最新的第五版。

把 Word 打造成英语学习利器

对中国学生来说,MS Word 不仅仅是 “字处理工具”,更是一个非常强大的学习利器。
MS Word 2007 的 “鼠标取词” 功能
MS Word 2007 的 “词典面板”
MS Word 2007 的 “同近义辞典”(Thesaurus)
MS Word 2007 的 “英语助手”
为 MS Word 2007 设置单词朗读功能
用 Word 2007 为自己定制阅读文章词汇列表

LeetCode - Algorithms - 215. Kth Largest Element in an Array

It seemed that every leetcode algorithms problem has mulple solutions, so do this one. I just verified solutions of other peer.

Java

Quickselect

© Quickselect: Kth Greatest Value

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Solution {
private void exch(int[] a, int i, int j) {
int swap = a[i];
a[i] = a[j];
a[j] = swap;
}

private int partition(int[] a, int lo, int hi) {
int pivot = lo + new Random().nextInt(hi - lo + 1);
exch(a, hi, pivot);
for (int i = lo; i < hi; i++) {
if (a[i] > a[hi]) {
exch(a, i, lo);
lo++;
}
}
exch(a, lo, hi);
return lo;
}

private int quickselect(int[] a, int left, int right, int k) {
if (left <= right) {
int pivot = partition(a, left, right);
if (pivot == k) {
return a[k];
}
if (pivot > k) {
return quickselect(a, left, pivot - 1, k);
}
return quickselect(a, pivot + 1, right, k);
}
return Integer.MIN_VALUE;
}

public int findKthLargest(int[] nums, int k) {
return quickselect(nums, 0, nums.length - 1, k - 1);
}
}

Submission Detail

  • 32 / 32 test cases passed.
  • Runtime: 1 ms, faster than 98.04% of Java online submissions for Kth Largest Element in an Array.
  • Memory Usage: 39.3 MB, less than 11.22% of Java online submissions for Kth Largest Element in an Array.

Solution 1: sorting

1
2
3
4
5
6
7
8
import java.util.Arrays;

class Solution {
public int findKthLargest(int[] nums, int k) {
Arrays.sort(nums);
return nums[nums.length - k];
}
}

Submission Detail

  • 32 / 32 test cases passed.
  • Runtime: 3 ms, faster than 84.58% of Java online submissions for Kth Largest Element in an Array.
  • Memory Usage: 35.7 MB, less than 98.57% of Java online submissions for Kth Largest Element in an Array.

Solution 2: min heap

1
2
3
4
5
6
7
8
9
10
11
12
13
import java.util.PriorityQueue;

class Solution {
public int findKthLargest(int[] nums, int k) {
PriorityQueue<Integer> minHeap = new PriorityQueue<Integer>(k);
for(int i : nums) {
minHeap.offer(i);
if (minHeap.size()>k)
minHeap.poll();
}
return minHeap.peek();
}
}

Submission Detail

  • 32 / 32 test cases passed.
  • Runtime: 8 ms, faster than 51.68% of Java online submissions for Kth Largest Element in an Array.
  • Memory Usage: 35.7 MB, less than 98.37% of Java online submissions for Kth Largest Element in an Array.

Solution 3: a similar method like quick sort

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class Solution {
public int findKthLargest(int[] nums, int k) {
if (k < 1 || nums == null) {
return 0;
}
return getKth(nums.length - k + 1, nums, 0, nums.length - 1);
}

private int getKth(int k, int[] nums, int start, int end) {
int pivot = nums[end];
int left = start;
int right = end;
while (true) {
while (nums[left] < pivot && left < right) {
left++;
}
while (nums[right] >= pivot && right > left) {
right--;
}
if (left == right) {
break;
}
swap(nums, left, right);
}
swap(nums, left, end);
if (k == left + 1) {
return pivot;
} else if (k < left + 1) {
return getKth(k, nums, start, left - 1);
} else {
return getKth(k, nums, left + 1, end);
}
}

private void swap(int[] arr, int i, int j) {
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}

Submission Detail

  • 32 / 32 test cases passed.
  • Runtime: 22 ms, faster than 37.24% of Java online submissions for Kth Largest Element in an Array.
  • Memory Usage: 37.5 MB, less than 94.43% of Java online submissions for Kth Largest Element in an Array.

The Story of Maths - 4. To Infinity and Beyond - Subtitles

texts below are from © https://subsaga.com/bbc/documentaries/science/the-story-of-maths/4-to-infinity-and-beyond.html


1
00:00:17,280 –> 00:00:21,400
Mathematics is about solving problems

2
00:00:21,400 –> 00:00:26,240
and it’s the great unsolved problems that make maths really alive.

3
00:00:28,240 –> 00:00:29,440
In the summer of 1900,

4
00:00:29,440 –> 00:00:32,160
the International Congress of Mathematicians

5
00:00:32,160 –> 00:00:34,440
was held here in Paris in the Sorbonne.

6
00:00:34,440 –> 00:00:36,680
It was a pretty shambolic affair,

7
00:00:36,680 –> 00:00:39,280
not helped by the sultry August heat.

8
00:00:39,280 –> 00:00:43,000
But it will be remembered as one of the greatest congresses of all time

9
00:00:43,000 –> 00:00:47,360
thanks to a lecture given by the up-and-coming David Hilbert.

10
00:00:48,880 –> 00:00:51,600
Hilbert, a young German mathematician,

11
00:00:51,600 –> 00:00:56,360
boldly set out what he believed were the 23 most important problems

12
00:00:56,360 –> 00:00:58,560
for mathematicians to crack.

13
00:00:58,560 –> 00:01:04,200
He was trying to set the agenda for 20th-century maths and he succeeded.

14
00:01:04,200 –> 00:01:09,480
These Hilbert problems would define the mathematics of the modern age.

15
00:01:09,480 –> 00:01:15,360
Of those who tried to crack Hilbert’s challenges, some would experience immense triumphs,

16
00:01:15,360 –> 00:01:18,920
whilst others would be plunged into infinite despair.

17
00:01:30,120 –> 00:01:33,120
The first problem on Hilbert’s list emerged from here,

18
00:01:33,120 –> 00:01:36,320
Halle, in East Germany.

19
00:01:36,320 –> 00:01:41,200
It was where the great mathematician Georg Cantor spent all his adult life.

20
00:01:41,200 –> 00:01:45,280
And where he became the first person to really understand the meaning

21
00:01:45,280 –> 00:01:50,160
of infinity and give it mathematical precision.

22
00:01:50,160 –> 00:01:52,480
The statue in the town square, however,

23
00:01:52,480 –> 00:01:57,360
honours Halle’s other famous son, the composer George Handel.

24
00:01:57,360 –> 00:02:03,600
To discover more about Cantor, I had to take a tram way out of town.

25
00:02:03,600 –> 00:02:07,000
For 50 years, Halle was part of Communist East Germany

26
00:02:07,000 –> 00:02:10,320
and the Communists loved celebrating their scientists.

27
00:02:10,320 –> 00:02:15,000
So much so, they put Cantor on the side of a large cube that they commissioned.

28
00:02:15,000 –> 00:02:17,640
But, being communists, they didn’t put the cube

29
00:02:17,640 –> 00:02:20,720
in the middle of town. They put it out amongst the people.

30
00:02:24,320 –> 00:02:27,840
When I eventually found the estate, I started to fear

31
00:02:27,840 –> 00:02:31,200
that maybe I had got the location wrong.

32
00:02:34,480 –> 00:02:38,680
This looks the most unlikely venue for a statue to a mathematician.

33
00:02:39,960 –> 00:02:41,840
Excuse me?

34
00:02:42,840 –> 00:02:43,960
Ein Frage.

35
00:02:43,960 –> 00:02:47,560

  • Can you help me a minute?
  • Wie bitte?
  • Do you speak English?
  • No!
  • No?

36
00:02:47,560 –> 00:02:49,600
Ich suche ein Wurfel.

37
00:02:49,600 –> 00:02:51,600
Ein Wurfel, ja?

38
00:02:51,600 –> 00:02:52,880
Is that right? A “Wurfel”?

39
00:02:52,880 –> 00:02:55,160
A cube? Yeah? Like that?

40
00:02:55,160 –> 00:02:58,680
Mit ein Bild der Mathematiker?

41
00:02:58,680 –> 00:03:01,160
Yeah? Go round there?

42
00:03:01,160 –> 00:03:02,440
Die Name ist Cantor.

43
00:03:02,440 –> 00:03:04,560
Somewhere over here. Ah! There it is!

44
00:03:04,560 –> 00:03:06,080
It’s much bigger than I thought.

45
00:03:06,080 –> 00:03:09,720
I thought it was going to be something like this sort of size.

46
00:03:09,720 –> 00:03:13,760
Aha, here we are. On the dark side of the cube.

47
00:03:13,760 –> 00:03:16,120
here’s the man himself, Cantor.

48
00:03:16,120 –> 00:03:18,880
Cantor’s one of my big heroes actually.

49
00:03:18,880 –> 00:03:23,040
I think if I had to choose some theorems that I wish I’d proved,

50
00:03:23,040 –> 00:03:25,040
I think the couple that Cantor proved

51
00:03:25,040 –> 00:03:27,920
would be up there in my top ten.

52
00:03:27,920 –> 00:03:30,200
‘This is because before Cantor,

53
00:03:30,200 –> 00:03:33,200
‘no-one had really understood infinity.’

54
00:03:33,200 –> 00:03:38,080
It was a tricky, slippery concept that didn’t seem to go anywhere.

55
00:03:38,080 –> 00:03:42,680
But Cantor showed that infinity could be perfectly understandable.

56
00:03:42,680 –> 00:03:45,640
Indeed, there wasn’t just one infinity,

57
00:03:45,640 –> 00:03:48,120
but infinitely many infinities.

58
00:03:48,120 –> 00:03:54,400
First Cantor took the numbers 1, 2, 3, 4 and so on.

59
00:03:54,400 –> 00:03:58,000
Then he thought about comparing them with a much smaller set…

60
00:03:58,000 –> 00:04:02,720
something like 10, 20, 30, 40…

61
00:04:02,720 –> 00:04:06,320
What he showed is that these two infinite sets of numbers

62
00:04:06,320 –> 00:04:10,640
actually have the same size because we can pair them up -

63
00:04:10,640 –> 00:04:14,520
1 with 10, 2 with 20, 3 with 30 and so on.

64
00:04:14,520 –> 00:04:17,880
So these are the same sizes of infinity.

65
00:04:20,640 –> 00:04:22,680
But what about the fractions?

66
00:04:22,680 –> 00:04:27,520
After all, there are infinitely many fractions between any two whole numbers.

67
00:04:27,520 –> 00:04:30,760
Surely the infinity of fractions is much bigger

68
00:04:30,760 –> 00:04:33,360
than the infinity of whole numbers.

69
00:04:38,360 –> 00:04:41,600
Well, what Cantor did was to find a way to pair up

70
00:04:41,600 –> 00:04:45,400
all of the whole numbers with an infinite load of fractions.

71
00:04:45,400 –> 00:04:47,280
And this is how he did it.

72
00:04:47,280 –> 00:04:52,520
He started by arranging all the fractions in an infinite grid.

73
00:04:52,520 –> 00:04:57,160
The first row contained the whole numbers, fractions with one on the bottom.

74
00:04:57,160 –> 00:05:01,720
In the second row came the halves, fractions with two on the bottom.

75
00:05:01,720 –> 00:05:06,280
And so on. Every fraction appears somewhere in this grid.

76
00:05:06,280 –> 00:05:10,320
Where’s two thirds? Second column, third row.

77
00:05:10,320 –> 00:05:15,560
Now imagine a line snaking back and forward diagonally through the fractions.

78
00:05:18,080 –> 00:05:24,920
By pulling this line straight, we can match up every fraction with one of the whole numbers.

79
00:05:24,920 –> 00:05:29,280
This means the fractions are the same sort of infinity

80
00:05:29,280 –> 00:05:31,080
as the whole numbers.

81
00:05:31,080 –> 00:05:34,120
So perhaps all infinities have the same size.

82
00:05:34,120 –> 00:05:36,680
Well, here comes the really exciting bit

83
00:05:36,680 –> 00:05:41,080
because Cantor now considers the set of all infinite decimal numbers.

84
00:05:41,080 –> 00:05:45,320
And here he proves that they give us a bigger infinity because

85
00:05:45,320 –> 00:05:49,320
however you tried to list all the infinite decimals, Cantor produced

86
00:05:49,320 –> 00:05:52,480
a clever argument to show how to construct a new decimal number

87
00:05:52,480 –> 00:05:54,200
that was missing from your list.

88
00:05:54,200 –> 00:05:58,240
Suddenly, the idea of infinity opens up.

89
00:05:58,240 –> 00:06:01,840
There are different infinities, some bigger than others.

90
00:06:01,840 –> 00:06:03,600
It’s a really exciting moment.

91
00:06:03,600 –> 00:06:07,880
For me, this is like the first humans understanding how to count.

92
00:06:07,880 –> 00:06:12,120
But now we’re counting in a different way. We are counting infinities.

93
00:06:12,120 –> 00:06:18,080
A door has opened and an entirely new mathematics lay before us.

94
00:06:19,320 –> 00:06:21,480
But it never helped Cantor much.

95
00:06:21,480 –> 00:06:25,240
I was in the cemetery in Halle where he is buried

96
00:06:25,240 –> 00:06:28,280
and where I had arranged to meet Professor Joe Dauben.

97
00:06:28,280 –> 00:06:32,720
He was keen to make the connections between Cantor’s maths and his life.

98
00:06:33,720 –> 00:06:36,280
He suffered from manic depression.

99
00:06:36,280 –> 00:06:39,680
One of the first big breakdowns he has is in 1884

100
00:06:39,680 –> 00:06:42,160
but then around the turn of the century

101
00:06:42,160 –> 00:06:44,720
these recurrences of the mental illness

102
00:06:44,720 –> 00:06:46,760
become more and more frequent.

103
00:06:46,760 –> 00:06:49,720
A lot of people have tried to say that his mental illness

104
00:06:49,720 –> 00:06:53,120
was triggered by the incredible abstract mathematics he dealt with.

105
00:06:53,120 –> 00:06:57,280
Well, he was certainly struggling, so there may have been a connection.

106
00:06:57,280 –> 00:07:01,920
Yeah, I mean I must say, when you start to contemplate the infinite…

107
00:07:01,920 –> 00:07:05,080
I am pretty happy with the bottom end of the infinite,

108
00:07:05,080 –> 00:07:07,240
but as you build it up more and more,

109
00:07:07,240 –> 00:07:09,920
I must say I start to feel a bit unnerved

110
00:07:09,920 –> 00:07:13,280
about what’s going on here and where is it going.

111
00:07:13,280 –> 00:07:17,880
For much of Cantor’s life, the only place it was going was here -

112
00:07:17,880 –> 00:07:20,280
the university’s sanatorium.

113
00:07:20,280 –> 00:07:24,040
There was no treatment then for manic depression

114
00:07:24,040 –> 00:07:27,920
or indeed for the paranoia that often accompanied Cantor’s attacks.

115
00:07:27,920 –> 00:07:30,800
Yet the clinic was a good place to be -

116
00:07:30,800 –> 00:07:33,560
comfortable, quiet and peaceful.

117
00:07:33,560 –> 00:07:37,800
And Cantor often found his time here gave him the mental strength

118
00:07:37,800 –> 00:07:41,120
to resume his exploration of the infinite.

119
00:07:41,120 –> 00:07:44,480
Other mathematicians would be bothered by the paradoxes

120
00:07:44,480 –> 00:07:46,400
that Cantor’s work had created.

121
00:07:46,400 –> 00:07:50,480
Curiously, this was one thing Cantor was not worried by.

122
00:07:50,480 –> 00:07:53,800
He was never as upset about the paradox of the infinite

123
00:07:53,800 –> 00:07:56,960
as everybody else was because Cantor believed that

124
00:07:56,960 –> 00:08:00,240
there are certain things that I have been able to show,

125
00:08:00,240 –> 00:08:03,640
we can establish with complete mathematical certainty

126
00:08:03,640 –> 00:08:08,040
and then the absolute infinite which is only in God.

127
00:08:08,040 –> 00:08:12,360
He can understand all of this and there’s still that final paradox

128
00:08:12,360 –> 00:08:15,400
that is not given to us to understand, but God does.

129
00:08:18,000 –> 00:08:22,280
But there was one problem that Cantor couldn’t leave

130
00:08:22,280 –> 00:08:23,720
in the hands of the Almighty,

131
00:08:23,720 –> 00:08:26,320
a problem he wrestled with for the rest of his life.

132
00:08:26,320 –> 00:08:29,920
It became known as the continuum hypothesis.

133
00:08:29,920 –> 00:08:33,200
Is there an infinity sitting between the smaller infinity

134
00:08:33,200 –> 00:08:37,760
of all the whole numbers and the larger infinity of the decimals?

135
00:08:40,640 –> 00:08:45,080
Cantor’s work didn’t go down well with many of his contemporaries

136
00:08:45,080 –> 00:08:48,760
but there was one mathematician from France who spoke up for him,

137
00:08:48,760 –> 00:08:51,680
arguing that Cantor’s new mathematics of infinity

138
00:08:51,680 –> 00:08:54,840
was “beautiful, if pathological”.

139
00:08:54,840 –> 00:09:00,480
Fortunately this mathematician was the most famous and respected mathematician of his day.

140
00:09:00,480 –> 00:09:04,160
When Bertrand Russell was asked by a French politician who he thought

141
00:09:04,160 –> 00:09:08,720
the greatest man France had produced, he replied without hesitation, “Poincare”.

142
00:09:08,720 –> 00:09:10,840
The politician was surprised that he’d chosen

143
00:09:10,840 –> 00:09:14,680
the prime minister Raymond Poincare above the likes of Napoleon, Balzac.

144
00:09:14,680 –> 00:09:19,040
Russell replied, “I don’t mean Raymond Poincare but his cousin,

145
00:09:19,040 –> 00:09:21,720
“the mathematician, Henri Poincare.”

146
00:09:25,480 –> 00:09:28,720
Henri Poincare spent most of his life in Paris,

147
00:09:28,720 –> 00:09:32,520
a city that he loved even with its uncertain climate.

148
00:09:32,520 –> 00:09:36,400
In the last decades of the 19th century, Paris was a centre

149
00:09:36,400 –> 00:09:40,720
for world mathematics and Poincare became its leading light.

150
00:09:40,720 –> 00:09:44,680
Algebra, geometry, analysis, he was good at everything.

151
00:09:44,680 –> 00:09:47,800
His work would lead to all kinds of applications,

152
00:09:47,800 –> 00:09:50,600
from finding your way around on the underground,

153
00:09:50,600 –> 00:09:54,280
to new ways of predicting the weather.

154
00:09:54,280 –> 00:09:57,240
Poincare was very strict about his working day.

155
00:09:57,240 –> 00:09:59,040
Two hours of work in the morning

156
00:09:59,040 –> 00:10:01,080
and two hours in the early evening.

157
00:10:01,080 –> 00:10:02,480
Between these periods,

158
00:10:02,480 –> 00:10:06,160
he would let his subconscious carry on working on the problem.

159
00:10:06,160 –> 00:10:10,240
He records one moment when he had a flash of inspiration which occurred

160
00:10:10,240 –> 00:10:14,760
almost out of nowhere, just as he was getting on a bus.

161
00:10:16,720 –> 00:10:21,480
And one such flash of inspiration led to an early success.

162
00:10:21,480 –> 00:10:25,120
In 1885, King Oscar II of Sweden and Norway

163
00:10:25,120 –> 00:10:32,320
offered a prize of 2,500 crowns for anyone who could establish mathematically once and for all

164
00:10:32,320 –> 00:10:36,680
whether the solar system would continue turning like clockwork,

165
00:10:36,680 –> 00:10:38,640
or might suddenly fly apart.

166
00:10:38,640 –> 00:10:44,720
If the solar system has two planets then Newton had already proved that their orbits would be stable.

167
00:10:44,720 –> 00:10:48,720
The two bodies just travel in ellipsis round each other.

168
00:10:48,720 –> 00:10:53,600
But as soon as soon as you add three bodies like the earth, moon and sun,

169
00:10:53,600 –> 00:10:58,880
the question of whether their orbits were stable or not stumped even the great Newton.

170
00:10:58,880 –> 00:11:03,040
The problem is that now you have some 18 different variables,

171
00:11:03,040 –> 00:11:05,280
like the exact coordinates of each body

172
00:11:05,280 –> 00:11:07,440
and their velocity in each direction.

173
00:11:07,440 –> 00:11:10,720
So the equations become very difficult to solve.

174
00:11:10,720 –> 00:11:15,680
But Poincare made significant headway in sorting them out.

175
00:11:15,680 –> 00:11:21,720
Poincare simplified the problem by making successive approximations to the orbits which he believed

176
00:11:21,720 –> 00:11:24,880
wouldn’t affect the final outcome significantly.

177
00:11:24,880 –> 00:11:28,120
Although he couldn’t solve the problem in its entirety,

178
00:11:28,120 –> 00:11:33,240
his ideas were sophisticated enough to win him the prize.

179
00:11:33,240 –> 00:11:36,640
He developed this great sort of arsenal of techniques,

180
00:11:36,640 –> 00:11:38,320
mathematical techniques

181
00:11:38,320 –> 00:11:40,880
in order to try and solve it

182
00:11:40,880 –> 00:11:44,040
and in fact, the prize that he won was essentially

183
00:11:44,040 –> 00:11:47,520
more for the techniques than for solving the problem.

184
00:11:47,520 –> 00:11:51,280
But when Poincare’s paper was being prepared for publication

185
00:11:51,280 –> 00:11:54,320
by the King’s scientific advisor, Mittag-Leffler,

186
00:11:54,320 –> 00:11:56,360
one of the editors found a problem.

187
00:11:58,920 –> 00:12:02,440
Poincare realised he’d made a mistake.

188
00:12:02,440 –> 00:12:06,560
Contrary to what he had originally thought, even a small change in the

189
00:12:06,560 –> 00:12:10,720
initial conditions could end up producing vastly different orbits.

190
00:12:10,720 –> 00:12:13,440
His simplification just didn’t work.

191
00:12:13,440 –> 00:12:17,040
But the result was even more important.

192
00:12:17,040 –> 00:12:24,080
The orbits Poincare had discovered indirectly led to what we now know as chaos theory.

193
00:12:24,080 –> 00:12:29,120
Understanding the mathematical rules of chaos explain why a butterfly’s wings

194
00:12:29,120 –> 00:12:31,600
could create tiny changes in the atmosphere

195
00:12:31,600 –> 00:12:33,320
that ultimately might cause

196
00:12:33,320 –> 00:12:37,520
a tornado or a hurricane to appear on the other side of the world.

197
00:12:37,520 –> 00:12:40,400
So this big subject of the 20th century, chaos,

198
00:12:40,400 –> 00:12:43,600
actually came out of a mistake that Poincare made

199
00:12:43,600 –> 00:12:45,400
and he spotted at the last minute.

200
00:12:45,400 –> 00:12:49,040
Yes! So the essay had actually been published in its original form,

201
00:12:49,040 –> 00:12:54,240
and was ready to go out and Mittag-Leffler had sent copies out to various people,

202
00:12:54,240 –> 00:12:59,400
and it was to his horror when Poincare wrote to him to say, “Stop!”

203
00:12:59,400 –> 00:13:03,120
Oh, my God. This is every mathematician’s worst nightmare.

204
00:13:03,120 –> 00:13:04,640
Absolutely. “Pull it!”

205
00:13:04,640 –> 00:13:06,160
Hold the presses!

206
00:13:07,360 –> 00:13:10,280
Owning up to his mistake, if anything,

207
00:13:10,280 –> 00:13:12,920
enhanced Poincare’s reputation.

208
00:13:12,920 –> 00:13:15,800
He continued to produce a wide range of original work

209
00:13:15,800 –> 00:13:16,960
throughout his life.

210
00:13:16,960 –> 00:13:20,000
Not just specialist stuff either.

211
00:13:20,000 –> 00:13:24,480
He also wrote popular books, extolling the importance of maths.

212
00:13:24,480 –> 00:13:28,560
Here we go. Here’s a section on the future of mathematics.

213
00:13:30,080 –> 00:13:34,240
It starts, “If we wish to foresee the future of mathematics,

214
00:13:34,240 –> 00:13:39,240
“our proper course is to study the history and present the condition of the science.”

215
00:13:39,240 –> 00:13:45,000
So, I think Poincare might have approved of my journey to uncover the story of maths.

216
00:13:45,000 –> 00:13:48,120
He certainly would have approved of the next destination.

217
00:13:48,120 –> 00:13:53,400
Because to discover perhaps Poincare’s most important contribution to modern mathematics,

218
00:13:53,400 –> 00:13:56,320
I had to go looking for a bridge.

219
00:13:59,800 –> 00:14:01,480
Seven bridges in fact.

220
00:14:01,480 –> 00:14:04,160
The Seven bridges of Konigsberg.

221
00:14:04,160 –> 00:14:09,280
Today the city is known as Kaliningrad, a little outpost

222
00:14:09,280 –> 00:14:14,240
of Russia on the Baltic Sea surrounded by Poland and Lithuania.

223
00:14:14,240 –> 00:14:18,000
Until 1945, however, when it was ceded to the Soviet Union,

224
00:14:18,000 –> 00:14:21,120
it was the great Prussian City of Konigsberg.

225
00:14:22,640 –> 00:14:25,920
Much of the old town sadly has been demolished.

226
00:14:25,920 –> 00:14:29,800
There is now no sign at all of two of the original seven bridges

227
00:14:29,800 –> 00:14:34,400
and several have changed out of all recognition.

228
00:14:34,400 –> 00:14:38,000
This is one of the original bridges.

229
00:14:38,000 –> 00:14:44,640
It may seem like an unlikely setting for the beginning of a mathematical story, but bear with me.

230
00:14:44,640 –> 00:14:47,920
It started as an 18th-century puzzle.

231
00:14:47,920 –> 00:14:53,160
Is there a route around the city which crosses each of these seven bridges only once?

232
00:14:53,160 –> 00:14:57,240
Finding the solution is much more difficult than it looks.

233
00:15:07,200 –> 00:15:11,040
It was eventually solved by the great mathematician Leonhard Euler,

234
00:15:11,040 –> 00:15:15,400
who in 1735 proved that it wasn’t possible.

235
00:15:15,400 –> 00:15:19,680
There could not be a route that didn’t cross at least one bridge twice.

236
00:15:19,680 –> 00:15:23,200
He solved the problem by making a conceptual leap.

237
00:15:23,200 –> 00:15:27,440
He realised, you don’t really care what the distances are between the bridges.

238
00:15:27,440 –> 00:15:31,480
What really matters is how the bridges are connected together.

239
00:15:31,480 –> 00:15:37,920
This is a problem of a new sort of geometry of position - a problem of topology.

240
00:15:37,920 –> 00:15:40,960
Many of us use topology every day.

241
00:15:40,960 –> 00:15:43,440
Virtually all metro maps the world over

242
00:15:43,440 –> 00:15:46,040
are drawn on topological principles.

243
00:15:46,040 –> 00:15:49,400
You don’t care how far the stations are from each other

244
00:15:49,400 –> 00:15:51,200
but how they are connected.

245
00:15:51,200 –> 00:15:53,840
There isn’t a metro in Kaliningrad,

246
00:15:53,840 –> 00:15:58,560
but there is in the nearest other Russian city, St Petersburg.

247
00:15:58,560 –> 00:16:00,720
The topology is pretty easy on this map.

248
00:16:00,720 –> 00:16:03,200
It’s the Russian I am having difficulty with.

249
00:16:03,200 –> 00:16:06,360

  • Can you tell me which…?
  • What’s the problem?

250
00:16:06,360 –> 00:16:09,760
I want to know what station this one was.

251
00:16:09,760 –> 00:16:12,840
I had it the wrong way round even!

252
00:16:14,640 –> 00:16:18,280
Although topology had its origins in the bridges of Konigsberg,

253
00:16:18,280 –> 00:16:22,520
it was in the hands of Poincare that the subject evolved

254
00:16:22,520 –> 00:16:26,120
into a powerful new way of looking at shape.

255
00:16:26,120 –> 00:16:29,840
Some people refer to topology as bendy geometry

256
00:16:29,840 –> 00:16:34,640
because in topology, two shapes are the same if you can bend or morph

257
00:16:34,640 –> 00:16:37,240
one into another without cutting it.

258
00:16:37,240 –> 00:16:42,360
So for example if I take a football or rugby ball, topologically they

259
00:16:42,360 –> 00:16:46,480
are the same because one can be morphed into the other.

260
00:16:46,480 –> 00:16:51,960
Similarly a bagel and a tea-cup are the same because one can be morphed into the other.

261
00:16:51,960 –> 00:16:58,720
Even very complicated shapes can be unwrapped to become much simpler from a topological point of view.

262
00:16:58,720 –> 00:17:02,760
But there is no way to continuously deform a bagel to morph it into a ball.

263
00:17:02,760 –> 00:17:06,560
The hole in the middle makes these shapes topologically different.

264
00:17:06,560 –> 00:17:11,800
Poincare knew all the possible two-dimensional topological surfaces.

265
00:17:11,800 –> 00:17:15,560
But in 1904 he came up with a topological problem

266
00:17:15,560 –> 00:17:17,480
he just couldn’t solve.

267
00:17:17,480 –> 00:17:21,320
If you’ve got a flat two-dimensional universe then Poincare worked out

268
00:17:21,320 –> 00:17:24,520
all the possible shapes he could wrap that universe up into.

269
00:17:24,520 –> 00:17:29,600
It could be a ball or a bagel with one hole, two holes or more holes in.

270
00:17:29,600 –> 00:17:35,200
But we live in a three-dimensional universe so what are the possible shapes that our universe can be?

271
00:17:35,200 –> 00:17:39,240
That question became known as the Poincare Conjecture.

272
00:17:39,240 –> 00:17:43,960
It was finally solved in 2002 here in St Petersburg

273
00:17:43,960 –> 00:17:47,560
by a Russian mathematician called Grisha Perelman.

274
00:17:47,560 –> 00:17:51,240
His proof is very difficult to understand, even for mathematicians.

275
00:17:51,240 –> 00:17:57,960
Perelman solved the problem by linking it to a completely different area of mathematics.

276
00:17:57,960 –> 00:18:03,800
To understand the shapes, he looked instead at the dynamics of the way things can flow over the shape

277
00:18:03,800 –> 00:18:06,880
which led to a description of all the possible ways

278
00:18:06,880 –> 00:18:11,320
that three dimensional space can be wrapped up in higher dimensions.

279
00:18:11,320 –> 00:18:16,000
I wondered if the man himself could help in unravelling the intricacies of his proof,

280
00:18:16,000 –> 00:18:23,400
but I’d been told that finding Perelman is almost as difficult as understanding the solution.

281
00:18:23,400 –> 00:18:26,040
The classic stereotype of a mathematician

282
00:18:26,040 –> 00:18:29,800
is a mad eccentric scientist, but I think that’s a little bit unfair.

283
00:18:29,800 –> 00:18:33,040
Most of my colleagues are normal. Well, reasonably.

284
00:18:33,040 –> 00:18:35,120
But when it comes to Perelman,

285
00:18:35,120 –> 00:18:37,920
there is no doubt he is a very strange character.

286
00:18:37,920 –> 00:18:40,880
He’s received prizes and offers of professorships

287
00:18:40,880 –> 00:18:43,560
from distinguished universities in the West

288
00:18:43,560 –> 00:18:46,280
but he’s turned them all down.

289
00:18:46,280 –> 00:18:49,800
Recently he seems to have given up mathematics completely

290
00:18:49,800 –> 00:18:52,000
and retreated to live as a semi-recluse

291
00:18:52,000 –> 00:18:54,720
in this very modest housing estate with his mum.

292
00:18:54,720 –> 00:19:01,320
He refuses to talk to the media but I thought he might just talk to me as a fellow mathematician.

293
00:19:01,320 –> 00:19:03,480
I was wrong.

294
00:19:03,480 –> 00:19:07,320
Well, it’s interesting. I think he’s actually turned off his buzzer.

295
00:19:07,320 –> 00:19:09,600
Probably too many media have been buzzing it.

296
00:19:09,600 –> 00:19:12,920
I tried a neighbour and that rang but his doesn’t ring at all.

297
00:19:12,920 –> 00:19:18,560
I think his papers, his mathematics speaks for itself in a way.

298
00:19:18,560 –> 00:19:21,080
I don’t really need to meet the mathematician

299
00:19:21,080 –> 00:19:23,560
and in this age of Big Brother and Big Money,

300
00:19:23,560 –> 00:19:26,840
I think there’s something noble about the fact he gets his kick

301
00:19:26,840 –> 00:19:29,520
out of proving theorems and not winning prizes.

302
00:19:32,960 –> 00:19:36,000
One mathematician would certainly have applauded.

303
00:19:36,000 –> 00:19:40,440
For solving any of his 23 problems, David Hilbert offered no prize

304
00:19:40,440 –> 00:19:45,760
or reward beyond the admiration of other mathematicians.

305
00:19:45,760 –> 00:19:49,360
When he sketched out the problems in Paris in 1900,

306
00:19:49,360 –> 00:19:52,360
Hilbert himself was already a mathematical star.

307
00:19:52,360 –> 00:19:56,320
And it was in Gottingen in northern Germany that he really shone.

308
00:19:59,440 –> 00:20:05,560
He was by far the most charismatic mathematician of his age.

309
00:20:05,560 –> 00:20:09,960
It’s clear that everyone who knew him thought he was absolutely wonderful.

310
00:20:12,880 –> 00:20:17,600
He studied number theory and brought everything together that was there

311
00:20:17,600 –> 00:20:20,760
and then within a year or so he left that completely

312
00:20:20,760 –> 00:20:24,320
and revolutionised the theory of integral equation.

313
00:20:24,320 –> 00:20:26,880
It’s always change and always something new,

314
00:20:26,880 –> 00:20:29,840
and there’s hardly anybody who is…

315
00:20:29,840 –> 00:20:34,800
who was so flexible and so varied in his approach as Hilbert was.

316
00:20:34,800 –> 00:20:41,800
His work is still talked about today and his name has become attached to many mathematical terms.

317
00:20:41,800 –> 00:20:46,160
Mathematicians still use the Hilbert Space, the Hilbert Classification,

318
00:20:46,160 –> 00:20:51,120
the Hilbert Inequality and several Hilbert theorems.

319
00:20:51,120 –> 00:20:54,800
But it was his early work on equations that marked him out

320
00:20:54,800 –> 00:20:57,520
as a mathematician thinking in new ways.

321
00:20:57,520 –> 00:21:01,480
Hilbert showed that although there are infinitely many equations,

322
00:21:01,480 –> 00:21:04,800
there are ways to divide them up so that they are built

323
00:21:04,800 –> 00:21:08,160
out of just a finite set, like a set of building blocks.

324
00:21:08,160 –> 00:21:13,880
The most striking element of Hilbert’s proof was that he couldn’t actually construct this finite set.

325
00:21:13,880 –> 00:21:17,440
He just proved it must exist.

326
00:21:17,440 –> 00:21:20,760
Somebody criticised this as theology and not mathematics

327
00:21:20,760 –> 00:21:22,400
but they’d missed the point.

328
00:21:22,400 –> 00:21:26,280
What Hilbert was doing here was creating a new style of mathematics,

329
00:21:26,280 –> 00:21:28,840
a more abstract approach to the subject.

330
00:21:28,840 –> 00:21:31,280
You could still prove something existed,

331
00:21:31,280 –> 00:21:34,240
even though you couldn’t construct it explicitly.

332
00:21:34,240 –> 00:21:37,960
It’s like saying, “I know there has to be a way to get

333
00:21:37,960 –> 00:21:42,360
“from Gottingen to St Petersburg even though I can’t tell you

334
00:21:42,360 –> 00:21:44,440
“how to actually get there.”

335
00:21:44,440 –> 00:21:49,120
As well as challenging mathematical orthodoxies, Hilbert was also happy

336
00:21:49,120 –> 00:21:54,840
to knock the formal hierarchies that existed in the university system in Germany at the time.

337
00:21:54,840 –> 00:22:01,000
Other professors were quite shocked to see Hilbert out bicycling and drinking with his students.

338
00:22:01,000 –> 00:22:03,440

  • He liked very much parties.
  • Yeah?

339
00:22:03,440 –> 00:22:07,240

  • Yes.
  • Party animal. That’s my kind of mathematician.

340
00:22:07,240 –> 00:22:13,360
He liked very much dancing with young women. He liked very much to flirt.

341
00:22:13,360 –> 00:22:17,880
Really? Most mathematicians I know are not the biggest of flirts.

342
00:22:17,880 –> 00:22:22,000
‘Yet this lifestyle went hand in hand with an absolute commitment to maths.’

343
00:22:22,000 –> 00:22:26,200
Hilbert was of course somebody who thought

344
00:22:26,200 –> 00:22:30,240
that everybody who has a mathematical skill,

345
00:22:30,240 –> 00:22:36,400
a penguin, a woman, a man, or black, white or yellow,

346
00:22:36,400 –> 00:22:40,280
it doesn’t matter, he should do mathematics

347
00:22:40,280 –> 00:22:42,360
and he should be admired for his.

348
00:22:42,360 –> 00:22:46,200
The mathematics speaks for itself in a way.

349
00:22:46,200 –> 00:22:49,720

  • It doesn’t matter…
  • When you’re a penguin.

350
00:22:49,720 –> 00:22:54,360
Yeah, if you can prove the Riemann hypothesis, we really don’t mind.

351
00:22:54,360 –> 00:22:58,280

  • Yes, mathematics was for him a universal language.
  • Yes.

352
00:22:58,280 –> 00:23:02,080
Hilbert believed that this language was powerful enough

353
00:23:02,080 –> 00:23:04,360
to unlock all the truths of mathematics,

354
00:23:04,360 –> 00:23:07,640
a belief he expounded in a radio interview he gave

355
00:23:07,640 –> 00:23:11,400
on the future of mathematics on the 8th September 1930.

356
00:23:16,080 –> 00:23:20,280
In it, he had no doubt that all his 23 problems would soon be solved

357
00:23:20,280 –> 00:23:23,720
and that mathematics would finally be put

358
00:23:23,720 –> 00:23:26,840
on unshakeable logical foundations.

359
00:23:26,840 –> 00:23:30,160
There are absolutely no unsolvable problems, he declared,

360
00:23:30,160 –> 00:23:32,520
a belief that’s been held by mathematicians

361
00:23:32,520 –> 00:23:34,480
since the time of the Ancient Greeks.

362
00:23:34,480 –> 00:23:40,040
He ended with this clarion call, “We must know, we will know.”

363
00:23:40,040 –> 00:23:44,640
‘Wir mussen wissen, wir werden wissen.’

364
00:23:45,960 –> 00:23:48,480
Unfortunately for him, the very day before

365
00:23:48,480 –> 00:23:52,320
in a scientific lecture that was not considered worthy of broadcast,

366
00:23:52,320 –> 00:23:55,520
another mathematician would shatter Hilbert’s dream

367
00:23:55,520 –> 00:23:59,480
and put uncertainty at the heart of mathematics.

368
00:23:59,480 –> 00:24:02,400
The man responsible for destroying Hilbert’s belief

369
00:24:02,400 –> 00:24:05,520
was an Austrian mathematician, Kurt Godel.

370
00:24:10,400 –> 00:24:12,440
And it all started here - Vienna.

371
00:24:12,440 –> 00:24:15,360
Even his admirers, and there are a great many,

372
00:24:15,360 –> 00:24:19,920
admit that Kurt Godel was a little odd.

373
00:24:19,920 –> 00:24:23,840
As a child, he was bright, sickly and very strange.

374
00:24:23,840 –> 00:24:25,880
He couldn’t stop asking questions.

375
00:24:25,880 –> 00:24:30,720
So much so, that his family called him Herr Warum - Mr Why.

376
00:24:30,720 –> 00:24:35,160
Godel lived in Vienna in the 1920s and 1930s,

377
00:24:35,160 –> 00:24:38,000
between the fall of the Austro-Hungarian Empire

378
00:24:38,000 –> 00:24:39,960
and its annexation by the Nazis.

379
00:24:39,960 –> 00:24:45,520
It was a strange, chaotic and exciting time to be in the city.

380
00:24:45,520 –> 00:24:48,160
Godel studied mathematics at Vienna University

381
00:24:48,160 –> 00:24:50,600
but he spent most of his time in the cafes,

382
00:24:50,600 –> 00:24:52,960
the internet chat rooms of their time,

383
00:24:52,960 –> 00:24:55,920
where amongst games of backgammon and billiards,

384
00:24:55,920 –> 00:24:59,040
the real intellectual excitement was taking place.

385
00:24:59,040 –> 00:25:02,320
Particularly amongst a highly influential group

386
00:25:02,320 –> 00:25:05,920
of philosophers and scientists called the Vienna Circle.

387
00:25:05,920 –> 00:25:10,080
In their discussions, Kurt Godel would come up with an idea

388
00:25:10,080 –> 00:25:13,000
that would revolutionise mathematics.

389
00:25:13,000 –> 00:25:15,960
He’d set himself a difficult mathematical test.

390
00:25:15,960 –> 00:25:18,760
He wanted to solve Hilbert’s second problem

391
00:25:18,760 –> 00:25:22,000
and find a logical foundation for all mathematics.

392
00:25:22,000 –> 00:25:25,520
But what he came up with surprised even him.

393
00:25:25,520 –> 00:25:28,960
All his efforts in mathematical logic not only couldn’t provide

394
00:25:28,960 –> 00:25:33,840
the guarantee Hilbert wanted, instead he proved the opposite.

395
00:25:33,840 –> 00:25:35,440
Got it.

396
00:25:35,440 –> 00:25:38,800
It’s called the Incompleteness Theorem.

397
00:25:38,800 –> 00:25:42,360
Godel proved that within any logical system for mathematics

398
00:25:42,360 –> 00:25:46,200
there will be statements about numbers which are true

399
00:25:46,200 –> 00:25:48,200
but which you cannot prove.

400
00:25:48,200 –> 00:25:53,000
He starts with the statement, “This statement cannot be proved.”

401
00:25:53,000 –> 00:25:55,480
This is not a mathematical statement yet.

402
00:25:55,480 –> 00:25:58,360
But by using a clever code based on prime numbers,

403
00:25:58,360 –> 00:26:03,480
Godel could change this statement into a pure statement of arithmetic.

404
00:26:03,480 –> 00:26:08,640
Now, such statements must be either true or false.

405
00:26:08,640 –> 00:26:13,320
Hold on to your logical hats as we explore the possibilities.

406
00:26:13,320 –> 00:26:17,960
If the statement is false, that means the statement could be proved,

407
00:26:17,960 –> 00:26:21,320
which means it would be true, and that’s a contradiction.

408
00:26:21,320 –> 00:26:23,880
So that means, the statement must be true.

409
00:26:23,880 –> 00:26:28,320
In other words, here is a mathematical statement that is true

410
00:26:28,320 –> 00:26:30,840
but can’t be proved.

411
00:26:30,840 –> 00:26:32,440
Blast.

412
00:26:32,440 –> 00:26:35,520
Godel’s proof led to a crisis in mathematics.

413
00:26:35,520 –> 00:26:39,320
What if the problem you were working on, the Goldbach conjecture, say,

414
00:26:39,320 –> 00:26:43,600
or the Riemann hypothesis, would turn out to be true but unprovable?

415
00:26:43,600 –> 00:26:46,720
It led to a crisis for Godel too.

416
00:26:46,720 –> 00:26:50,400
In the autumn of 1934, he suffered the first of what became

417
00:26:50,400 –> 00:26:55,520
a series of breakdowns and spent time in a sanatorium.

418
00:26:55,520 –> 00:26:58,960
He was saved by the love of a good woman.

419
00:26:58,960 –> 00:27:02,880
Adele Nimbursky was a dancer in a local night club.

420
00:27:02,880 –> 00:27:06,200
She kept Godel alive.

421
00:27:06,200 –> 00:27:10,040
One day, she and Godel were walking down these very steps.

422
00:27:10,040 –> 00:27:13,120
Suddenly he was attacked by Nazi thugs.

423
00:27:13,120 –> 00:27:17,360
Godel himself wasn’t Jewish, but many of his friends in the Vienna Circle were.

424
00:27:17,360 –> 00:27:19,840
Adele came to his rescue.

425
00:27:19,840 –> 00:27:24,400
But it was only a temporary reprieve for Godel and for maths.

426
00:27:24,400 –> 00:27:29,680
All across Austria and Germany, mathematics was about to die.

427
00:27:33,680 –> 00:27:36,240
In the new German empire in the late 1930s

428
00:27:36,240 –> 00:27:39,760
there weren’t colourful balloons flying over the universities,

429
00:27:39,760 –> 00:27:41,600
but swastikas.

430
00:27:41,600 –> 00:27:46,280
The Nazis passed a law allowing the removal of any civil servant

431
00:27:46,280 –> 00:27:47,680
who wasn’t Aryan.

432
00:27:47,680 –> 00:27:51,200
Academics were civil servants in Germany then and now.

433
00:27:53,520 –> 00:27:56,200
Mathematicians suffered more than most.

434
00:27:56,200 –> 00:27:59,600
144 in Germany would lose their jobs.

435
00:27:59,600 –> 00:28:04,040
14 were driven to suicide or died in concentration camps.

436
00:28:07,680 –> 00:28:10,600
But one brilliant mathematician stayed on.

437
00:28:10,600 –> 00:28:12,400
David Hilbert helped arrange

438
00:28:12,400 –> 00:28:15,000
for some of his brightest students to flee.

439
00:28:15,000 –> 00:28:17,640
And he spoke out for a while about the dismissal

440
00:28:17,640 –> 00:28:19,200
of his Jewish colleagues.

441
00:28:19,200 –> 00:28:23,400
But soon, he too became silent.

442
00:28:26,720 –> 00:28:29,240
It’s not clear why he didn’t flee himself

443
00:28:29,240 –> 00:28:31,320
or at least protest a little more.

444
00:28:31,320 –> 00:28:33,600
He did fall ill towards the end of his life

445
00:28:33,600 –> 00:28:35,800
so maybe he just didn’t have the energy.

446
00:28:35,800 –> 00:28:38,440
All around him, mathematicians and scientists

447
00:28:38,440 –> 00:28:42,160
were fleeing the Nazi regime until it was only Hilbert left

448
00:28:42,160 –> 00:28:47,480
to witness the destruction of one of the greatest mathematical centres of all time.

449
00:28:50,000 –> 00:28:53,640
David Hilbert died in 1943.

450
00:28:53,640 –> 00:28:56,360
Only ten people attended the funeral

451
00:28:56,360 –> 00:28:59,600
of the most famous mathematician of his time.

452
00:28:59,600 –> 00:29:01,880
The dominance of Europe,

453
00:29:01,880 –> 00:29:05,680
the centre for world maths for 500 years, was over.

454
00:29:05,680 –> 00:29:12,000
It was time for the mathematical baton to be handed to the New World.

455
00:29:13,840 –> 00:29:17,120
Time in fact for this place.

456
00:29:17,120 –> 00:29:22,040
The Institute for Advanced Study had been set up in Princeton in 1930.

457
00:29:22,040 –> 00:29:24,880
The idea was to reproduce the collegiate atmosphere

458
00:29:24,880 –> 00:29:28,880
of the old European universities in rural New Jersey.

459
00:29:28,880 –> 00:29:32,200
But to do this, it needed to attract the very best,

460
00:29:32,200 –> 00:29:34,280
and it didn’t need to look far.

461
00:29:34,280 –> 00:29:37,480
Many of the brightest European mathematicians

462
00:29:37,480 –> 00:29:39,920
were fleeing the Nazis for America.

463
00:29:39,920 –> 00:29:42,520
People like Hermann Weyl, whose research

464
00:29:42,520 –> 00:29:45,680
would have major significance for theoretical physics.

465
00:29:45,680 –> 00:29:48,280
And John Von Neumann, who developed game theory

466
00:29:48,280 –> 00:29:50,840
and was one of the pioneers of computer science.

467
00:29:50,840 –> 00:29:55,400
The Institute quickly became the perfect place

468
00:29:55,400 –> 00:29:59,440
to create another Gottingen in the woods.

469
00:29:59,440 –> 00:30:04,760
One mathematician in particular made the place a home from home.

470
00:30:04,760 –> 00:30:06,320
Every morning Kurt Godel,

471
00:30:06,320 –> 00:30:09,360
dressed in a white linen suit and wearing a fedora,

472
00:30:09,360 –> 00:30:13,040
would walk from his home along Mercer Street to the Institute.

473
00:30:13,040 –> 00:30:16,520
On his way, he would stop here at number 112,

474
00:30:16,520 –> 00:30:22,640
to pick up his closest friend, another European exile, Albert Einstein.

475
00:30:22,640 –> 00:30:26,960
But not even relaxed, affluent Princeton could help Godel

476
00:30:26,960 –> 00:30:29,040
finally escape his demons.

477
00:30:29,040 –> 00:30:31,640
Einstein was always full of laughter.

478
00:30:31,640 –> 00:30:35,520
He described Princeton as a banishment to paradise.

479
00:30:35,520 –> 00:30:40,080
But the much younger Godel became increasingly solemn and pessimistic.

480
00:30:43,160 –> 00:30:46,400
Slowly this pessimism turned into paranoia.

481
00:30:46,400 –> 00:30:50,520
He spent less and less time with his fellow mathematicians in Princeton.

482
00:30:50,520 –> 00:30:54,200
Instead, he preferred to come here to the beach, next to the ocean,

483
00:30:54,200 –> 00:30:59,240
walk alone, thinking about the works of the great German mathematician, Leibniz.

484
00:31:01,400 –> 00:31:05,320
But as Godel was withdrawing into his own interior world,

485
00:31:05,320 –> 00:31:09,320
his influence on American mathematics paradoxically

486
00:31:09,320 –> 00:31:12,000
was growing stronger and stronger.

487
00:31:12,000 –> 00:31:16,160
And a young mathematician from just along the New Jersey coast

488
00:31:16,160 –> 00:31:19,840
eagerly took on some of the challenges he posed.

489
00:31:19,840 –> 00:31:23,760

One, two, three, four, five, six, seven, eight, nine, ten

490
00:31:23,760 –> 00:31:25,880

Times a day I could love you…

491
00:31:25,880 –> 00:31:27,040
In 1950s America,

492
00:31:27,040 –> 00:31:31,440
the majority of youngsters weren’t preoccupied with mathematics.

493
00:31:31,440 –> 00:31:35,160
Most went for a more relaxed, hedonistic lifestyle

494
00:31:35,160 –> 00:31:38,840
in this newly affluent land of ice-cream and doughnuts.

495
00:31:38,840 –> 00:31:42,560
But one teenager didn’t indulge in the normal pursuits

496
00:31:42,560 –> 00:31:45,640
of American adolescence but chose instead

497
00:31:45,640 –> 00:31:49,200
to grapple with some of the major problems in mathematics.

498
00:31:49,200 –> 00:31:50,680
From a very early age,

499
00:31:50,680 –> 00:31:55,080
Paul Cohen was winning mathematical competitions and prizes.

500
00:31:55,080 –> 00:31:58,960
But he found it difficult at first to discover a field in mathematics

501
00:31:58,960 –> 00:32:01,280
where he could really make his mark…

502
00:32:01,280 –> 00:32:05,720
Until he read about Cantor‘s continuum hypothesis.

503
00:32:05,720 –> 00:32:09,280
That’s the one problem, as I had learned back in Halle,

504
00:32:09,280 –> 00:32:11,760
that Cantor just couldn’t resolve.

505
00:32:11,760 –> 00:32:15,400
It asks whether there is or there isn’t an infinite set of numbers

506
00:32:15,400 –> 00:32:18,080
bigger than the set of all whole numbers

507
00:32:18,080 –> 00:32:20,960
but smaller than the set of all decimals.

508
00:32:20,960 –> 00:32:24,280
It sounds straightforward, but it had foiled all attempts

509
00:32:24,280 –> 00:32:29,160
to solve it since Hilbert made it his first problem way back in 1900.

510
00:32:29,160 –> 00:32:31,480
With the arrogance of youth,

511
00:32:31,480 –> 00:32:36,040
the 22-year-old Paul Cohen decided that he could do it.

512
00:32:36,040 –> 00:32:40,720
Cohen came back a year later with the extraordinary discovery

513
00:32:40,720 –> 00:32:43,200
that both answers could be true.

514
00:32:43,200 –> 00:32:47,160
There was one mathematics where the continuum hypothesis

515
00:32:47,160 –> 00:32:49,080
could be assumed to be true.

516
00:32:49,080 –> 00:32:51,800
There wasn’t a set between the whole numbers

517
00:32:51,800 –> 00:32:53,440
and the infinite decimals.

518
00:32:55,160 –> 00:32:59,200
But there was an equally consistent mathematics

519
00:32:59,200 –> 00:33:03,440
where the continuum hypothesis could be assumed to be false.

520
00:33:03,440 –> 00:33:08,280
Here, there was a set between the whole numbers and the infinite decimals.

521
00:33:08,280 –> 00:33:11,480
It was an incredibly daring solution.

522
00:33:11,480 –> 00:33:13,840
Cohen’s proof seemed true,

523
00:33:13,840 –> 00:33:19,160
but his method was so new that nobody was absolutely sure.

524
00:33:19,160 –> 00:33:22,720
There was only one person whose opinion everybody trusted.

525
00:33:22,720 –> 00:33:26,640
There was a lot of scepticism and he had to come and make a trip here,

526
00:33:26,640 –> 00:33:29,320
to the Institute right here, to visit Godel.

527
00:33:29,320 –> 00:33:32,720
And it was only after Godel gave his stamp of approval

528
00:33:32,720 –> 00:33:34,240
in quite an unusual way,

529
00:33:34,240 –> 00:33:37,880
He said, “Give me your paper”, and then on Monday he put it back

530
00:33:37,880 –> 00:33:40,360
in the box and said, “Yes, it’s correct.”

531
00:33:40,360 –> 00:33:42,040
Then everything changed.

532
00:33:43,240 –> 00:33:46,200
Today mathematicians insert a statement

533
00:33:46,200 –> 00:33:50,840
that says whether the result depends on the continuum hypothesis.

534
00:33:50,840 –> 00:33:54,880
We’ve built up two different mathematical worlds

535
00:33:54,880 –> 00:33:57,320
in which one answer is yes and the other is no.

536
00:33:57,320 –> 00:34:01,440
Paul Cohen really has rocked the mathematical universe.

537
00:34:01,440 –> 00:34:05,680
It gave him fame, riches, and prizes galore.

538
00:34:07,680 –> 00:34:12,880
He didn’t publish much after his early success in the ‘60s.

539
00:34:12,880 –> 00:34:15,040
But he was absolutely dynamite.

540
00:34:15,040 –> 00:34:18,840
I can’t imagine anyone better to learn from, and he was very eager

541
00:34:18,840 –> 00:34:23,840
to learn, to teach you anything he knew or even things he didn’t know.

542
00:34:23,840 –> 00:34:27,640
With the confidence that came from solving Hilbert’s first problem,

543
00:34:27,640 –> 00:34:30,320
Cohen settled down in the mid 1960s

544
00:34:30,320 –> 00:34:34,440
to have a go at the most important Hilbert problem of them all -

545
00:34:34,440 –> 00:34:36,960
the eighth, the Riemann hypothesis.

546
00:34:36,960 –> 00:34:43,000
When he died in California in 2007, 40 years later, he was still trying.

547
00:34:43,000 –> 00:34:46,200
But like many famous mathematicians before him,

548
00:34:46,200 –> 00:34:48,280
Riemann had defeated even him.

549
00:34:48,280 –> 00:34:52,440
But his approach has inspired others to make progress towards a proof,

550
00:34:52,440 –> 00:34:55,560
including one of his most famous students, Peter Sarnak.

551
00:34:55,560 –> 00:34:59,440
I think, overall, absolutely loved the guy.

552
00:34:59,440 –> 00:35:01,840
He was my inspiration.

553
00:35:01,840 –> 00:35:04,600
I’m really glad I worked with him.

554
00:35:04,600 –> 00:35:06,800
He put me on the right track.

555
00:35:09,960 –> 00:35:14,240
Paul Cohen is a good example of the success of the great American Dream.

556
00:35:14,240 –> 00:35:16,800
The second generation Jewish immigrant

557
00:35:16,800 –> 00:35:18,960
becomes top American professor.

558
00:35:18,960 –> 00:35:23,640
But I wouldn’t say that his mathematics was a particularly American product.

559
00:35:23,640 –> 00:35:25,720
Cohen was so fired up by this problem

560
00:35:25,720 –> 00:35:29,680
that he probably would have cracked it whatever the surroundings.

561
00:35:31,200 –> 00:35:33,680
Paul Cohen had it relatively easy.

562
00:35:33,680 –> 00:35:36,640
But another great American mathematician of the 1960s

563
00:35:36,640 –> 00:35:40,320
faced a much tougher struggle to make an impact.

564
00:35:40,320 –> 00:35:43,440
Not least because she was female.

565
00:35:43,440 –> 00:35:48,240
In the story of maths, nearly all the truly great mathematicians have been men.

566
00:35:48,240 –> 00:35:51,560
But there have been a few exceptions.

567
00:35:51,560 –> 00:35:54,000
There was the Russian Sofia Kovalevskaya

568
00:35:54,000 –> 00:35:58,920
who became the first female professor of mathematics in Stockholm in 1889,

569
00:35:58,920 –> 00:36:03,400
and won a very prestigious French mathematical prize.

570
00:36:03,400 –> 00:36:07,080
And then Emmy Noether, a talented algebraist who fled from the Nazis

571
00:36:07,080 –> 00:36:10,600
to America but then died before she fully realised her potential.

572
00:36:10,600 –> 00:36:15,920
Then there is the woman who I am crossing America to find out about.

573
00:36:15,920 –> 00:36:19,680
Julia Robinson, the first woman ever to be elected president

574
00:36:19,680 –> 00:36:22,080
of the American Mathematical Society.

575
00:36:31,440 –> 00:36:34,840
She was born in St Louis in 1919,

576
00:36:34,840 –> 00:36:38,160
but her mother died when she was two.

577
00:36:38,160 –> 00:36:42,360
She and her sister Constance moved to live with their grandmother

578
00:36:42,360 –> 00:36:45,720
in a small community in the desert near Phoenix, Arizona.

579
00:36:47,720 –> 00:36:49,800
Julia Robinson grew up around here.

580
00:36:49,800 –> 00:36:53,440
I’ve got a photo which shows her cottage in the 1930s,

581
00:36:53,440 –> 00:36:55,480
with nothing much around it.

582
00:36:55,480 –> 00:36:58,160
The mountains pretty much match those over there

583
00:36:58,160 –> 00:37:00,640
so I think she might have lived down there.

584
00:37:01,600 –> 00:37:04,160
Julia grew up a shy, sickly girl,

585
00:37:04,160 –> 00:37:09,440
who, when she was seven, spent a year in bed because of scarlet fever.

586
00:37:09,440 –> 00:37:12,240
Ill-health persisted throughout her childhood.

587
00:37:12,240 –> 00:37:15,120
She was told she wouldn’t live past 40.

588
00:37:15,120 –> 00:37:20,400
But right from the start, she had an innate mathematical ability.

589
00:37:20,400 –> 00:37:25,240
Under the shade of the native Arizona cactus, she whiled away the time

590
00:37:25,240 –> 00:37:28,720
playing endless counting games with stone pebbles.

591
00:37:28,720 –> 00:37:31,960
This early searching for patterns would give her a feel

592
00:37:31,960 –> 00:37:35,320
and love of numbers that would last for the rest of her life.

593
00:37:35,320 –> 00:37:39,160
But despite showing an early brilliance, she had to continually

594
00:37:39,160 –> 00:37:44,080
fight at school and college to simply be allowed to keep doing maths.

595
00:37:44,080 –> 00:37:47,920
As a teenager, she was the only girl in the maths class

596
00:37:47,920 –> 00:37:50,600
but had very little encouragement.

597
00:37:50,600 –> 00:37:55,480
The young Julia sought intellectual stimulation elsewhere.

598
00:37:55,480 –> 00:37:59,440
Julia loved listening to a radio show called the University Explorer

599
00:37:59,440 –> 00:38:02,440
and the 53rd episode was all about mathematics.

600
00:38:02,440 –> 00:38:04,960
The broadcaster described how he discovered

601
00:38:04,960 –> 00:38:08,560
despite their esoteric language and their seclusive nature,

602
00:38:08,560 –> 00:38:12,320
mathematicians are the most interesting and inspiring creatures.

603
00:38:12,320 –> 00:38:16,240
For the first time, Julia had found out that there were mathematicians,

604
00:38:16,240 –> 00:38:17,920
not just mathematics teachers.

605
00:38:17,920 –> 00:38:20,440
There was a world of mathematics out there,

606
00:38:20,440 –> 00:38:22,240
and she wanted to be part of it.

607
00:38:26,080 –> 00:38:29,680
The doors to that world opened here at the University of California,

608
00:38:29,680 –> 00:38:31,960
at Berkeley near San Francisco.

609
00:38:33,760 –> 00:38:38,680
She was absolutely obsessed that she wanted to go to Berkeley.

610
00:38:38,680 –> 00:38:44,200
She wanted to go away to some place where there were mathematicians.

611
00:38:44,200 –> 00:38:46,720
Berkeley certainly had mathematicians,

612
00:38:46,720 –> 00:38:50,320
including a number theorist called Raphael Robinson.

613
00:38:50,320 –> 00:38:53,400
In their frequent walks around the campus

614
00:38:53,400 –> 00:38:59,960
they found they had more than just a passion for mathematics. They married in 1952.

615
00:38:59,960 –> 00:39:03,200
Julia got her PhD and settled down

616
00:39:03,200 –> 00:39:05,720
to what would turn into her lifetime’s work -

617
00:39:05,720 –> 00:39:07,280
Hilbert’s tenth problem.

618
00:39:07,280 –> 00:39:10,000
She thought about it all the time.

619
00:39:10,000 –> 00:39:14,120
She said to me she just wouldn’t wanna die without knowing that answer

620
00:39:14,120 –> 00:39:16,240
and it had become an obsession.

621
00:39:17,280 –> 00:39:21,200
Julia’s obsession has been shared with many other mathematicians

622
00:39:21,200 –> 00:39:24,560
since Hilbert had first posed it back in 1900.

623
00:39:24,560 –> 00:39:28,400
His tenth problem asked if there was some universal method

624
00:39:28,400 –> 00:39:34,200
that could tell whether any equation had whole number solutions or not.

625
00:39:34,200 –> 00:39:36,520
Nobody had been able to solve it.

626
00:39:36,520 –> 00:39:39,520
In fact, the growing belief was

627
00:39:39,520 –> 00:39:42,440
that no such universal method was possible.

628
00:39:42,440 –> 00:39:44,520
How on earth could you prove that,

629
00:39:44,520 –> 00:39:48,400
however ingenious you were, you’d never come up with a method?

630
00:39:50,080 –> 00:39:51,800
With the help of colleagues,

631
00:39:51,800 –> 00:39:55,640
Julia developed what became known as the Robinson hypothesis.

632
00:39:55,640 –> 00:39:58,920
This argued that to show no such method existed,

633
00:39:58,920 –> 00:40:03,280
all you had to do was to cook up one equation whose solutions

634
00:40:03,280 –> 00:40:06,040
were a very specific set of numbers.

635
00:40:06,040 –> 00:40:09,280
The set of numbers needed to grow exponentially,

636
00:40:09,280 –> 00:40:13,960
like taking powers of two, yet still be captured by the equations

637
00:40:13,960 –> 00:40:16,520
at the heart of Hilbert’s problem.

638
00:40:16,520 –> 00:40:21,600
Try as she might, Robinson just couldn’t find this set.

639
00:40:21,600 –> 00:40:25,880
For the tenth problem to be finally solved,

640
00:40:25,880 –> 00:40:28,880
there needed to be some fresh inspiration.

641
00:40:28,880 –> 00:40:34,280
That came from 5,000 miles away - St Petersburg in Russia.

642
00:40:34,280 –> 00:40:37,840
Ever since the great Leonhard Euler set up shop here

643
00:40:37,840 –> 00:40:39,040
in the 18th century,

644
00:40:39,040 –> 00:40:42,960
the city has been famous for its mathematics and mathematicians.

645
00:40:42,960 –> 00:40:44,760
Here in the Steklov Institute,

646
00:40:44,760 –> 00:40:47,480
some of the world’s brightest mathematicians

647
00:40:47,480 –> 00:40:50,160
have set out their theorems and conjectures.

648
00:40:50,160 –> 00:40:54,320
This morning, one of them is giving a rare seminar.

649
00:40:57,120 –> 00:41:00,040
It’s tough going even if you speak Russian,

650
00:41:00,040 –> 00:41:02,080
which unfortunately I don’t.

651
00:41:02,080 –> 00:41:06,320
But we do get a break in the middle to recover before the final hour.

652
00:41:06,320 –> 00:41:08,320
There is a kind of rule in seminars.

653
00:41:08,320 –> 00:41:12,880
The first third is for everyone, the second third for the experts

654
00:41:12,880 –> 00:41:16,080
and the last third is just for the lecturer.

655
00:41:16,080 –> 00:41:19,080
I think that’s what we’re going to get next.

656
00:41:19,080 –> 00:41:22,800
The lecturer is Yuri Matiyasevich and he is explaining

657
00:41:22,800 –> 00:41:26,520
his latest work on - what else? - the Riemann hypothesis.

658
00:41:28,720 –> 00:41:33,160
As a bright young graduate student in 1965, Yuri’s tutor

659
00:41:33,160 –> 00:41:36,000
suggested he have a go at another Hilbert problem,

660
00:41:36,000 –> 00:41:39,000
the one that had in fact preoccupied Julia Robinson.

661
00:41:39,000 –> 00:41:40,280
Hilbert’s tenth.

662
00:41:43,160 –> 00:41:45,080
It was the height of the Cold War.

663
00:41:45,080 –> 00:41:48,440
Perhaps Matiyasevich could succeed for Russia

664
00:41:48,440 –> 00:41:52,080
where Julia and her fellow American mathematicians had failed.

665
00:41:52,080 –> 00:41:55,000

  • At first I did not like their approach.
  • Oh, right.

666
00:41:55,000 –> 00:41:59,640
The statement looked to me rather strange and artificial

667
00:41:59,640 –> 00:42:03,520
but after some time I understood it was quite natural,

668
00:42:03,520 –> 00:42:07,200
and then I understood that she had a new brilliant idea

669
00:42:07,200 –> 00:42:10,000
and I just started to further develop it.

670
00:42:11,520 –> 00:42:17,000
In January 1970, he found the vital last piece in the jigsaw.

671
00:42:17,000 –> 00:42:21,880
He saw how to capture the famous Fibonacci sequence of numbers

672
00:42:21,880 –> 00:42:26,040
using the equations that were at the heart of Hilbert’s problem.

673
00:42:26,040 –> 00:42:28,920
Building on the work of Julia and her colleagues,

674
00:42:28,920 –> 00:42:30,720
he had solved the tenth.

675
00:42:30,720 –> 00:42:34,240
He was just 22 years old.

676
00:42:34,240 –> 00:42:37,920
The first person he wanted to tell was the woman he owed so much to.

677
00:42:39,800 –> 00:42:41,720
I got no answer

678
00:42:41,720 –> 00:42:44,600
and I believed they were lost in the mail.

679
00:42:44,600 –> 00:42:47,720
It was quite natural because it was Soviet time.

680
00:42:47,720 –> 00:42:50,800
But back in California, Julia had heard rumours

681
00:42:50,800 –> 00:42:54,840
through the mathematical grapevine that the problem had been solved.

682
00:42:54,840 –> 00:42:57,120
And she contacted Yuri herself.

683
00:42:58,120 –> 00:43:01,480
She said, I just had to wait for you to grow up

684
00:43:01,480 –> 00:43:06,160
to get the answer, because she had started work in 1948.

685
00:43:06,160 –> 00:43:07,960
When Yuri was just a baby.

686
00:43:07,960 –> 00:43:11,240
Then he responds by thanking her

687
00:43:11,240 –> 00:43:16,160
and saying that the credit is as much hers as it is his.

688
00:43:18,240 –> 00:43:20,520
YURI: I met Julia one year later.

689
00:43:20,520 –> 00:43:25,080
It was in Bucharest. I suggested after the conference in Bucharest

690
00:43:25,080 –> 00:43:30,120
Julia and her husband Raphael came to see me here in Leningrad.

691
00:43:30,120 –> 00:43:35,400
Together, Julia and Yuri worked on several other mathematical problems

692
00:43:35,400 –> 00:43:39,160
until shortly before Julia died in 1985.

693
00:43:39,160 –> 00:43:41,960
She was just 55 years old.

694
00:43:41,960 –> 00:43:45,640
She was able to find the new ways.

695
00:43:45,640 –> 00:43:49,640
Many mathematicians just combine previous known methods

696
00:43:49,640 –> 00:43:55,560
to solve new problems and she had really new ideas.

697
00:43:55,560 –> 00:43:59,160
Although Julia Robinson showed there was no universal method

698
00:43:59,160 –> 00:44:01,560
to solve all equations in whole numbers,

699
00:44:01,560 –> 00:44:05,840
mathematicians were still interested in finding methods

700
00:44:05,840 –> 00:44:08,760
to solve special classes of equations.

701
00:44:08,760 –> 00:44:11,320
It would be in France in the early 19th century,

702
00:44:11,320 –> 00:44:13,560
in one of the most extraordinary stories

703
00:44:13,560 –> 00:44:17,120
in the history of mathematics, that methods were developed

704
00:44:17,120 –> 00:44:20,240
to understand why certain equations could be solved

705
00:44:20,240 –> 00:44:21,760
while others couldn’t.

706
00:44:27,840 –> 00:44:32,520
It’s early morning in Paris on the 29th May 1832.

707
00:44:32,520 –> 00:44:37,120
Evariste Galois is about to fight for his very life.

708
00:44:37,120 –> 00:44:40,680
It is the reign of the reactionary Bourbon King, Charles X,

709
00:44:40,680 –> 00:44:43,960
and Galois, like many angry young men in Paris then,

710
00:44:43,960 –> 00:44:46,680
is a republican revolutionary.

711
00:44:46,680 –> 00:44:52,000
Unlike the rest of his comrades though, he has another passion - mathematics.

712
00:44:53,560 –> 00:44:56,480
He had just spent four months in jail.

713
00:44:56,480 –> 00:45:00,160
Then, in a mysterious saga of unrequited love,

714
00:45:00,160 –> 00:45:02,280
he is challenged to a duel.

715
00:45:02,280 –> 00:45:04,280
He’d been up the whole previous night

716
00:45:04,280 –> 00:45:07,360
refining a new language for mathematics he’d developed.

717
00:45:07,360 –> 00:45:14,160
Galois believed that mathematics shouldn’t be the study of number and shape, but the study of structure.

718
00:45:14,160 –> 00:45:17,240
Perhaps he was still pre-occupied with his maths.

719
00:45:17,240 –> 00:45:18,800
GUNSHOT

720
00:45:18,800 –> 00:45:21,680
There was only one shot fired that morning.

721
00:45:21,680 –> 00:45:27,280
Galois died the next day, just 20 years old.

722
00:45:27,280 –> 00:45:30,320
It was one of mathematics greatest losses.

723
00:45:30,320 –> 00:45:33,080
Only by the beginning of the 20th century

724
00:45:33,080 –> 00:45:37,640
would Galois be fully appreciated and his ideas fully realised.

725
00:45:42,400 –> 00:45:46,520
Galois had discovered new techniques to be able to tell

726
00:45:46,520 –> 00:45:49,920
whether certain equations could have solutions or not.

727
00:45:49,920 –> 00:45:54,000
The symmetry of certain geometric objects seemed to be the key.

728
00:45:54,000 –> 00:45:58,520
His idea of using geometry to analyse equations

729
00:45:58,520 –> 00:46:03,880
would be picked up in the 1920s by another Parisian mathematician, Andre Weil.

730
00:46:03,880 –> 00:46:09,520
I was very much interested and so far as school was concerned

731
00:46:09,520 –> 00:46:13,720
quite successful in all possible branches.

732
00:46:13,720 –> 00:46:17,480
And he was. After studying in Germany as well as France,

733
00:46:17,480 –> 00:46:21,000
Andre settled down at this apartment in Paris

734
00:46:21,000 –> 00:46:25,760
which he shared with his more-famous sister, the writer Simone Weil.

735
00:46:25,760 –> 00:46:31,040
But when the Second World War broke out, he found himself in very different circumstances.

736
00:46:31,040 –> 00:46:37,040
He dodged the draft by fleeing to Finland where he was almost executed for being a Russian spy.

737
00:46:37,040 –> 00:46:42,720
On his return to France he was put in prison in Rouen to await trial for desertion.

738
00:46:42,720 –> 00:46:45,320
At the trial, the judge gave him a choice.

739
00:46:45,320 –> 00:46:49,120
Five more years in prison or serve in a combat unit.

740
00:46:49,120 –> 00:46:52,240
He chose to join the French army, a lucky choice

741
00:46:52,240 –> 00:46:56,120
because just before the Germans invaded a few months later,

742
00:46:56,120 –> 00:46:58,280
all the prisoners were killed.

743
00:46:58,280 –> 00:47:05,400
Weil only spent a few months in prison, but this time was crucial for his mathematics.

744
00:47:05,400 –> 00:47:11,000
Because here he built on the ideas of Galois and first developed algebraic geometry

745
00:47:11,000 –> 00:47:15,720
a whole new language for understanding solutions to equations.

746
00:47:15,720 –> 00:47:18,720
Galois had shown how new mathematical structures

747
00:47:18,720 –> 00:47:22,600
can be used to reveal the secrets behind equations.

748
00:47:22,600 –> 00:47:24,640
Weil’s work led him to theorems

749
00:47:24,640 –> 00:47:28,800
that connected number theory, algebra, geometry and topology

750
00:47:28,800 –> 00:47:33,720
and are one of the greatest achievements of modern mathematics.

751
00:47:33,720 –> 00:47:36,760
Without Andre Weil, we would never have heard

752
00:47:36,760 –> 00:47:41,400
of the strangest man in the history of maths, Nicolas Bourbaki.

753
00:47:43,720 –> 00:47:50,400
There are no photos of Bourbaki in existence but we do know he was born in this cafe in the Latin Quarter

754
00:47:50,400 –> 00:47:54,520
in 1934 when it was a proper cafe, the cafe Capoulade,

755
00:47:54,520 –> 00:47:58,000
and not the fast food joint it has now become.

756
00:47:58,000 –> 00:48:03,200
Just down the road, I met up with Bourbaki expert David Aubin.

757
00:48:03,200 –> 00:48:06,400
When I was a graduate student I got quite frightened

758
00:48:06,400 –> 00:48:08,120
when I used to go into the library

759
00:48:08,120 –> 00:48:10,960
because this guy Bourbaki had written so many books.

760
00:48:10,960 –> 00:48:14,400
Something like 30 or 40 altogether.

761
00:48:14,400 –> 00:48:19,680
In analysis, in geometry, in topology, it was all new foundations.

762
00:48:19,680 –> 00:48:23,360
Virtually everyone studying Maths seriously anywhere in the world

763
00:48:23,360 –> 00:48:28,200
in the 1950s, ‘60s and ‘70s would have read Nicolas Bourbaki.

764
00:48:28,200 –> 00:48:31,160
He applied for membership of the American Maths Society, I heard.

765
00:48:31,160 –> 00:48:33,360
At which point he was denied membership

766
00:48:33,360 –> 00:48:36,320

  • on the grounds that he didn’t exist.
  • Oh!

767
00:48:36,320 –> 00:48:38,160
The Americans were right.

768
00:48:38,160 –> 00:48:41,880
Nicolas Bourbaki does not exist at all. And never has.

769
00:48:41,880 –> 00:48:46,200
Bourbaki is in fact the nom de plume for a group of French mathematicians

770
00:48:46,200 –> 00:48:49,880
led by Andre Weil who decided to write a coherent account

771
00:48:49,880 –> 00:48:52,480
of the mathematics of the 20th century.

772
00:48:52,480 –> 00:48:57,200
Most of the time mathematicians like to have their own names on theorems.

773
00:48:57,200 –> 00:48:59,600
But for the Bourbaki group,

774
00:48:59,600 –> 00:49:03,440
the aims of the project overrode any desire for personal glory.

775
00:49:03,440 –> 00:49:07,120
After the Second World War, the Bourbaki baton was handed down

776
00:49:07,120 –> 00:49:10,080
to the next generation of French mathematicians.

777
00:49:10,080 –> 00:49:15,400
And their most brilliant member was Alexandre Grothendieck.

778
00:49:15,400 –> 00:49:17,000
Here at the IHES in Paris,

779
00:49:17,000 –> 00:49:21,520
the French equivalent of Princeton’s Institute for Advanced Study,

780
00:49:21,520 –> 00:49:27,160
Grothendieck held court at his famous seminars in the 1950s and 1960s.

781
00:49:29,920 –> 00:49:33,600
He had this incredible charisma.

782
00:49:33,600 –> 00:49:40,240
He had this amazing ability to see a young person and somehow know

783
00:49:40,240 –> 00:49:46,280
what kind of contribution this person could make to this incredible vision

784
00:49:46,280 –> 00:49:48,920
he had of how mathematics could be.

785
00:49:48,920 –> 00:49:54,520
And this vision enabled him to get across some very difficult ideas indeed.

786
00:49:54,520 –> 00:49:58,240
He says, “Suppose you want to open a walnut.

787
00:49:58,240 –> 00:50:02,200
“So the standard thing is you take a nutcracker and you just break it open.”

788
00:50:02,200 –> 00:50:04,800
And he says his approach is more like,

789
00:50:04,800 –> 00:50:08,120
you take this walnut and you put it out in the snow

790
00:50:08,120 –> 00:50:10,160
and you leave it there for a few months

791
00:50:10,160 –> 00:50:13,760
and then when you come back to it, it just opens.

792
00:50:13,760 –> 00:50:15,760
Grothendieck is a Structuralist.

793
00:50:15,760 –> 00:50:19,720
What he’s interested in are the hidden structures

794
00:50:19,720 –> 00:50:22,120
underneath all mathematics.

795
00:50:22,120 –> 00:50:27,560
Only when you get down to the very basic architecture and think in very general terms

796
00:50:27,560 –> 00:50:31,160
will the patterns in mathematics become clear.

797
00:50:31,160 –> 00:50:37,120
Grothendieck produced a new powerful language to see structures in a new way.

798
00:50:37,120 –> 00:50:39,720
It was like living in a world of black and white

799
00:50:39,720 –> 00:50:42,960
and suddenly having the language to see the world in colour.

800
00:50:42,960 –> 00:50:46,640
It’s a language that mathematicians have been using ever since

801
00:50:46,640 –> 00:50:51,640
to solve problems in number theory, geometry, even fundamental physics.

802
00:50:53,160 –> 00:50:56,440
But in the late 1960s, Grothendieck decided

803
00:50:56,440 –> 00:51:01,640
to turn his back on mathematics after he discovered politics.

804
00:51:01,640 –> 00:51:06,320
He believed that the threat of nuclear war and the questions

805
00:51:06,320 –> 00:51:12,440
of nuclear disarmament were more important than mathematics

806
00:51:12,440 –> 00:51:17,480
and that people who continue to do mathematics

807
00:51:17,480 –> 00:51:21,240
rather than confront this threat of nuclear war

808
00:51:21,240 –> 00:51:22,920
were doing harm in the world.

809
00:51:26,440 –> 00:51:29,040
Grothendieck decided to leave Paris

810
00:51:29,040 –> 00:51:32,040
and move back to the south of France where he grew up.

811
00:51:32,040 –> 00:51:36,680
Bursts of radical politics followed and then a nervous breakdown.

812
00:51:36,680 –> 00:51:40,720
He moved to the Pyrenees and became a recluse.

813
00:51:40,720 –> 00:51:45,600
He’s now lost all contact with his old friends and mathematical colleagues.

814
00:51:46,600 –> 00:51:51,040
Nevertheless, the legacy of his achievements means that Grothendieck stands

815
00:51:51,040 –> 00:51:57,440
alongside Cantor, Godel and Hilbert as someone who has transformed the mathematical landscape.

816
00:51:59,200 –> 00:52:03,800
He changed the whole subject in a really fundamental way. It will never go back.

817
00:52:03,800 –> 00:52:08,800
Certainly, he’s THE dominant figure of the 20th century.

818
00:52:16,200 –> 00:52:18,280
I’ve come back to England, though,

819
00:52:18,280 –> 00:52:22,440
thinking again about another seminal figure of the 20th century.

820
00:52:22,440 –> 00:52:26,640
The person that started it all off, David Hilbert.

821
00:52:26,640 –> 00:52:32,400
Of the 23 problems Hilbert set mathematicians in the year 1900,

822
00:52:32,400 –> 00:52:34,880
most have now been solved.

823
00:52:34,880 –> 00:52:37,160
However there is one great exception.

824
00:52:37,160 –> 00:52:40,360
The Riemann hypothesis, the eighth on Hilbert’s list.

825
00:52:40,360 –> 00:52:43,160
That is still the holy grail of mathematics.

826
00:52:44,960 –> 00:52:50,200
Hilbert’s lecture inspired a generation to pursue their mathematical dreams.

827
00:52:50,200 –> 00:52:55,120
This morning, in the town where I grew up, I hope to inspire another generation.

828
00:52:55,120 –> 00:52:57,280
CHEERING AND APPLAUSE

829
00:53:01,680 –> 00:53:04,120
Thank you. Hello. My name’s Marcus du Sautoy

830
00:53:04,120 –> 00:53:05,960
and I’m a Professor of Mathematics

831
00:53:05,960 –> 00:53:08,120
up the road at the University of Oxford.

832
00:53:08,120 –> 00:53:10,320
It was actually in this school here,

833
00:53:10,320 –> 00:53:14,520
in fact this classroom is where I discovered my love for mathematics.

834
00:53:14,520 –> 00:53:17,120
‘This love of mathematics that I first acquired

835
00:53:17,120 –> 00:53:20,400
‘here in my old comprehensive school still drives me now.

836
00:53:20,400 –> 00:53:22,280
‘It’s a love of solving problems.

837
00:53:22,280 –> 00:53:25,680
‘There are so many problems I could tell them about,

838
00:53:25,680 –> 00:53:27,720
‘but I’ve chosen my favourite.’

839
00:53:27,720 –> 00:53:30,840
I think that a mathematician is a pattern searcher

840
00:53:30,840 –> 00:53:33,960
and that’s really what mathematicians try and do.

841
00:53:33,960 –> 00:53:37,080
We try and understand the patterns and the structure

842
00:53:37,080 –> 00:53:40,440
and the logic to explain the way the world around us works.

843
00:53:40,440 –> 00:53:43,480
And this is really at the heart of the Riemann hypothesis.

844
00:53:43,480 –> 00:53:48,360
The task is - is there any pattern in these numbers which can help me say

845
00:53:48,360 –> 00:53:50,440
where the next number will be?

846
00:53:50,440 –> 00:53:52,760
What’s the next one after 31? How can I tell?

847
00:53:52,760 –> 00:53:55,760
‘These numbers are, of course, prime numbers -

848
00:53:55,760 –> 00:53:58,200
‘the building blocks of mathematics.’

849
00:53:58,200 –> 00:54:01,520
‘The Riemann hypothesis, a conjecture about the distribution

850
00:54:01,520 –> 00:54:04,720
‘of the primes, goes to the very heart of our subject.’

851
00:54:04,720 –> 00:54:07,560
Why on earth is anybody interested in these primes?

852
00:54:07,560 –> 00:54:11,040
Why is the army interested in primes, why are spies interested?

853
00:54:11,040 –> 00:54:14,800

  • Isn’t it to encrypt stuff?
  • Exactly.

854
00:54:14,800 –> 00:54:18,280
I study this stuff cos I think it’s all really beautiful and elegant

855
00:54:18,280 –> 00:54:20,200
but actually, there’s a lot of people

856
00:54:20,200 –> 00:54:24,440
who are interested in these numbers because of their very practical use.

857
00:54:24,440 –> 00:54:28,720
‘The bizarre thing is that the more abstract and difficult mathematics becomes,

858
00:54:28,720 –> 00:54:32,480
‘the more it seems to have applications in the real world.

859
00:54:32,480 –> 00:54:36,560
‘Mathematics now pervades every aspect of our lives.

860
00:54:36,560 –> 00:54:41,560
‘Every time we switch on the television, plug in a computer, pay with a credit card.

861
00:54:41,560 –> 00:54:46,160
‘There’s now a million dollars for anyone who can solve the Riemann hypothesis.

862
00:54:46,160 –> 00:54:48,600
‘But there’s more at stake than that.’

863
00:54:48,600 –> 00:54:51,800
Anybody who proves this theorem will be remembered forever.

864
00:54:51,800 –> 00:54:55,640
They’ll be on that board ahead of any of those other mathematicians.

865
00:54:55,640 –> 00:54:59,600
‘That’s because the Riemann hypothesis is a corner-stone of maths.

866
00:54:59,600 –> 00:55:02,800
‘Thousands of theorems depend on it being true.

867
00:55:02,800 –> 00:55:06,000
‘Very few mathematicians think that it isn’t true.

868
00:55:06,000 –> 00:55:10,640
‘But mathematics is about proof and until we can prove it

869
00:55:10,640 –> 00:55:12,840
‘there will still be doubt.’

870
00:55:12,840 –> 00:55:17,160
Maths has grown out of this passion to get rid of doubt.

871
00:55:17,160 –> 00:55:20,760
This is what I have learned in my journey through the history of mathematics.

872
00:55:20,760 –> 00:55:25,080
Mathematicians like Archimedes and al-Khwarizmi, Gauss and Grothendieck

873
00:55:25,080 –> 00:55:30,520
were driven to understand the precise way numbers and space work.

874
00:55:30,520 –> 00:55:33,200
Maths in action, that one.

875
00:55:33,200 –> 00:55:35,440
It’s beautiful. Really nice.

876
00:55:35,440 –> 00:55:39,200
Using the language of mathematics, they have told us stories

877
00:55:39,200 –> 00:55:43,760
that remain as true today as they were when they were first told.

878
00:55:43,760 –> 00:55:48,760
In the Mediterranean, I discovered the origins of geometry.

879
00:55:48,760 –> 00:55:51,840
Mathematicians and philosophers flocked to Alexandria

880
00:55:51,840 –> 00:55:55,240
driven by a thirst for knowledge and the pursuit of excellence.

881
00:55:55,240 –> 00:55:59,080
In India, I learned about another discovery

882
00:55:59,080 –> 00:56:02,880
that it would be impossible to imagine modern life without.

883
00:56:02,880 –> 00:56:07,240
So here we are in one of the true holy sites of the mathematical world.

884
00:56:07,240 –> 00:56:10,080
Up here are some numbers,

885
00:56:10,080 –> 00:56:12,680
and here’s the new number.

886
00:56:12,680 –> 00:56:14,320
Its zero.

887
00:56:14,320 –> 00:56:19,600
In the Middle East, I was amazed at al-Khwarizmi‘s invention of algebra.

888
00:56:19,600 –> 00:56:22,480
He developed systematic ways to analyse problems

889
00:56:22,480 –> 00:56:26,160
so that the solutions would work whatever numbers you took.

890
00:56:26,160 –> 00:56:28,080
In the Golden Age of Mathematics,

891
00:56:28,080 –> 00:56:31,600
in Europe in the 18th and 19th centuries, I found how maths

892
00:56:31,600 –> 00:56:35,760
discovered new ways for analysing bodies in motion and new geometries

893
00:56:35,760 –> 00:56:40,520
that helped us understand the very strange shape of space.

894
00:56:40,520 –> 00:56:43,840
It is with Riemann’s work that we finally have

895
00:56:43,840 –> 00:56:49,280
the mathematical glasses to be able to explore such worlds of the mind.

896
00:56:49,280 –> 00:56:53,480
And now my journey into the abstract world of 20th-century mathematics

897
00:56:53,480 –> 00:56:56,600
has revealed that maths is the true language

898
00:56:56,600 –> 00:56:58,800
the universe is written in,

899
00:56:58,800 –> 00:57:02,120
the key to understanding the world around us.

900
00:57:02,120 –> 00:57:05,840
Mathematicians aren’t motivated by money and material gain

901
00:57:05,840 –> 00:57:09,160
or even by practical applications of their work.

902
00:57:09,160 –> 00:57:13,400
For us, it is the glory of solving one of the great unsolved problems

903
00:57:13,400 –> 00:57:18,560
that have outwitted previous generations of mathematicians.

904
00:57:18,560 –> 00:57:21,920
Hilbert was right. It’s the unsolved problems of mathematics

905
00:57:21,920 –> 00:57:23,720
that make it a living subject,

906
00:57:23,720 –> 00:57:27,160
which obsess each new generation of mathematicians.

907
00:57:27,160 –> 00:57:30,960
Despite all the things we’ve discovered over the last seven millennia,

908
00:57:30,960 –> 00:57:33,600
there are still many things we don’t understand.

909
00:57:33,600 –> 00:57:39,960
And its Hilbert’s call of, “We must know, we will know”, which drives mathematics.

910
00:57:42,240 –> 00:57:45,440
You can learn more about The Story Of Maths

911
00:57:45,440 –> 00:57:48,480
with the Open University at…

912
00:58:00,600 –> 00:58:03,640
Subtitled by Red Bee Media Ltd

913
00:58:03,640 –> 00:58:06,680
E-mail subtitling@bbc.co.uk


Subtitles by © Red Bee Media Ltd