The Coming of the New Organization - Harvard Business Review - January 1988 Issue

by Peter F. Drucker

The typical large business 20 years hence will have fewer than half the levels of management of its counterpart today, and no more than a third the managers. In its structure, and in its management problems and concerns, it will bear little resemblance to the typical manufacturing company, circa 1950, which our textbooks still consider the norm. Instead it is far more likely to resemble organizations that neither the practicing manager nor the management scholar pays much attention to today: the hospital, the university, the symphony orchestra. For like them, the typical business will be knowledge-based, an organization composed largely of specialists who direct and discipline their own performance through organized feedback from colleagues, customers, and headquarters. For this reason, it will be what I call an information-based organization.

The large business 20 years hence is more likely to resemble a hospital or a symphony than a typical manufacturing company.

Businesses, especially large ones, have little choice but to become information-based. Demographics, for one, demands the shift. The center of gravity in employment is moving fast from manual and clerical workers to knowledge workers who resist the command-and-control model that business took from the military 100 years ago. Economics also dictates change, especially the need for large businesses to innovate and to be entrepreneurs. But above all, information technology demands the shift.

Advanced data-processing technology isn’t necessary to create an information-based organization, of course. As we shall see, the British built just such an organization in India when “information technology” meant the quill pen, and barefoot runners were the “telecommunications” systems. But as advanced technology becomes more and more prevalent, we have to engage in analysis and diagnosis—that is, in “information”—even more intensively or risk being swamped by the data we generate.

So far most computer users still use the new technology only to do faster what they have always done before, crunch conventional numbers. But as soon as a company takes the first tentative steps from data to information, its decision processes, management structure, and even the way its work gets done begin to be transformed. In fact, this is already happening, quite fast, in a number of companies throughout the world.

We can readily see the first step in this transformation process when we consider the impact of computer technology on capital-investment decisions. We have known for a long time that there is no one right way to analyze a proposed capital investment. To understand it we need at least six analyses: the expected rate of return; the payout period and the investment’s expected productive life; the discounted present value of all returns through the productive lifetime of the investment; the risk in not making the investment or deferring it; the cost and risk in case of failure; and finally, the opportunity cost. Every accounting student is taught these concepts. But before the advent of data-processing capacity, the actual analyses would have taken man-years of clerical toil to complete. Now anyone with a spreadsheet should be able to do them in a few hours.

The availability of this information transforms the capital-investment analysis from opinion into diagnosis, that is, into the rational weighing of alternative assumptions. Then the information transforms the capital-investment decision from an opportunistic, financial decision governed by the numbers into a business decision based on the probability of alternative strategic assumptions. So the decision both presupposes a business strategy and challenges that strategy and its assumptions. What was once a budget exercise becomes an analysis of policy.

Information transforms a budget exercise into an analysis of policy.

The second area that is affected when a company focuses its data-processing capacity on producing information is its organization structure. Almost immediately, it becomes clear that both the number of management levels and the number of managers can be sharply cut. The reason is straightforward: it turns out that whole layers of management neither make decisions nor lead. Instead, their main, if not their only, function is to serve as “relays”—human boosters for the faint, unfocused signals that pass for communication in the traditional pre-information organization.

One of America’s largest defense contractors made this discovery when it asked what information its top corporate and operating managers needed to do their jobs. Where did it come from? What form was it in? How did it flow? The search for answers soon revealed that whole layers of management—perhaps as many as 6 out of a total of 14—existed only because these questions had not been asked before. The company had had data galore. But it had always used its copious data for control rather than for information.

Information is data endowed with relevance and purpose. Converting data into information thus requires knowledge. And knowledge, by definition, is specialized. (In fact, truly knowledgeable people tend toward overspecialization, whatever their field, precisely because there is always so much more to know.)

The information-based organization requires far more specialists overall than the command-and-control companies we are accustomed to. Moreover, the specialists are found in operations, not at corporate headquarters. Indeed, the operating organization tends to become an organization of specialists of all kinds.

Information-based organizations need central operating work such as legal counsel, public relations, and labor relations as much as ever. But the need for service staffs—that is, for people without operating responsibilities who only advise, counsel, or coordinate—shrinks drastically. In its central management, the information-based organization needs few, if any, specialists.

Because of its flatter structure, the large, information-based organization will more closely resemble the businesses of a century ago than today’s big companies. Back then, however, all the knowledge, such as it was, lay with the very top people. The rest were helpers or hands, who mostly did the same work and did as they were told. In the information-based organization, the knowledge will be primarily at the bottom, in the minds of the specialists who do different work and direct themselves. So today’s typical organization in which knowledge tends to be concentrated in service staffs, perched rather insecurely between top management and the operating people, will likely be labeled a phase, an attempt to infuse knowledge from the top rather than obtain information from below.

Finally, a good deal of work will be done differently in the information-based organization. Traditional departments will serve as guardians of standards, as centers for training and the assignment of specialists; they won’t be where the work gets done. That will happen largely in task-focused teams.

Traditional departments won’t be where the work gets done.

This change is already under way in what used to be the most clearly defined of all departments—research. In pharmaceuticals, in telecommunications, in papermaking, the traditional sequence of research, development, manufacturing, and marketing is being replaced by synchrony: specialists from all these functions work together as a team, from the inception of research to a product’s establishment in the market.

How task forces will develop to tackle other business opportunities and problems remains to be seen. I suspect, however, that the need for a task force, its assignment, its composition, and its leadership will have to be decided on case by case. So the organization that will be developed will go beyond the matrix and may indeed be quite different from it. One thing is clear, though: it will require greater self-discipline and even greater emphasis on individual responsibility for relationships and for communications.• • •

To say that information technology is transforming business enterprises is simple. What this transformation will require of companies and top managements is much harder to decipher. That is why I find it helpful to look for clues in other kinds of information-based organizations, such as the hospital, the symphony orchestra, and the British administration in India.

