Galois theory

Go to the roots of these calculations! Group the operations. Classify them according to their complexities rather than their appearances! This, I believe, is the mission of future mathematicians. This is the road on which I am embarking in this work.

Ne pleure pas, Alfred ! J’ai besoin de tout mon courage pour mourir à vingt ans ! (Don’t cry, Alfred! I need all my courage to die at twenty!) - Évariste Galois(1811 – 1832)

No episode in the history of thought is more moving than the life of Evariste Galois — the young Frenchman who passed like a meteor about 1828, devoted a few feverish years to the most intense meditation, and died in 1832 from a wound received in a duel, at the age of twenty. He was still a mere boy, yet within these short years he had accomplished enough to prove indubitably that he was one of the greatest mathematicians of all time. When one sees how terribly fast this ardent soul, this wretched
and tormented heart, were consumed, one can but think of the beautiful meteoric showers of a summer night. But this comparison is misleading, for the soul of Galois will burn on throughout the ages and be a perpetual flame of inspiration. His fame is incorruptible; indeed the apotheosis will become more and more splendid with the gradual increase of human knowledge. (George Sarton)

The Paris circles with their intensive mathematical enterprise, produced around 1830 with Evariste Galois a genius of the highest quality, who, like a comet, vanished just as fast as he had appeared. (Dirk Jan Struik)

In many ways, Galois is to be regarded as the father of modern algebra.

The great Austrian mathematician Emil Artin wrote about Galois, “Since my mathematical youth, I have been under the spell of the classical theory of Galois. This charm has forced me to return to it again and again.”

Galois’s invention of groups was a stroke of genius. After all, the great mathematician Abel, who worked on the problem of solvability by radicals at the same time, did not come up with group theory. Indeed, only Cauchy, on his return to France in the 1840s, seemed to appreciate Galois’s achievement, and Cauchy’s intense group theoretical studies led to the use of group theory in other fields of mathematics. (Joseph Rotman, the University of Illinois)

Galois wrote three letters the night before he was entangled in the game of Russian roulette that led to his death. One of these had further details of the brilliant mathematical theory he had developed. Mathematician Hermann Weyl said of this testament, “This letter, if judged by the novelty and profundity of ideas it contains, is perhaps the most substantial piece of writing in the whole literature of mankind.” After his tragic death, his brother passed his papers to a leading French mathematician, Joseph Liouville, who edited Galois’s collected works for publication in 1846. Only then did his extraordinary brilliance become apparent to the mathematical world.

The main object of Évariste Galois’s investigations is the conditions of solvability of equations by radicals. The author constructs the fundamentals of a general theory which he applies in detail to any equation whose power is a prime number. ・・・ my diligence was rewarded and I felt extraordinary content at the moment when, having made some minor corrections, was convinced in the validity of the method Galois used to prove this beautiful theorem. (Joseph Liouville)

But Liouville’s article was still too far-fetched for other mathematicians to enjoy and understand. It took another 24 years to find a French mathematician outstanding enough to better understand Galois and make his ideas limpid. This outstanding mathematician is Camille Jordan. In fact, Jordan’s 1870 book on Galois theory was so well-written that German mathematician Felix Klein found it as readable as a German book!

It would take another 82 years for the great Austrian mathematician Emil Artin to finally give the Galois theory its modern form.

Instead of using infinite groups, Galois began with a particular equation and constructed his group from a handful of solutions to the equation. It was groups from the solutions to quintic equations which allowed Galois to derive his results about these equations. A century and a half later, Wiles would use Galois’s work as the foundation for his proof of the Taniyama—Shimura conjecture. (Fermat’s Last Theorem, Simon Singh)

There is a general principle, which is very fruitful in mathematics that if you want to learn something about a mathematical object, investigate its automorphism group (Symmetry, Hermann Weyl)

Galois theory paved the way for modern algebraic thinking.

Galois theory is a very difficult topic usually only introduced in the final year of an undergraduate mathematics degree.

Galois theory is a very big subject, and until you are quite immersed in mathematical study in a way which is unusual unless studying for a degree in maths, it can seem quite pointless.

To understand Galois theory, you have to be comfortable with vector spaces and finite group theory. If you are not comfortable with those concepts, you should learn those first. Do not attempt to study Galois theory or any mathematical subject before you’ve mastered the prerequisites. It’s pointless, frustrating, and damaging.

Before embarking on the study of Galois theory, you will need to have mastered basic linear algebra really well, up to and including linear algebra over arbitrary fields, the idea of dimension, linear transformations, kernels, images, subspaces, bases and linear independence.

