## Thursday, March 29, 2018

### Almost Famous Quantum Polynomial Time

I have been playing with a new complexity class AFQP, defined in a yet-to-be-published manuscript by Alagna and Fleming. A language L is in AFQP if there is a polynomial-time quantum Turing machine Q such that for all inputs x,
• If x is in L, then Q(x) accepts with high probability.
• If x is not in L, then Q(x) rejects with high probability.
• Q(x) only has O(log |x|) quantumly entangled bits as well as a polynomial amount of "deterministic" memory.
AFQP is meant to capture the state of the art of current quantum technology.

AFQP has several nice properties, capturing the complexity of many open problems.
1. If BQP is in AFQP then factoring is in BPP.
2. If one can solve satisfiability in AFQP then the polynomial-time hierarchy collapses.
3. AFQP is contained in the fifth level of the polynomial-time hierarchy.
4. If AFQP is in log-space then matching has a deterministic NC algorithm.
5. Graph isomorphism is in a quasi-polynomial time version of AFQP.
6. AFQP = PPAD iff Nash Equilibrium has solutions we can find in polynomial time.
The proofs use a clever combination of Fourier analysis and semidefinite programming.

Where does the name AFQP come from? The authors claim that they didn't name the class after themselves, and instead say it stands for "Almost Famous Quantum Polynomial Time" as it won't get the fame of BQP. More likely it is because it's April the first and I'm feeling a bit Foolish making up a new complexity class that is just P in disguise.

### A Reduced Turing Award

A Turing machine has an extremely simple instruction set: Move left, move right, read and write. If you want to do real programming, you need something a bit more powerful. So computer architects created chips with more and more operations. As an undergrad at Cornell in the early 80's I worked on coding an email system written in IBM 370 assembly language. As I wrote in a 2011 post,
IBM Assembly language was quite bloated with instructions. There was a command called "Edit and Mark" that went through a range data making modifications based on some other data. This was a single assembly language instruction. We used to joke that there was a single instruction to do your taxes.
After Cornell I spent one year at Berkeley for graduate school where I heard about this new idea: Let's move in the other direction and have a "reduced instruction set computer". Make the chip as simple as possible to simplify the design, save power and increase performance. Fast forward to last week and ACM tapped RISC pioneers John Hennessey and David Patterson for the Turing Award, the highest honor in computer science. They won an award named after the man who created the simplest instruction set of them all.

RISC didn't take over--Intel never really embraced the concept and kept adding new features from real-number operations to AES encryption/decryption built into the processor. GPUs added vector operations and Tensor Processing Units can do machine learning instructions. Added complexity has its complications such as the famous 1994 division bug.

RISC processors do play a role in mobile devices which need to have low power, one can find ARM (Advanced Risc Machines) processors in many mobile phones and tablets. Based on quantity alone there are far many more RISC processors than CISC (C = complex).

These days the lines between the processor and the operating systems blur and we are programming chips. David Patterson continues to work on RISC, with a recent open RISC-V architecture that also supports chip programming. John Hennessey was otherwise occupied--he was president of Stanford from 2000 to 2016.

## Monday, March 26, 2018

### Why do we give citations? How should we give citations?

Why do we cite past work? There are many reasons and they lead to advice on how we should cite past work