A fair-sized hospital of about 400 beds will have a staff of several hundred physicians and 1,200 to 1,500 paramedics divided among some 60 medical and paramedical specialties. Each specialty has its own knowledge, its own training, its own language. In each specialty, especially the paramedical ones like the clinical lab and physical therapy, there is a head person who is a working specialist rather than a full-time manager. The head of each specialty reports directly to the top, and there is little middle management. A good deal of the work is done in ad hoc teams as required by an individual patient’s diagnosis and condition.

A large symphony orchestra is even more instructive, since for some works there may be a few hundred musicians on stage playing together. According to organization theory then, there should be several group vice president conductors and perhaps a half-dozen division VP conductors. But that’s not how it works. There is only the conductor-CEO—and every one of the musicians plays directly to that person without an intermediary. And each is a high-grade specialist, indeed an artist.

But the best example of a large and successful information-based organization, and one without any middle management at all, is the British civil administration in India.1

The best example of a large and successful information-based organization had no middle management at all.

The British ran the Indian subcontinent for 200 years, from the middle of the eighteenth century through World War II, without making any fundamental changes in organization structure or administrative policy. The Indian civil service never had more than 1,000 members to administer the vast and densely populated subcontinent—a tiny fraction (at most 1%) of the legions of Confucian mandarins and palace eunuchs employed next door to administer a not-much-more populous China. Most of the Britishers were quite young; a 30-year-old was a survivor, especially in the early years. Most lived alone in isolated outposts with the nearest countryman a day or two of travel away, and for the first hundred years there was no telegraph or railroad.

The organization structure was totally flat. Each district officer reported directly to the “COO,” the provincial political secretary. And since there were nine provinces, each political secretary had at least 100 people reporting directly to him, many times what the doctrine of the span of control would allow. Nevertheless, the system worked remarkably well, in large part because it was designed to ensure that each of its members had the information he needed to do his job.

Each month the district officer spent a whole day writing a full report to the political secretary in the provincial capital. He discussed each of his principal tasks—there were only four, each clearly delineated. He put down in detail what he had expected would happen with respect to each of them, what actually did happen, and why, if there was a discrepancy, the two differed. Then he wrote down what he expected would happen in the ensuing month with respect to each key task and what he was going to do about it, asked questions about policy, and commented on long-term opportunities, threats, and needs. In turn, the political secretary “minuted” every one of those reports—that is, he wrote back a full comment.• • •

On the basis of these examples, what can we say about the requirements of the information-based organization? And what are its management problems likely to be? Let’s look first at the requirements. Several hundred musicians and their CEO, the conductor, can play together because they all have the same score. It tells both flutist and timpanist what to play and when. And it tells the conductor what to expect from each and when. Similarly, all the specialists in the hospital share a common mission: the care and cure of the sick. The diagnosis is their “score”; it dictates specific action for the X-ray lab, the dietitian, the physical therapist, and the rest of the medical team.

Information-based organizations, in other words, require clear, simple, common objectives that translate into particular actions. At the same time, however, as these examples indicate, information-based organizations also need concentration on one objective or, at most, on a few.

Because the “players” in an information-based organization are specialists, they cannot be told how to do their work. There are probably few orchestra conductors who could coax even one note out of a French horn, let alone show the horn player how to do it. But the conductor can focus the horn player’s skill and knowledge on the musicians’ joint performance. And this focus is what the leaders of an information-based business must be able to achieve.

Yet a business has no “score” to play by except the score it writes as it plays. And whereas neither a first-rate performance of a symphony nor a miserable one will change what the composer wrote, the performance of a business continually creates new and different scores against which its performance is assessed. So an information-based business must be structured around goals that clearly state management’s performance expectations for the enterprise and for each part and specialist and around organized feedback that compares results with these performance expectations so that every member can exercise self-control.

The other requirement of an information-based organization is that everyone take information responsibility. The bassoonist in the orchestra does so every time she plays a note. Doctors and paramedics work with an elaborate system of reports and an information center, the nurse’s station on the patient’s floor. The district officer in India acted on this responsibility every time he filed a report.

The key to such a system is that everyone asks: Who in this organization depends on me for what information? And on whom, in turn, do I depend? Each person’s list will always include superiors and subordinates. But the most important names on it will be those of colleagues, people with whom one’s primary relationship is coordination. The relationship of the internist, the surgeon, and the anesthesiologist is one example. But the relationship of a biochemist, a pharmacologist, the medical director in charge of clinical testing, and a marketing specialist in a pharmaceutical company is no different. It, too, requires each party to take the fullest information responsibility.

Who depends on me for information? And on whom do I depend?

Information responsibility to others is increasingly understood, especially in middle-sized companies. But information responsibility to oneself is still largely neglected. That is, everyone in an organization should constantly be thinking through what information he or she needs to do the job and to make a contribution.

This may well be the most radical break with the way even the most highly computerized businesses are still being run today. There, people either assume the more data, the more information—which was a perfectly valid assumption yesterday when data were scarce, but leads to data overload and information blackout now that they are plentiful. Or they believe that information specialists know what data executives and professionals need in order to have information. But information specialists are tool makers. They can tell us what tool to use to hammer upholstery nails into a chair. We need to decide whether we should be upholstering a chair at all.

Executives and professional specialists need to think through what information is for them, what data they need: first, to know what they are doing; then, to be able to decide what they should be doing; and finally, to appraise how well they are doing. Until this happens MIS departments are likely to remain cost centers rather than become the result centers they could be.• • •

Most large businesses have little in common with the examples we have been looking at. Yet to remain competitive—maybe even to survive—they will have to convert themselves into information-based organizations, and fairly quickly. They will have to change old habits and acquire new ones. And the more successful a company has been, the more difficult and painful this process is apt to be. It will threaten the jobs, status, and opportunities of a good many people in the organization, especially the long-serving, middle-aged people in middle management who tend to be the least mobile and to feel most secure in their work, their positions, their relationships, and their behavior.

To remain competitive—maybe even to survive—businesses will have to convert themselves into organizations of knowledgeable specialists.

The information-based organization will also pose its own special management problems. I see as particularly critical:

  1. Developing rewards, recognition, and career opportunities for specialists.

  2. Creating unified vision in an organization of specialists.

  3. Devising the management structure for an organization of task forces.

  4. Ensuring the supply, preparation, and testing of top management people.