A better preparation includes knowing about groups, homomorphisms, the isomorphism theorems, permutations and parity, cyclic groups, abelian groups and ideally solvable groups. A good first course in group theory will make it a lot easier for you.


Legends in Computer science and engineering

Donald Knuth

Donald Knuth

Donald Knuth has been described as the Euclid of computer science.

Bill Gates has praised the difficulty of the subject matter in The Art of Computer Programming, stating, “If you think you’re a really good programmer … You should definitely send me a résumé if you can read the whole thing.”

Ken Thompson

Thompson (left) with Dennis Ritchie

To what extent should one trust a statement that a program is free of Trojan horses? Perhaps it is more important to trust the people who wrote the software. (Reflections on Trusting Trust, Ken Thompson)

in his Turing Award lecture, he described how he had incorporated a backdoor security hole in the original UNIX C compiler. To do this, the C compiler recognized when it was recompiling itself and the UNIX login program. When it recompiled itself, it modified the compiler so the compiler backdoor was included. When it recompiled the UNIX login program, the login program would allow Thompson to always be able to log in using a fixed set of credentials.

…the fact that Ken had always wanted to write an operating system of his own was what led fairly directly to Unix (Dennis Ritchie)

Dennis Ritchie

Dennis Ritchie at the Japan Prize Foundation in May 2011

My undergraduate experience convinced me that I was not smart enough to be a physicist, and that computers were quite neat. My graduate school experience convinced me that I was not smart enough to be an expert in the theory of algorithms and also that I liked procedural languages better than functional ones.

Bill Joy

BBN had a big contract to implement TCP/IP, but their stuff didn’t work, and grad student Joy’s stuff worked. So they had this big meeting and this grad student in a T-shirt shows up, and they said, “How did you do this?” And Bill said, “It’s very simple — you read the protocol and write the code.”

Linus Torvalds

John D. Carmack

Carmack at the 2017 Game Developers Choice Awards

In the information age, the barriers [to entry into programming] just aren’t there. The barriers are self imposed. If you want to set off and go develop some grand new thing, you don’t need millions of dollars of capitalization. You need enough pizza and Diet Coke to stick in your refrigerator, a cheap PC to work on, and the dedication to go through with it. We slept on floors. We waded across rivers.

Anders Hejlsberg

Anders Hejlsberg

Anders Hejlsberg’s GitHub profile
https://github.com/ahejlsberg

LeetCode - Algorithms - 160. Intersection of Two Linked Lists

Problem

160. Intersection of Two Linked Lists

Notes

  • If the two linked lists have no intersection at all, return null.
  • The linked lists must retain their original structure after the function returns.
  • Your code should preferably run in O(n) time and use only O(1) memory.

Java

my solution of O(n) time and O(1) memory

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
47
48
49
50
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution {
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
if (headA == null || headB == null)
return null;
ListNode nodeA = headA;
int lenA = 0;
while (nodeA != null) {
lenA++;
nodeA = nodeA.next;
}
int lenB = 0;
ListNode nodeB = headB;
while (nodeB != null) {
lenB++;
nodeB = nodeB.next;
}
nodeA = headA;
nodeB = headB;
if (lenA < lenB) {
for (int i = 0; i < lenB - lenA; i++) {
nodeB = nodeB.next;
}
}
if (lenA > lenB) {
for (int i = 0; i < lenA - lenB; i++) {
nodeA = nodeA.next;
}
}
ListNode node = null;
if (nodeA == nodeB)
node = nodeA;
while (nodeA != nodeB) {
nodeA = nodeA.next;
nodeB = nodeB.next;
node = nodeA;
}
return node;
}
}

Submission Detail

  • 46 / 46 test cases passed.
  • Runtime: 1 ms, faster than 98.53% of Java online submissions for Intersection of Two Linked Lists.
  • Memory Usage: 41.7 MB, less than 10.90% of Java online submissions for Intersection of Two Linked Lists.

stack

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
import java.util.Deque;
import java.util.LinkedList;

/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution {
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
if (headA == null || headB == null)
return null;
Deque<ListNode> stkA = new LinkedList<ListNode>();
ListNode node = headA;
while (node != null) {
stkA.push(node);
node = node.next;
}
Deque<ListNode> stkB = new LinkedList<ListNode>();
node = headB;
while (node != null) {
stkB.push(node);
node = node.next;
}
while (!stkA.isEmpty() && !stkB.isEmpty()) {
if (stkA.peek() == stkB.peek()) {
node = stkA.pop();
stkB.pop();
} else
break;
}
return node;
}
}