1. Give credit where credit it due. Some people over cite and that diminishes any one citation. I once saw a paper that had in the first paragraph: ''Similar work in this field has been done by [list of 20 citations].'' One of the papers in that list was extremely relevent, the rest much less so. This is not really helpful. There should be less citations and more about each one.
2. If you are using a result in a prior paper the user should be able to read that paper. For that reason I try to give the websites of where the paper is. (this might be  less crucial now then it used to be since if a paper is on lnie someplace for free its usually easy to find). Some students ask me if its okay to cite papers on arXiv. Of course it is, especially if it's to guide the reader to a place to read the result. Note also that papers on arXiv are not behind paywalls.
3. At some point a result is so well known that it does not need a citation. It's not clear when this is. I think people write by the Cook-Levin theorem' without citing the original source. Nor do people ever cite Ramsey's original paper either. See next item for why this might be a mistake.
4. A reader might want to know WHEN a result was discovered. For this reason, perhaps people should give references for Cook-Levin or for Ramsey. The original source is often NOT a good place to read a result so I often do  by a theorem of Curly [1] (see also Moe's simplification [2] or Larry's survey [3])'' so I give the reader WHO did it first, when they did it, but also an alternative place to read it. However, when does it end? By the Pythagorean theorem [1] (also see [2])'
5. A reader should know the context of the result.  Is the problem new? Is the problem related to other problems? Has there been much work in this field? Inquiring minds want to know!

## Wednesday, March 14, 2018

### Stephen Hawking (1942-2018)

Stephen Hawking passed away earlier this morning in Cambridge, England. As a brilliant theoretical physicist and best-selling author all while dealing with a debilitating disease, Hawking rose to be the best-known scientist of his time.

I'll leave it to the physics blogs to talk about his research. Hawking inspired me through his 1988 book, A Brief History of Time. Hawking told Time magazine before the magazine's publication "Someone told me that each equation I included in the book would halve the sales. In the end, however, I did put in Einstein’s famous equation E = mc2. I hope that this will not scare off half my potential readers.”

So you read the book and he manages to describe his highly mathematical-based view of the universe without resorting to mathematics, by far the best written popular science book I have read.

A Brief History of Time came out when I was in grad school so it didn't play a role in me becoming an academic but it did make me realize that science has a story to tell. From the preface of my own book.
I took inspiration from Stephen Hawking's A Brief History of Time, which explains physics not through formulas and technicalities but with examples and stories. I attempt to do the same here to explore the spirit and importance of the P versus NP problem.
I am under no illusion that I came even close to Hawking's level of exposition.

A poll taken last year showed most Americans could not name a single living scientist but among the 19% that could, the scientist they named most often was Stephen Hawking. We lost not only a brilliant physicist but one of the great symbols for science of our generation.

## Monday, March 12, 2018

### Wanted: An Easy Proof of a Weak Theorem in NT so that I can get another VDW--> Primes infinite proof to be really easy.

A while back I posted about a proof that Van Der Waerden's theorem implies the number of primes
is infinite (see the post here). That post brought up some logical issues.

More recently there is another proof that the primes are infinite that raises (for me at least) some number theory results and proofs. The proof uses the following theorem:

There are no 4-length Arithmetic Progressions consisting of squares.

This is attributed to Fermat. All of the proofs I've seen of it look difficult.

Here is a sketch of the proof of infinite number of primes from VDW and the theorem above.
Assume that {p1,...,pm} are all of the primes.  Let vi(n) be the power of pi in the factorization of n.

We define the following 2m coloring of N

COL(n) = ( v1(n) mod 2, ... vm(n) mod 2)

There exists a monochromatic 4-AP.  We leave it to the reader to show that you can use this to get a 4-AP of squares.

Using Fermats 4-AP theorem is hard!  In the write up I show how to use a stronger VDW theorem and a weaker (at least easier to prove in my opinion) result in Number Theory to get a different proof.

VDWPlus: for all k,c there exists W such that for all c-colorings of [W] there exists a,d such that