Bassoonists presumably neither want nor expect to be anything but bassoonists. Their career opportunities consist of moving from second bassoon to first bassoon and perhaps of moving from a second-rank orchestra to a better, more prestigious one. Similarly, many medical technologists neither expect nor want to be anything but medical technologists. Their career opportunities consist of a fairly good chance of moving up to senior technician, and a very slim chance of becoming lab director. For those who make it to lab director, about 1 out of every 25 or 30 technicians, there is also the opportunity to move to a bigger, richer hospital. The district officer in India had practically no chance for professional growth except possibly to be relocated, after a three-year stint, to a bigger district.

Opportunities for specialists in an information-based business organization should be more plentiful than they are in an orchestra or hospital, let alone in the Indian civil service. But as in these organizations, they will primarily be opportunities for advancement within the specialty, and for limited advancement at that. Advancement into “management” will be the exception, for the simple reason that there will be far fewer middle-management positions to move into. This contrasts sharply with the traditional organization where, except in the research lab, the main line of advancement in rank is out of the specialty and into general management.

More than 30 years ago General Electric tackled this problem by creating “parallel opportunities” for “individual professional contributors.” Many companies have followed this example. But professional specialists themselves have largely rejected it as a solution. To them—and to their management colleagues—the only meaningful opportunities are promotions into management. And the prevailing compensation structure in practically all businesses reinforces this attitude because it is heavily biased towards managerial positions and titles.

There are no easy answers to this problem. Some help may come from looking at large law and consulting firms, where even the most senior partners tend to be specialists, and associates who will not make partner are outplaced fairly early on. But whatever scheme is eventually developed will work only if the values and compensation structure of business are drastically changed.

The second challenge that management faces is giving its organization of specialists a common vision, a view of the whole.

In the Indian civil service, the district officer was expected to see the “whole” of his district. But to enable him to concentrate on it, the government services that arose one after the other in the nineteenth century (forestry, irrigation, the archaeological survey, public health and sanitation, roads) were organized outside the administrative structure, and had virtually no contact with the district officer. This meant that the district officer became increasingly isolated from the activities that often had the greatest impact on—and the greatest importance for—his district. In the end, only the provincial government or the central government in Delhi had a view of the “whole,” and it was an increasingly abstract one at that.

A business simply cannot function this way. It needs a view of the whole and a focus on the whole to be shared among a great many of its professional specialists, certainly among the senior ones. And yet it will have to accept, indeed will have to foster, the pride and professionalism of its specialists—if only because, in the absence of opportunities to move into middle management, their motivation must come from that pride and professionalism.

One way to foster professionalism, of course, is through assignments to task forces. And the information-based business will use more and more smaller self-governing units, assigning them tasks tidy enough for “a good man to get his arms around,” as the old phrase has it. But to what extent should information-based businesses rotate performing specialists out of their specialties and into new ones? And to what extent will top management have to accept as its top priority making and maintaining a common vision across professional specialties?

Heavy reliance on task-force teams assuages one problem. But it aggravates another: the management structure of the information-based organization. Who will the business’s managers be? Will they be task-force leaders? Or will there be a two-headed monster—a specialist structure, comparable, perhaps, to the way attending physicians function in a hospital, and an administrative structure of task-force leaders?

Who will the business’s managers be?

The decisions we face on the role and function of the task-force leaders are risky and controversial. Is theirs a permanent assignment, analogous to the job of the supervisory nurse in the hospital? Or is it a function of the task that changes as the task does? Is it an assignment or a position? Does it carry any rank at all? And if it does, will the task-force leaders become in time what the product managers have been at Procter & Gamble: the basic units of management and the company’s field officers? Might the task-force leaders eventually replace department heads and vice presidents?

Signs of every one of these developments exist, but there is neither a clear trend nor much understanding as to what each entails. Yet each would give rise to a different organizational structure from any we are familiar with.

Finally, the toughest problem will probably be to ensure the supply, preparation, and testing of top management people. This is, of course, an old and central dilemma as well as a major reason for the general acceptance of decentralization in large businesses in the last 40 years. But the existing business organization has a great many middle-management positions that are supposed to prepare and test a person. As a result, there are usually a good many people to choose from when filling a senior management slot. With the number of middle-management positions sharply cut, where will the information-based organization’s top executives come from? What will be their preparation? How will they have been tested?

With middle management sharply cut, where will the top executives come from?

Decentralization into autonomous units will surely be even more critical than it is now. Perhaps we will even copy the German Gruppe in which the decentralized units are set up as separate companies with their own top managements. The Germans use this model precisely because of their tradition of promoting people in their specialties, especially in research and engineering; if they did not have available commands in near-independent subsidiaries to put people in, they would have little opportunity to train and test their most promising professionals. These subsidiaries are thus somewhat like the farm teams of a major-league baseball club.

We may also find that more and more top management jobs in big companies are filled by hiring people away from smaller companies. This is the way that major orchestras get their conductors—a young conductor earns his or her spurs in a small orchestra or opera house, only to be hired away by a larger one. And the heads of a good many large hospitals have had similar careers.

Can business follow the example of the orchestra and hospital where top management has become a separate career? Conductors and hospital administrators come out of courses in conducting or schools of hospital administration respectively. We see something of this sort in France, where large companies are often run by men who have spent their entire previous careers in government service. But in most countries this would be unacceptable to the organization (only France has the mystique of the grandes écoles). And even in France, businesses, especially large ones, are becoming too demanding to be run by people without firsthand experience and a proven success record.

Thus the entire top management process—preparation, testing, succession—will become even more problematic than it already is. There will be a growing need for experienced businesspeople to go back to school. And business schools will surely need to work out what successful professional specialists must know to prepare themselves for high-level positions as business executives and business leaders.• • •

Since modern business enterprise first arose, after the Civil War in the United States and the Franco-Prussian War in Europe, there have been two major evolutions in the concept and structure of organizations. The first took place in the ten years between 1895 and 1905. It distinguished management from ownership and established management as work and task in its own right. This happened first in Germany, when Georg Siemens, the founder and head of Germany’s premier bank, Deutsche Bank, saved the electrical apparatus company his cousin Werner had founded after Werner’s sons and heirs had mismanaged it into near collapse. By threatening to cut off the bank’s loans, he forced his cousins to turn the company’s management over to professionals. A little later, J.P. Morgan, Andrew Carnegie, and John D. Rockefeller, Sr. followed suit in their massive restructurings of U.S. railroads and industries.