Submission Detail

  • 46 / 46 test cases passed.
  • Runtime: 2 ms, faster than 38.55% of Java online submissions for Intersection of Two Linked Lists.
  • Memory Usage: 42.6 MB, less than 11.53% of Java online submissions for Intersection of Two Linked Lists.

Let Us Now Praise Prime Numbers

by Helen Spalding(1920–1991)

The poem captures elements that have made primes an object of fascination since the time of Euclid. Spalding is herself a mysterious figure whose life is difficult to trace after her last publication in The London Magazine in 1961.

Let us now praise prime numbers
With our fathers who begat us:
The power, the peculiar glory of prime numbers
Is that nothing begat them,
No ancestors, no factors,
Adams among the multiplied generations.

None can foretell their coming.
Among the ordinal numbers
They do not reserve their seats, arrive unexpected.
Along the lines of cardinals
They rise like surprising pontiffs,
Each absolute, inscrutable, self-elected.

In the beginning where chaos
Ends and zero resolves,
They crowd the foreground prodigal as forest,
But middle distance thins them,
Far distance to infinity
Yields them rare as unreturning comets.

O prime improbable numbers,
Long may formula-hunters
Steam in abstraction, waste to skeleton patience:
Stay non-conformist, nuisance,
Phenomena irreducible
To system, sequence, pattern or explanation.


LeetCode - Algorithms - 83. Remove Duplicates from Sorted List

Problem

83. Remove Duplicates from Sorted List

Java

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.
* 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 ListNode deleteDuplicates(ListNode head) {
if (head==null)
return head;
ListNode node = head;
while(node!=null) {
if (node.next!=null && node.next.val==node.val) {
ListNode obsoleteNode = node.next;
node.next = node.next.next;
obsoleteNode = null;
}
else
node = node.next;
}
return head;
}
}

Submission Detail

  • 165 / 165 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Remove Duplicates from Sorted List.
  • Memory Usage: 38.4 MB, less than 10.24% of Java online submissions for Remove Duplicates from Sorted List.

LeetCode - Algorithms - 876. Middle of the Linked List

Problem

876. Middle of the Linked List

Java

1

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 ListNode middleNode(ListNode head) {
List<ListNode> list = new ArrayList<ListNode>();
ListNode node = head;
while(node!=null) {
list.add(node);
node = node.next;
}
int n = list.size();
return list.get(n/2);
}
}

Submission Detail

  • 15 / 15 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Middle of the Linked List.
  • Memory Usage: 36.3 MB, less than 11.39% of Java online submissions for Middle of the Linked List.

2

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.
* 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 ListNode middleNode(ListNode head) {
int n = 0;
ListNode node = head;
while(node!=null) {
n++;
node = node.next;
}
node = head;
n /= 2;
while(n>0) {
node = node.next;
n--;
}
return node;
}
}

Submission Detail

  • 15 / 15 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Middle of the Linked List.
  • Memory Usage: 36.5 MB, less than 11.39% of Java online submissions for Middle of the Linked List.

Two pointers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* 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 ListNode middleNode(ListNode head) {
ListNode slowPointer = head;
ListNode fastPointer = head;
while (fastPointer != null && fastPointer.next != null) {
fastPointer = fastPointer.next.next;
slowPointer = slowPointer.next;
}
return slowPointer;
}
}

Submission Detail

  • 15 / 15 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Middle of the Linked List.
  • Memory Usage: 36 MB, less than 9.03% of Java online submissions for Middle of the Linked List.

LeetCode - Algorithms - 203. Remove Linked List Elements

Problem

203. Remove Linked List Elements