a, a+d, a+2d, ..., a+(k-1)d AND d (that's the PLUS part) are all the same color.

Now to prove primes are infinite. Assume not. p1,...,pm are all of the primes.

Let vi(n) be as above

COL(n) = (v1(n) mod 4, ..., vm(n) mod 4)

just apply this to the k=1 case so we have

a, a+d, d all the same color.  Say the color is (b1,...,bm) where bi in {0,1,2,3}

mult all three by p1^{4-b1} ... pm^{4-bm}.

now we have A, A+D, D all four powers. call them x^4, z^4, y^4 and you
contradict the n=4 case of Fermat'ls last theorem (this is the easiest case and was proven by Fermat)

TO DO: find an even easier theorem in Number Theory to use with a perhaps more advanced form of VDW theorem to get a proof that primes are infinite.

Coda: Cute that I replace one theorem by Fermat with another theorem by Fermat.

## Friday, March 09, 2018

### Data-Driven Programming

Five years ago I posted about Flash Fill, a then new Microsoft Excel feature that would reformat data based on examples. I just checked the latest version of Excel and Flash Fill is still there just working by making suggestions when appropriate. It uses a programming language approach finding the simplest string manipulation program consistent with the examples.

I loved the idea of example-based programming but it did seem pretty limited at the time. With the machine learning revolution we've gone full circle. We solve a number of problems with data and examples alone: voice recognition, face recognition, spam detection, playing Chess and Go from scratch in ways we wouldn't even know how to program.

That's not completely true: Designing a good machine learning program requires programming to get data in a good format and creating the right network structure to learn is still considerably an art. But the real magic does happen when the deep learning process happens creating a neural net that works well in ways we can't fully understand even when we look at the final network produced.

Now "it's all about the data". This hit me when I got an email invitation for the Uber visa card. Unlike other branded cards it gives you no particular discounts or rewards for Uber. Rather it gives you significant cash back for dining and travel, in other words for giving Uber the data about you that can make Uber itself more valuable to you.

Nothing in this post should be new to you readers. But every now and then just take a breadth and realize who much our notions of computing and data have changed over even the past five years.

Programmers aren't going away. Machine learning works well for things humans do well instinctively. But for actual number crunching, simulations and manipulation, even what Flash Fill does, machine learning has much more to do.

## Wednesday, March 07, 2018

### When the Wrong People raise the issue

On my discrete math final in Spring 2017 I had a question:

Prove that sqrt(2/3) is irrational.

A student emailed me the folloing (I paraphrase and am prob not as elegant or as long as he was)

Dr. Gasarch

I received only 2 points out of 20 on Problem 3 of the final- the one that asked us to prove that sqrt(2/3) is irrational. This was graded rather harshly, and the reason is endemic to the entire course. It was unclear what we could and could not assume in this problem. That has been unclear all semester.

I responded (I leave out the name for privacy)

Mr. Student

Come by my office and we will look over  your final. At the same time, bring by your HWs and Midterms to look at. The deadline for regrading those is up; however, either you are correct and I will learn how to run a better course by looking over your HWs and midterms, or you incorrect and you will be enlightened by us looking over them.

We agreed to meet. The Student came all ready to  argue not just points on the final but also about the course in general. I looked forward to this since either I would learn about how to run the course better OR I would enlighten a student!

STUDENT:  I used the obvious fact that the ratio of two irrationals is irrational. How was I supposed to know I had to prove something so obvious!!!!!!!! And only 2 points!!!!!!! Really!!!!!!

BILL: What is the ratio of \sqrt{8} to \sqrt{2}.

STUDENT:  sqrt(8)/sqrt(2) = sqrt(8/2) = sqrt(4) = 2. Why is that relevant?

BILL: You just showed that the ratio of two irrationals could be rational.

STUDENT: Oh.

BILL: Lets look over your HW and midterm and see there were times when it was not clear what you could assume OR if not then I can clear up some misconception you had.

STUDENT: Uh, Uh. Nevermind.

BILL: You are here with your HWs and midterms, lets take a look.

He really didn't want to. I think he really just wanted more points on the final But since he phrased it as a philosphical debate about how the course was run, I took him at his word.  Everything he showed me was either clearly wrong or clearly unclear. None of it fell into the category of `not clear what you can assume'.

This disappointed me. I suspect someone could make a case that my course sometimes does not make it clear what you can assume. Other students with a similar story as above claim my course is to pedantic. But the examples they show me of this are usually just wrong, not marked wrong for being to pedantic.

There is a more general problem here. The students who complain about a  course may well have a valid point to make!  But its usually students who are not very good making the complaint, and hence they are not the ones who could make a good argument.  One thing I have done when a student has a complaint about how I run the course is then ask my TAs about it. This has been helpful sometimes but they are on the other end -- the course is easy for them so its hard for them to see the problems.

Having said all of this I will own up to one flaw I've had which the students complained about incoherently  (see here) and my TA pointed out the fair objection.  I had taught ONE type of Pigeon hold argument and tested them on a very closely related but different type -- as a way of testing if they understood pigeon hole and were not just memorizing. It was a fair question BUT my TA said
(correctly) I was more interested in getting a good test question then, you know, TEACHING them the Pigeon hole principle -- so I should in the future (and I have) teach them LOTS of versions, make sure they understand them, and then if on the exam I give them a variant its more fair. But more importantly he pointed out that I (and this is correct, or was) have a QUESTION I really want to put on the midterm and then teach the course so that it makes sense to do so. The question is fair, but this is NOT the point (which is why the students objections were incoherent- the question was fair). I am setting (some of them) up to fail.  I have CHANGED my Teaching style and exam style since them.

But my point is that the students could not possibly have raised that objection-- partly because the students complaining are not very good, but also because they do not see what goes on behind the scenes.

UPSHOT- if your students have an incoherent complaint there may be something to it and you should ask your TAs.

## Thursday, March 01, 2018

### Me and My Bolt

On Tuesday I got a knock on my car's window. Rolling it down someone asked if I liked my car as he was thinking of buying one himself. Was I driving the latest Tesla? No, the Chevy Bolt, General Motor's newest fully electric car.

On March 31, 2016 me and 180,000 of my closest friends put $1000 down sight unseen on the Tesla 3. As an east coast resident with no prior Tesla I am well down the list even though I made a reservation on the first day. I got disillusioned by early production problems and delays and bait-and-switch emails. Now that some more details regarding Model 3 came out, I wanted to gauge your interest in coming in for a test drive in a Model S. An incredibly well equipped Model S can be had for under$80k and with the $7500 federal tax credit and$1000 referral code from a current owner, you can get into a Model S for close to $70k, meanwhile a Model 3 can cost up to$60k. Model S is considerably quicker and has an incredible amount of space to seat 5 comfortably. It is our flagship vehicle and has 5 years of manufacturing behind it to perfect the build quality of the car. Not to mention a quick turnaround time on delivery. I would love to host you in our showroom so I can showcase some of the incredible features in the Model S.
Meanwhile a GM executive on the Georgia Tech College of Computing's advisory board suggested I take a look at the Bolt. I was skeptical but he arranged for a local dealer to bring down a car to test drive. I got sold and bought my own Bolt in December.

It's an all electric car with no transmission so quick smooth acceleration. The Bolt has a one pedal driving mode as the "gas" pedal also works as a break which slows down the car by pulling power to the battery. The car doesn't even pretend to be mechanical, a screen boots up when I turn the car on, you can shift into park by pressing a button. The rear view "mirror" is really a camera. When driving slowly there is a simulated view from above. A little freaky but it helps with parking. With Android Auto I basically have Google Assistant and Maps in the car which I prefer to an in-car navigation the Bolt doesn't have.

I get over 200 miles on a full charge and can plug in overnight to get enough power to get to work and back. The car has considerable safety features that warn about cars in blind sports or getting too close to the car in front of you or if you drift from lanes. The Bolt lacks any autonomous features even adaptive cruise control or parking assist. I suspect you could get significant autonomous behavior with a software upgrade but I doubt GM would ever do so.

The car is missing some basic features like power seats and a garage door button. No problem, I rigged up Google Assistant to open the garage door when I say the magic words. Far cooler than pressing a button.

It's not as sleek looking as a Tesla and nobody will shoot it into space but I'm driving the future and it is amazing.