The second evolutionary change took place 20 years later. The development of what we still see as the modern corporation began with Pierre S. du Pont’s restructuring of his family company in the early twenties and continued with Alfred P. Sloan’s redesign of General Motors a few years later. This introduced the command-and-control organization of today, with its emphasis on decentralization, central service staffs, personnel management, the whole apparatus of budgets and controls, and the important distinction between policy and operations. This stage culminated in the massive reorganization of General Electric in the early 1950s, an action that perfected the model most big businesses around the world (including Japanese organizations) still follow.2

We can identify requirements and point to problems; the job of building is still ahead.

Now we are entering a third period of change: the shift from the command-and-control organization, the organization of departments and divisions, to the information-based organization, the organization of knowledge specialists. We can perceive, though perhaps only dimly, what this organization will look like. We can identify some of its main characteristics and requirements. We can point to central problems of values, structure, and behavior. But the job of actually building the information-based organization is still ahead of us—it is the managerial challenge of the future.

  1. The standard account is Philip Woodruff, The Men Who Ruled India, especially the first volume, The Founders of Modern India (New York: St. Martin’s, 1954). How the system worked day by day is charmingly told in Sowing (New York: Harcourt Brace Jovanovich, 1962), volume one of the autobiography of Leonard Woolf (Virginia Woolf’s husband).

  2. Alfred D. Chandler, Jr. has masterfully chronicled the process in his two books Strategy and Structure (Cambridge: MIT Press, 1962) and The Visible Hand (Cambridge: Harvard University Press, 1977)—surely the best studies of the administrative history of any major institution. The process itself and its results were presented and analyzed in two of my books: The Concept of the Corporation (New York: John Day, 1946) and The Practice of Management (New York: Harper Brothers, 1954).

A version of this article appeared in the January 1988 issue of Harvard Business Review.


Peter F. Drucker (November 19, 1909 – November 11, 2005) was an Austrian-born American management consultant, educator, and author whose writings contributed to the philosophical and practical foundations of the modern business corporation. He was also a leader in the development of management education, he invented the concept known as management by objectives, and he has been described as “the founder of modern management.”


© The Coming of the New Organization - Harvard Business Review - From the January 1988 Issue

Gettysburg Address

Abraham Lincoln

Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.

Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.

But, in a larger sense, we can not dedicate—we can not consecrate—we can not hallow—this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth.


A Father To His Son

by Carl Sandburg

A father sees his son nearing manhood.
What shall he tell that son?
“Life is hard; be steel; be a rock.”
And this might stand him for the storms
and serve him for humdrum monotony
and guide him among sudden betrayals
and tighten him for slack moments.
“Life is a soft loam; be gentle; go easy.”
And this too might serve him.
Brutes have been gentled where lashes failed.
The growth of a frail flower in a path up
has sometimes shattered and split a rock.
A tough will counts. So does desire.
So does a rich soft wanting.
Without rich wanting nothing arrives.
Tell him too much money has killed men
and left them dead years before burial:
the quest of lucre beyond a few easy needs
has twisted good enough men
sometimes into dry thwarted worms.
Tell him time as a stuff can be wasted.
Tell him to be a fool every so often
and to have no shame over having been a fool
yet learning something out of every folly
hoping to repeat none of the cheap follies
thus arriving at intimate understanding
of a world numbering many fools.
Tell him to be alone often and get at himself
and above all tell himself no lies about himself
whatever the white lies and protective fronts
he may use against other people.
Tell him solitude is creative if he is strong
and the final decisions are made in silent rooms.
Tell him to be different from other people
if it comes natural and easy being different.
Let him have lazy days seeking his deeper motives.
Let him seek deep for where he is born natural.
Then he may understand Shakespeare
and the Wright brothers, Pasteur, Pavlov,
Michael Faraday and free imaginations
Bringing changes into a world resenting change.
He will be lonely enough
to have time for the work
he knows as his own.


擬輓歌辭

作者:陶淵明

有生必有死,早終非命促。
昨暮同為人,今旦在鬼錄。
魂氣散何之?枯形寄空木。
嬌兒索父啼,良友撫我哭。
得失不復知,是非安能覺?
千秋萬歲後,誰知榮與辱!
但恨在世時,飲酒不得足。


在昔無酒飲,今但湛空觴。
春醪生浮蟻,何時更能嘗?
餚案盈我前,親舊哭我傍。
欲語口無音,欲視眼無光。
昔在高堂寢,今宿荒草鄉。
荒草無人眠,極視正茫茫。
一朝出門去,歸來良未央。


荒草何茫茫,白楊亦蕭蕭!
嚴霜九月中,送我出遠郊。
四面無人居,高墳正嶕嶢。
馬為仰天鳴,風為自蕭條。
幽室一已閉,千年不復朝。
千年不復朝,賢達無奈何!
向來相送人,各自還其家。
親戚或餘悲,他人亦已歌。
死去何所道,托體同山阿。

LeetCode - Algorithms - 4. Median of Two Sorted Arrays

Problem

4. Median of Two Sorted Arrays

Follow up

The overall run time complexity should be O(log (m+n)).

Java

extra space