Java

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
/**
* 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 ListNode removeElements(ListNode head, int val) {
if (head == null)
return head;
ListNode previousNode = head;
if (head != null) {
ListNode node = head.next;
while (node != null) {
if (node.val == val) {
ListNode obsoleteNode = node;
previousNode.next = node.next;
obsoleteNode = null;
}
else
previousNode = node;
node = node.next;
}
}
if (head.val == val) {
ListNode obsoleteNode = head;
head = head.next;
obsoleteNode = null;
}
return head;
}
}

Submission Detail

  • 65 / 65 test cases passed.
  • Runtime: 1 ms, faster than 82.56% of Java online submissions for Remove Linked List Elements.
  • Memory Usage: 40 MB, less than 10.13% of Java online submissions for Remove Linked List Elements.

English-language idioms

English idioms, proverbs, and expressions are an important part of everyday English. Learning to use common idioms and expressions will make your English sound more native, so it’s a good idea to master some of these expressions.

The most common English idioms

A blessing in disguise

as part of a sentence

Meaning

a good thing that seemed bad at first

A dime a dozen

as part of a sentence

Meaning

(US) Anything that is common, inexpensive, and easy to get or available anywhere.

Beat around the bush

as part of a sentence

Meaning

  • To treat a topic but omit its main points, often intentionally or to delay or avoid talking about something difficult or unpleasant.
  • Avoid saying what you mean, usually because it is uncomfortable

Better late than never

by itself

Meaning

Better to arrive late than not to come at all

Bite the bullet

as part of a sentence

Meaning

  • To endure a painful or unpleasant situation that is unavoidable.

Break a leg

by itself

Meaning

  • A saying from the theatre that means “good luck”.
  • a typical English idiom used in theatre to wish a performer “good luck”.

Call it a day

as part of a sentence

Meaning

  • To declare the end of a task.
  • Stop working on something

Cut somebody some slack

as part of a sentence

Meaning

Don’t be so critical

Cutting corners

as part of a sentence

Meaning

Doing something poorly in order to save time or money

Easy does it

by itself

Meaning

Slow down

Get out of hand

as part of a sentence

Meaning

Get out of control

Get something out of your systems

as part of a sentence

Meaning

Do the thing you’ve been wanting to do so you can move on

Get your act together

by itself

Meaning

Work better or leave

Give someone the benefit of the doubt

as part of a sentence

Meaning

Trust what someone says

Go back to the drawing board

as part of a sentence

Meaning

Start over

Hang in there

by itself

Meaning

Don’t give up

Hit the sack/sheets/hay

as part of a sentence

Meaning

  • To go to bed; to go to sleep.

It’s not rocket science

by itself

Meaning

It’s not complicated

Let someone off the hook

as part of a sentence

Meaning

To not hold someone responsible for something

Make a long story short

as part of a sentence

Meaning

Tell something briefly

Miss the boat

as part of a sentence

Meaning

It’s too late

No pain, no gain

by itself

Meaning

You have to work for what you want

On the ball

as part of a sentence

Meaning

Doing a good job

Pull someone’s leg

as part of a sentence

Meaning

  • To tease or joke by telling a lie.
  • The phrase, from Scotland, originally meant to make a fool of someone, often by cheating them.
  • To joke with someone

Pull yourself together

by itself

Meaning

Calm down

So far so good

by itself

Meaning

Things are going well so far

Speak of the devil

by itself

Meaning

  • the short form of the English-language idiom “Speak of the devil and he doth appear” (or its alternative form “speak of the devil and he shall appear”).
  • The form “talk of the devil” is also in use in England. It is used when an object of discussion unexpectedly becomes present during the conversation.

That’s the last straw

by itself

Meaning

  • My patience has run out
  • The last straw is an idiom referring to the Straw that broke the camel’s back.

The best of both worlds

as part of a sentence

Meaning

An ideal situation

Time flies when you’re having fun

by itself

Meaning

You don’t notice how long something lasts when it’s fun

To get bent out of shape

as part of a sentence

Meaning

To get upset

To make matters worse

as part of a sentence

Meaning

Make a problem worse

Under the weather

as part of a sentence

Meaning

  • Feeling sick or poorly.
  • From under the weather bow (“affected by bad weather; seasick”); weather bow is a nautical term referring to the side of a ship exposed to bad weather.

We’ll cross that bridge when we come to it

by itself

Meaning

Let’s not talk about that problem right now

Wrap your head around something

as part of a sentence

Meaning

Understand something complicated

You can say that again

by itself

Meaning

  • That is very true; an expression of wholehearted agreement.
  • (idiomatic, in response to another person) That is very true.

Your guess is as good as mine

by itself

Meaning

I have no idea


LeetCode - Algorithms - 414. Third Maximum Number

Problem

414. Third Maximum Number

Java

my solution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Solution {
public int thirdMax(int[] nums) {
final int N = nums.length;
int max = nums[0];
for (int i = 1; i < N; i++) {
if (nums[i] > max)
max = nums[i];
}
int m2 = Integer.MIN_VALUE;
for (int i = 0; i < N; i++) {
if (nums[i] < max && nums[i] > m2)
m2 = nums[i];
}
long m3 = Long.MIN_VALUE;
for (int i = 0; i < N; i++) {
if (nums[i] < m2 && nums[i] > m3)
m3 = nums[i];
}
return m3 > Long.MIN_VALUE ? new Long(m3).intValue() : max;
}
}

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 1 ms, faster than 90.82% of Java online submissions for Third Maximum Number.
  • Memory Usage: 39.2 MB, less than 7.88% of Java online submissions for Third Maximum Number.

PriorityQueue and HashSet

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.*;

class Solution {
public int thirdMax(int[] nums) {
Queue<Integer> q = new PriorityQueue<Integer>();
Set<Integer> set = new HashSet<Integer>();
for (int i : nums) {
if (!set.contains(i)) {
set.add(i);
q.add(i);
}
if (q.size() > 3) {
set.remove(q.poll());
}
}
if (q.size() < 3) {
while (q.size() > 1)
q.poll();
}
return q.peek();
}
}

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 5 ms, faster than 21.06% of Java online submissions for Third Maximum Number.
  • Memory Usage: 38.7 MB, less than 10.02% of Java online submissions for Third Maximum Number.

TreeSet

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

class Solution {
public int thirdMax(int[] nums) {
SortedSet<Integer> treeSet = new TreeSet<Integer>();
for (int num : nums) {
treeSet.add(num);
if (treeSet.size() > 3)
treeSet.remove(treeSet.first());
}
return treeSet.size() < 3 ? treeSet.last() : treeSet.first();
}
}

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 4 ms, faster than 39.33% of Java online submissions for Third Maximum Number.
  • Memory Usage: 38.6 MB, less than 10.02% of Java online submissions for Third Maximum Number.

javascript

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
/**
* @param {number[]} nums
* @return {number}
*/
var thirdMax = function(nums) {
var max=nums[0],min=nums[0];
for(var i=1;i<nums.length;i++) {
if (nums[i]>max)
max = nums[i];
if (nums[i]<min)
min = nums[i];
}
var lowguard = min-1;
var m2 = lowguard;
for(var i=0;i<nums.length;i++) {
if (nums[i]<max && nums[i]>m2)
m2 = nums[i];
}
var m3 = lowguard;
for(var i=0;i<nums.length;i++) {
if (nums[i]<m2 && nums[i]>m3)
m3 = nums[i];
}
return m3!=lowguard?m3:max;
};

