R plot text: How to add regular text prefix to polynomial rendered in exponent form (not ^)

I’m trying to add this text to a plot: “Model: y = 1 + 2x – 3x^2 + 4x^3” where actual exponents are rendered as such (no ^ chars). (See screenshot)

Below is repro code. The first text() call works fine (no prepended regular text), but the second does not (with prepended text). (Execute soTest() to repro.)

Any suggestions? I guess I don’t know which R keywords to search for to find a solution. Any help would be appreciated! (Please pardon the camel-casing, I’m writing a slide deck for an audience with at least a few non-R coders.)

evalPoly = function( x, coeff ) {     if ( length( coeff ) < 1 ) return( c(0) )        termSum <- 0     for ( i in 1:length(coeff) ) {         termSum <- termSum + coeff[i] * x^(i-1)     }     return( termSum ) }  soTest <- function() {     coeff <- c( 1, 2, -3, 4 )     x <- 1:8     y <- evalPoly( x, coeff )     plot( x, y )     text( 2, 1600, parse( text="1+2*x-3*x^2+4*x^3" ), adj=0 )     text( 2, 1400, parse( text="Model:  y = 1+2*x-3*x^2+4*x^3" ), adj=0 ) } 

resulting plot

Can any NP-Complete Problem be solved using at most polynomial space (but while using exponential time?)

I read about NPC and its relationship to PSPACE and I wish to know whether NPC problems can be deterministicly solved using an algorithm with worst case polynomial space requirement, but potentially taking exponential time (2^P(n) where P is polynomial).

Moreover, can it be generalised to EXPTIME in general?

The reason I am asking this is that I wrote some programs to solve degenerate cases of an NPC problem, and they can consume very large amounts of RAM for hard instances, and I wonder if there is a better way. For reference see https://fc-solve.shlomifish.org/faq.html .

Master theorem: When a $f(n)$ is smaller or larger than $n^{log_b a}$by less than a polynomial factor

I was revising master theorem from https://brilliant.org/wiki/master-theorem/ and I was trying to solve a question.

Which of the following asymptotically grows faster.

(a) $ T(n) = 4T(n/2) + 10n $

(b) $ T(n) = 8T(n/3) + 24n^2 $

(c) $ T(n) = 16T(n/4) + 10n^2 $

(d) $ T(n) = 25T(n/5) + 20(nlogn)^{1.99} $

(e) They all asymptotically the same

My calculation says, (a) is $ \theta(n^2)$ (b) is $ \theta(n^2)$ (c) is $ \theta(n^2logn)$ . Now how can I evaluate (d)?

If $ f(n)$ is smaller or larger than $ n^{log_b a}$ by less than a polynomial factor, how can I solve T(n)?

Why does coNP⊆NP∖P imply that the polynomial hierarchy collapses?

I was looking for some information on 1-in-3 SAT and came across this paper, last updated 9 days ago, which claims that the Polynomial Time Hierarchy collapses “to the level above P=NP”. That’s quite exciting if you ask me, although I don’t have the toolkit to understand the actual proof. My question is about something much simpler.

Specifically, in the abstract on arxiv, the author writes,

Our proof shows the structure formerly known as the Polynomial Hierarchy collapses to the level above P=NP. That is, we show that coNP⊆NP∖P.

Could anyone help me understand why these two statements are equivalent?

An explicit formula for characteristic polynomial of matrix tensor product

Consider two polynomials P and Q and their companion matrices. It seems that char polynomial of tensor product of said matrices would be a polynomial with roots that are all possible pairs product of roots of P,Q.

I guess its coefficients could be expressed through coefficients of P and Q. But I don’t know the explicit formula and I cannot find it. I also failed to find it out myself — I tried different approaches. Maybe it should be that characteristic polynomial, maybe resultant of some form, but..

I hope this is done by someone already.

Homogeneous basis on a polynomial subalgebra

Let $ k$ be an algebraically closed field of characteristic $ 0$ and $ A=k[X_1, \ldots, X_n]$ with the grading induced by the total degree. Let $ B$ be a graded $ k$ -subalgebra of $ A$ , ie, if $ (A_k)$ is the grading of $ A$ , then $ (B \cap A_k)$ is the grading of $ B$ . Suppose $ B$ is polynomial, ie freely generated by some $ b_1, \ldots, b_r$ . Can $ B$ be always freely generated by homogeneous elements?

Polynomial equations parametrized by binary forms

Consider the equation $ $ \displaystyle Ax^p + By^q = Cz^r, A,B,C \in \mathbb{Z}, \gcd(x,y,z) = 1, p,q,r \geq 2.$ $

When $ p^{-1} + q^{-1} + r^{-1} > 1$ , the above equation is called spherical and satisfies an identity of the form

$ $ \displaystyle x = f(u,v), y = g(u,v), z = h(u,v)$ $

where $ f,g,h$ are binary forms with complex coefficients. Beukers showed that all solutions to the equation are parametrized by a finite family of such binary forms with integer coefficients.

We now consider the equation

$ $ \displaystyle x^r + y^2 = Cz^2, \gcd(x,y,z) = 1, C \in \mathbb{Z}, r \geq 3.$ $

This equation is spherical, and if it has one integer solution then it will have infinitely many due to the existence of a polynomial parametrization (by binary forms). Suppose that it does indeed have a solution and we have a parametrization $ x = f, y = g, z = h$ as above. What can we say about the discriminants of $ f,g,h$ ?

Closure under polynomial reduction

Having some trouble generalizing when a complexity class $ D$ is closed under polynomial reduction.

For instance, take the following examples:

  1. $ \bigcup_{c \ge 1} \mathsf{DTime}(2^{cn^5})$
  2. $ \bigcup_{c \ge 1} \mathsf{DTime}(5^{cn})$
  3. $ \bigcup_{c \ge 1} \mathsf{DTime}(n^{c\log^5n})$

$ P$ is contained in all of these classes, so if we are given a problem $ A$ which belongs to one of those classes, and a reduction from another problem $ B$ to $ A$ , the polynomial reduction won’t affect the overall decision run-time. Can it be generalized to any class larger then $ P$ ?