On the basis of 88. Merge Sorted Array, this is not preferable method, just better than nothing.

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
class Solution {
public double findMedianSortedArrays(int[] nums1, int[] nums2) {
final int m = nums1.length;
final int n = nums2.length;
if (m == 0)
return (n & 1) == 1 ? nums2[n / 2] : (nums2[n / 2 - 1] + nums2[n / 2]) / 2.0;
if (n == 0)
return (m & 1) == 1 ? nums1[m / 2] : (nums1[m / 2 - 1] + nums1[m / 2]) / 2.0;
int[] aux = merge(nums1, m, nums2, n);
double median = ((m + n) & 1) == 1 ? aux[(m + n) / 2] : (aux[(m + n) / 2 - 1] + aux[(m + n) / 2]) / 2.0;
return median;
}

private int[] merge(int[] nums1, int m, int[] nums2, int n) {
int[] aux = new int[m + n];
if (m == 0) {
for (int i = 0; i < n; i++)
aux[i] = nums2[i];
return aux;
} else {
for (int i = 0; i < m; i++)
aux[i] = nums1[i];
}
int idx = m + n - 1;
m--;
n--;
for (; m >= 0 && n >= 0; ) {
if (nums1[m] < nums2[n]) {
aux[idx--] = nums2[n];
n--;
} else {
aux[idx--] = nums1[m];
m--;
}
}
if (n >= 0) {
for (int i = 0; i <= n; i++)
aux[i] = nums2[i];
}
return aux;
}
}

Submission Detail

  • 2091 / 2091 test cases passed.
  • Runtime: 2 ms, faster than 99.73% of Java online submissions for Median of Two Sorted Arrays.
  • Memory Usage: 40.1 MB, less than 10.39% of Java online submissions for Median of Two Sorted Arrays.

LeetCode - Algorithms - 125. Valid Palindrome

Problem

125. Valid Palindrome

Java

Two pointers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Solution {
public boolean isPalindrome(String s) {
final int N = s.length();
char c1, c2;
for (int i = 0, j = N - 1; i < j; ) {
c1 = s.charAt(i);
c2 = s.charAt(j);
if (!Character.isLetterOrDigit(c1))
i++;
else if (!Character.isLetterOrDigit(c2))
j--;
else if (Character.toLowerCase(c1) != Character.toLowerCase(c2)) {
return false;
} else {
i++;
j--;
}
}
return true;
}
}

Submission Detail

  • 481 / 481 test cases passed.
  • Runtime: 2 ms, faster than 98.05% of Java online submissions for Valid Palindrome.
  • Memory Usage: 39 MB, less than 5.64% of Java online submissions for Valid Palindrome.

alphanumeric and binary

1
2
3
4
5
6
7
8
9
10
class Solution {
public boolean isPalindrome(String s) {
s = s.replaceAll("[^A-Za-z0-9]", "").toLowerCase();
int N = s.length();
for (int i = 0; i < N / 2; i++)
if (s.charAt(i) != s.charAt(N - 1 - i))
return false;
return true;
}
}

Submission Detail

  • 480 / 480 test cases passed.
  • Runtime: 883 ms, faster than 12.58% of Java online submissions for Valid Palindrome.
  • Memory Usage: 47.3 MB, less than 18.43% of Java online submissions for Valid Palindrome.

JavaScript

Algorithms, 4th Edition

1
2
3
4
5
6
7
8
9
10
11
12
13
/**
* @param {string} s
* @return {boolean}
*/
var isPalindrome = function(s) {
let str = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, "");
const N = str.length;
for (let i = 0; i < N / 2; i++) {
if (str.charAt(i) != str.charAt(N - 1 - i))
return false;
}
return true;
};

Submission Detail

  • 480 / 480 test cases passed.
  • Runtime: 67 ms, faster than 96.43% of JavaScript online submissions for Valid Palindrome.
  • Memory Usage: 44.2 MB, less than 82.85% of JavaScript online submissions for Valid Palindrome.

Two pointers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* @param {string} s
* @return {boolean}
*/
var isPalindrome = function(s) {
const N = s.length;
const ALPHANUMERIC = /^[a-z0-9]+$/i;
let c1, c2;
for (let i = 0, j = N - 1; i < j; ) {
c1 = s.charAt(i);
c2 = s.charAt(j);
if (!ALPHANUMERIC.test(c1))
i++;
else if (!ALPHANUMERIC.test(c2))
j--;
else if (c1.toLowerCase() != c2.toLowerCase()) {
return false;
} else {
i++;
j--;
}
}
return true;
};

Submission Detail

  • 480 / 480 test cases passed.
  • Runtime: 102 ms, faster than 45.96% of JavaScript online submissions for Valid Palindrome.
  • Memory Usage: 44.9 MB, less than 61.23% of JavaScript online submissions for Valid Palindrome.

LeetCode - Algorithms - 234. Palindrome Linked List

Problem

234. Palindrome Linked List

Follow up

Could you do it in O(n) time and O(1) space?

Java

Break and reverse second half

© LeetCode – Palindrome Linked List &#40;Java&#41; - Java Solution 2 - Break and reverse second half

We can use a fast and slow pointer to get the center of the list, then reverse the second list and compare two sublists. The time is O(n) and space is O(1).

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
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public boolean isPalindrome(ListNode head) {
if (head == null || head.next == null)
return true;

//find list center
ListNode fast = head;
ListNode slow = head;
while (fast.next != null && fast.next.next != null) {
fast = fast.next.next;
slow = slow.next;
}
ListNode secondHead = slow.next;
slow.next = null;

//reverse second part of the list
ListNode p1 = secondHead;
ListNode p2 = p1.next;
while (p1 != null && p2 != null) {
ListNode temp = p2.next;
p2.next = p1;
p1 = p2;
p2 = temp;
}
secondHead.next = null;

//compare two sublists now
ListNode p = (p2 == null ? p1 : p2);
ListNode q = head;
while (p != null) {
if (p.val != q.val)
return false;
p = p.next;
q = q.next;
}
return true;
}
}

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 1 ms, faster than 95.13% of Java online submissions for Palindrome Linked List.
  • Memory Usage: 41.7 MB, less than 5.11% of Java online submissions for Palindrome Linked List.

extrap space

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public boolean isPalindrome(ListNode head) {
List<ListNode> list = new ArrayList<ListNode>();
while (head != null) {
list.add(head);
head = head.next;
}
int n = list.size();
for (int i = 0; i < n / 2; i++) {
if (list.get(i).val != list.get(n - 1 - i).val)
return false;
}
return true;
}
}

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 2 ms, faster than 39.06% of Java online submissions for Palindrome Linked List.
  • Memory Usage: 42.8 MB, less than 5.11% of Java online submissions for Palindrome Linked List.