Submission Detail

  • 26 / 26 test cases passed.
  • Runtime: 80 ms, faster than 72.32% of JavaScript online submissions for Third Maximum Number.
  • Memory Usage: 38.9 MB, less than 5.00% of JavaScript online submissions for Third Maximum Number.

The best-known quantum algorithms

Shor’s algorithm

Shor’s algorithm is a polynomial-time quantum computer algorithm for integer factorization. It was invented in 1994 by the American mathematician Peter Shor.

Shor’s algorithms runs much (almost exponentially) faster than the best-known classical algorithm for factoring, the general number field sieve.

Shor’s algorithm was the first non-trivial quantum algorithm showing a potential of ‘exponential’ speed-up over classical algorithms, It captured the imagination of many researchers who took notice of quantum computing because of its promise of truly remarkable algorithmic acceleration. Therefore, to implement Shor’s algorithm is comparable to the ‘Hello, World’ of classical computing. (Mark Ritter, senior manager of physical sciences at IBM)

Peter Shor

Shor: I’ve been writing poetry occasionally since high school, but I never considered making a career of it.

If computers that you build are quantum,
Then spies of all factions will want ‘em.
Our codes will all fail,
And they’ll read our email,
Till we’ve crypto that’s quantum, and daunt ‘em.
(by Jennifer and Peter Shor)

You can see why I chose a career as a scientist rather than as a poet.(Shor’s joke)

There are several aspects of quantum mechanics that make quantum computers more powerful than digital computers. One of these is the superposition principle, which says that a quantum system can be in more than one state at the same time. Another one of these is interference; a third is the exponentially large size of the state space of a quantum mechanical system.

There are some problems that quantum computers seem to be exponentially faster than classical computers at, like factoring. There are other problems that quantum computers don’t speed up at all, like sorting. So asking “which is better, a classical computer or a quantum computer” is like asking “which is a better transportation device, a boat or a car.” It really depends on what you want to do with it.

Grover’s algorithm

Grover’s algorithm is a quantum algorithm for searching an unstructured database or an unordered list. It was devised by Lov Grover in 1996.

Grover’s algorithm runs quadratically faster than the best possible classical algorithm for the same task, a linear search.

Unlike other quantum algorithms, which may provide exponential speedup over their classical counterparts, Grover’s algorithm provides only a quadratic speedup. However, even quadratic speedup is considerable when N is large.

Grover’s algorithm demonstrate the power of quantum parallelism, in specific, making queries in parallel.