Recursion

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
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public boolean isPalindrome(ListNode head) {
if (head == null)
return true;
if (head.next == null)
return true;
ListNode secondLast = head;
while (secondLast.next.next != null) {
secondLast = secondLast.next;
}
if (head.val == secondLast.next.val) {
secondLast.next = null;
return isPalindrome(head.next);
} else {
return false;
}
}
}

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 1406 ms, faster than 5.02% of Java online submissions for Palindrome Linked List.
  • Memory Usage: 42.7 MB, less than 5.11% of Java online submissions for Palindrome Linked List.

LeetCode - Algorithms - 141. Linked List Cycle

Problem

141. Linked List Cycle

Java

Two pointers

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
/**
* Definition for singly-linked list.
* class ListNode {
* int val;
* ListNode next;
* ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution {
public boolean hasCycle(ListNode head) {
boolean b = false;
ListNode slowPointer = head;
ListNode fastPointer = head;
while (fastPointer != null && fastPointer.next != null) {
fastPointer = fastPointer.next.next;
slowPointer = slowPointer.next;
if (fastPointer != null && fastPointer.next == slowPointer) {
b = true;
break;
}
}
return b;
}
}

Submission Detail

  • 17 / 17 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Linked List Cycle.
  • Memory Usage: 39.3 MB, less than 12.07% of Java online submissions for Linked List Cycle.

extra space

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
import java.util.HashSet;
import java.util.Set;

/**
* Definition for singly-linked list.
* class ListNode {
* int val;
* ListNode next;
* ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution {
public boolean hasCycle(ListNode head) {
boolean b = false;
Set<ListNode> coll = new HashSet<ListNode>();
ListNode node = head;
while(node!=null) {
if (!coll.contains(node)) {
coll.add(node);
}
else {
b = true;
break;
}
node = node.next;
}
return b;
}
}

Submission Detail

  • 17 / 17 test cases passed.
  • Runtime: 3 ms, faster than 19.93% of Java online submissions for Linked List Cycle.
  • Memory Usage: 39.5 MB, less than 11.80% of Java online submissions for Linked List Cycle.

LeetCode - Algorithms - 1290. Convert Binary Number in a Linked List to Integer

Problem

1290. Convert Binary Number in a Linked List to Integer

Java

Bit Manipulation

© Approach 2: Bit Manipulation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
class Solution {
public int getDecimalValue(ListNode head) {
if (head == null)
return 0;
int d = head.val;
while (head.next != null) {
d = (d << 1) | head.next.val;
head = head.next;
}
return d;
}
}

Submission Detail

  • 102 / 102 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Convert Binary Number in a Linked List to Integer.
  • Memory Usage: 36.4 MB, less than 11.21% of Java online submissions for Convert Binary Number in a Linked List to Integer.

my 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
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
class Solution {
public int getDecimalValue(ListNode head) {
int n = 0;
ListNode node = head;
while (node != null) {
n++;
node = node.next;
}
node = head;
int x = 0;
for (int i = n - 1; i > 0; i--) {
x += node.val * (2 << (i - 1));
node = node.next;
}
x += node.val;
return x;
}
}

Submission Detail

  • 102 / 102 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Convert Binary Number in a Linked List to Integer.
  • Memory Usage: 36.4 MB, less than 10.97% of Java online submissions for Convert Binary Number in a Linked List to Integer.

Symmetry, reality's riddle - Marcus du Sautoy - TEDGlobal 2009 - Transcript

On the 30th of May, 1832, a gunshot was heard ringing out across the 13th arrondissement in Paris. (Gunshot) A peasant, who was walking to market that morning, ran towards where the gunshot had come from, and found a young man writhing in agony on the floor, clearly shot by a dueling wound. The young man’s name was Evariste Galois. He was a well-known revolutionary in Paris at the time. Galois was taken to the local hospital where he died the next day in the arms of his brother. And the last words he said to his brother were, “Don’t cry for me, Alfred. I need all the courage I can muster to die at the age of 20.”

It wasn’t, in fact, revolutionary politics for which Galois was famous. But a few years earlier, while still at school, he’d actually cracked one of the big mathematical problems at the time. And he wrote to the academicians in Paris, trying to explain his theory. But the academicians couldn’t understand anything that he wrote. (Laughter) This is how he wrote most of his mathematics.

So, the night before that duel, he realized this possibly is his last chance to try and explain his great breakthrough. So he stayed up the whole night, writing away, trying to explain his ideas. And as the dawn came up and he went to meet his destiny, he left this pile of papers on the table for the next generation. Maybe the fact that he stayed up all night doing mathematics was the fact that he was such a bad shot that morning and got killed.

But contained inside those documents was a new language, a language to understand one of the most fundamental concepts of science – namely symmetry. Now, symmetry is almost nature’s language. It helps us to understand so many different bits of the scientific world. For example, molecular structure. What crystals are possible, we can understand through the mathematics of symmetry.

In microbiology you really don’t want to get a symmetrical object, because they are generally rather nasty. The swine flu virus, at the moment, is a symmetrical object. And it uses the efficiency of symmetry to be able to propagate itself so well. But on a larger scale of biology, actually symmetry is very important, because it actually communicates genetic information.

I’ve taken two pictures here and I’ve made them artificially symmetrical. And if I ask you which of these you find more beautiful, you’re probably drawn to the lower two. Because it is hard to make symmetry. And if you can make yourself symmetrical, you’re sending out a sign that you’ve got good genes, you’ve got a good upbringing and therefore you’ll make a good mate. So symmetry is a language which can help to communicate genetic information.

Symmetry can also help us to explain what’s happening in the Large Hadron Collider in CERN. Or what’s not happening in the Large Hadron Collider in CERN. To be able to make predictions about the fundamental particles we might see there, it seems that they are all facets of some strange symmetrical shape in a higher dimensional space.

And I think Galileo summed up, very nicely, the power of mathematics to understand the scientific world around us. He wrote, “The universe cannot be read until we have learnt the language and become familiar with the characters in which it is written. It is written in mathematical language, and the letters are triangles, circles and other geometric figures, without which means it is humanly impossible to comprehend a single word.

But it’s not just scientists who are interested in symmetry. Artists too love to play around with symmetry. They also have a slightly more ambiguous relationship with it. Here is Thomas Mann talking about symmetry in “The Magic Mountain.” He has a character describing the snowflake, and he says he “shuddered at its perfect precision, found it deathly, the very marrow of death.”

But what artists like to do is to set up expectations of symmetry and then break them. And a beautiful example of this I found, actually, when I visited a colleague of mine in Japan, Professor Kurokawa. And he took me up to the temples in Nikko. And just after this photo was taken we walked up the stairs. And the gateway you see behind has eight columns, with beautiful symmetrical designs on them. Seven of them are exactly the same, and the eighth one is turned upside down.

And I said to Professor Kurokawa, “Wow, the architects must have really been kicking themselves when they realized that they’d made a mistake and put this one upside down.” And he said, “No, no, no. It was a very deliberate act.” And he referred me to this lovely quote from the Japanese “Essays in Idleness” from the 14th century, in which the essayist wrote, “In everything, uniformity is undesirable. Leaving something incomplete makes it interesting, and gives one the feeling that there is room for growth.” Even when building the Imperial Palace, they always leave one place unfinished.

But if I had to choose one building in the world to be cast out on a desert island, to live the rest of my life, being an addict of symmetry, I would probably choose the Alhambra in Granada. This is a palace celebrating symmetry. Recently I took my family – we do these rather kind of nerdy mathematical trips, which my family love. This is my son Tamer. You can see he’s really enjoying our mathematical trip to the Alhambra. But I wanted to try and enrich him. I think one of the problems about school mathematics is it doesn’t look at how mathematics is embedded in the world we live in. So, I wanted to open his eyes up to how much symmetry is running through the Alhambra.

You see it already. Immediately you go in, the reflective symmetry in the water. But it’s on the walls where all the exciting things are happening. The Moorish artists were denied the possibility to draw things with souls. So they explored a more geometric art. And so what is symmetry? The Alhambra somehow asks all of these questions. What is symmetry? When &#91;there&#93; are two of these walls, do they have the same symmetries? Can we say whether they discovered all of the symmetries in the Alhambra?

And it was Galois who produced a language to be able to answer some of these questions. For Galois, symmetry – unlike for Thomas Mann, which was something still and deathly – for Galois, symmetry was all about motion. What can you do to a symmetrical object, move it in some way, so it looks the same as before you moved it? I like to describe it as the magic trick moves. What can you do to something? You close your eyes. I do something, put it back down again. It looks like it did before it started.

So, for example, the walls in the Alhambra – I can take all of these tiles, and fix them at the yellow place, rotate them by 90 degrees, put them all back down again and they fit perfectly down there. And if you open your eyes again, you wouldn’t know that they’d moved. But it’s the motion that really characterizes the symmetry inside the Alhambra. But it’s also about producing a language to describe this. And the power of mathematics is often to change one thing into another, to change geometry into language.

So I’m going to take you through, perhaps push you a little bit mathematically – so brace yourselves – push you a little bit to understand how this language works, which enables us to capture what is symmetry. So, let’s take these two symmetrical objects here. Let’s take the twisted six-pointed starfish. What can I do to the starfish which makes it look the same? Well, there I rotated it by a sixth of a turn, and still it looks like it did before I started. I could rotate it by a third of a turn, or a half a turn, or put it back down on its image, or two thirds of a turn. And a fifth symmetry, I can rotate it by five sixths of a turn. And those are things that I can do to the symmetrical object that make it look like it did before I started.

Now, for Galois, there was actually a sixth symmetry. Can anybody think what else I could do to this which would leave it like I did before I started? I can’t flip it because I’ve put a little twist on it, haven’t I? It’s got no reflective symmetry. But what I could do is just leave it where it is, pick it up, and put it down again. And for Galois this was like the zeroth symmetry. Actually, the invention of the number zero was a very modern concept, seventh century A.D., by the Indians. It seems mad to talk about nothing. And this is the same idea. This is a symmetrical – so everything has symmetry, where you just leave it where it is.

So, this object has six symmetries. And what about the triangle? Well, I can rotate by a third of a turn clockwise or a third of a turn anticlockwise. But now this has some reflectional symmetry. I can reflect it in the line through X, or the line through Y, or the line through Z. Five symmetries and then of course the zeroth symmetry where I just pick it up and leave it where it is. So both of these objects have six symmetries. Now, I’m a great believer that mathematics is not a spectator sport, and you have to do some mathematics in order to really understand it.

So here is a little question for you. And I’m going to give a prize at the end of my talk for the person who gets closest to the answer. The Rubik’s Cube. How many symmetries does a Rubik’s Cube have? How many things can I do to this object and put it down so it still looks like a cube? Okay? So I want you to think about that problem as we go on, and count how many symmetries there are. And there will be a prize for the person who gets closest at the end.

But let’s go back down to symmetries that I got for these two objects. What Galois realized: it isn’t just the individual symmetries, but how they interact with each other which really characterizes the symmetry of an object. If I do one magic trick move followed by another, the combination is a third magic trick move. And here we see Galois starting to develop a language to see the substance of the things unseen, the sort of abstract idea of the symmetry underlying this physical object. For example, what if I turn the starfish by a sixth of a turn, and then a third of a turn?

So I’ve given names. The capital letters, A, B, C, D, E, F, are the names for the rotations. B, for example, rotates the little yellow dot to the B on the starfish. And so on. So what if I do B, which is a sixth of a turn, followed by C, which is a third of a turn? Well let’s do that. A sixth of a turn, followed by a third of a turn, the combined effect is as if I had just rotated it by half a turn in one go. So the little table here records how the algebra of these symmetries work. I do one followed by another, the answer is it’s rotation D, half a turn. What I if I did it in the other order? Would it make any difference? Let’s see. Let’s do the third of the turn first, and then the sixth of a turn. Of course, it doesn’t make any difference. It still ends up at half a turn.

And there is some symmetry here in the way the symmetries interact with each other. But this is completely different to the symmetries of the triangle. Let’s see what happens if we do two symmetries with the triangle, one after the other. Let’s do a rotation by a third of a turn anticlockwise, and reflect in the line through X. Well, the combined effect is as if I had just done the reflection in the line through Z to start with. Now, let’s do it in a different order. Let’s do the reflection in X first, followed by the rotation by a third of a turn anticlockwise. The combined effect, the triangle ends up somewhere completely different. It’s as if it was reflected in the line through Y.

Now it matters what order you do the operations in. And this enables us to distinguish why the symmetries of these objects – they both have six symmetries. So why shouldn’t we say they have the same symmetries? But the way the symmetries interact enable us – we’ve now got a language to distinguish why these symmetries are fundamentally different. And you can try this when you go down to the pub, later on. Take a beer mat and rotate it by a quarter of a turn, then flip it. And then do it in the other order, and the picture will be facing in the opposite direction.

Now, Galois produced some laws for how these tables – how symmetries interact. It’s almost like little Sudoku tables. You don’t see any symmetry twice in any row or column. And, using those rules, he was able to say that there are in fact only two objects with six symmetries. And they’ll be the same as the symmetries of the triangle, or the symmetries of the six-pointed starfish. I think this is an amazing development. It’s almost like the concept of number being developed for symmetry. In the front here, I’ve got one, two, three people sitting on one, two, three chairs. The people and the chairs are very different, but the number, the abstract idea of the number, is the same.

And we can see this now: we go back to the walls in the Alhambra. Here are two very different walls, very different geometric pictures. But, using the language of Galois, we can understand that the underlying abstract symmetries of these things are actually the same. For example, let’s take this beautiful wall with the triangles with a little twist on them. You can rotate them by a sixth of a turn if you ignore the colors. We’re not matching up the colors. But the shapes match up if I rotate by a sixth of a turn around the point where all the triangles meet. What about the center of a triangle? I can rotate by a third of a turn around the center of the triangle, and everything matches up. And then there is an interesting place halfway along an edge, where I can rotate by 180 degrees. And all the tiles match up again. So rotate along halfway along the edge, and they all match up.

Now, let’s move to the very different-looking wall in the Alhambra. And we find the same symmetries here, and the same interaction. So, there was a sixth of a turn. A third of a turn where the Z pieces meet. And the half a turn is halfway between the six pointed stars. And although these walls look very different, Galois has produced a language to say that in fact the symmetries underlying these are exactly the same. And it’s a symmetry we call 6-3-2.

Here is another example in the Alhambra. This is a wall, a ceiling, and a floor. They all look very different. But this language allows us to say that they are representations of the same symmetrical abstract object, which we call 4-4-2. Nothing to do with football, but because of the fact that there are two places where you can rotate by a quarter of a turn, and one by half a turn.

Now, this power of the language is even more, because Galois can say, “Did the Moorish artists discover all of the possible symmetries on the walls in the Alhambra?” And it turns out they almost did. You can prove, using Galois’ language, there are actually only 17 different symmetries that you can do in the walls in the Alhambra. And they, if you try to produce a different wall with this 18th one, it will have to have the same symmetries as one of these 17.

But these are things that we can see. And the power of Galois’ mathematical language is it also allows us to create symmetrical objects in the unseen world, beyond the two-dimensional, three-dimensional, all the way through to the four- or five- or infinite-dimensional space. And that’s where I work. I create mathematical objects, symmetrical objects, using Galois’ language, in very high dimensional spaces. So I think it’s a great example of things unseen, which the power of mathematical language allows you to create.

So, like Galois, I stayed up all last night creating a new mathematical symmetrical object for you, and I’ve got a picture of it here. Well, unfortunately it isn’t really a picture. If I could have my board at the side here, great, excellent. Here we are. Unfortunately, I can’t show you a picture of this symmetrical object. But here is the language which describes how the symmetries interact.

Now, this new symmetrical object does not have a name yet. Now, people like getting their names on things, on craters on the moon or new species of animals. So I’m going to give you the chance to get your name on a new symmetrical object which hasn’t been named before. And this thing – species die away, and moons kind of get hit by meteors and explode – but this mathematical object will live forever. It will make you immortal. In order to win this symmetrical object, what you have to do is to answer the question I asked you at the beginning. How many symmetries does a Rubik’s Cube have?

Okay, I’m going to sort you out. Rather than you all shouting out, I want you to count how many digits there are in that number. Okay? If you’ve got it as a factorial, you’ve got to expand the factorials. Okay, now if you want to play, I want you to stand up, okay? If you think you’ve got an estimate for how many digits, right – we’ve already got one competitor here. If you all stay down he wins it automatically. Okay. Excellent. So we’ve got four here, five, six. Great. Excellent. That should get us going. All right.

Anybody with five or less digits, you’ve got to sit down, because you’ve underestimated. Five or less digits. So, if you’re in the tens of thousands you’ve got to sit down. 60 digits or more, you’ve got to sit down. You’ve overestimated. 20 digits or less, sit down. How many digits are there in your number? Two? So you should have sat down earlier. (Laughter) Let’s have the other ones, who sat down during the 20, up again. Okay? If I told you 20 or less, stand up. Because this one. I think there were a few here. The people who just last sat down.

Okay, how many digits do you have in your number? (Laughs) 21. Okay good. How many do you have in yours? 18. So it goes to this lady here. 21 is the closest. It actually has – the number of symmetries in the Rubik’s cube has 25 digits. So now I need to name this object. So, what is your name? I need your surname. Symmetrical objects generally – spell it for me. G-H-E-Z No, SO2 has already been used, actually, in the mathematical language. So you can’t have that one. So Ghez, there we go. That’s your new symmetrical object. You are now immortal. (Applause)

And if you’d like your own symmetrical object, I have a project raising money for a charity in Guatemala, where I will stay up all night and devise an object for you, for a donation to this charity to help kids get into education in Guatemala. And I think what drives me, as a mathematician, are those things which are not seen, the things that we haven’t discovered. It’s all the unanswered questions which make mathematics a living subject. And I will always come back to this quote from the Japanese “Essays in Idleness”: “In everything, uniformity is undesirable. Leaving something incomplete makes it interesting, and gives one the feeling that there is room for growth.” Thank you. (Applause)