Restriction: polynomial time decision of instance is why needed to “decision Problem”?

I am reading book “combinatorial optimization 3rd edition(Bernhard Korte、 Jens Vygen)”.

(latest version is sixth.)

There are some discriptions in this book that I don’t understand

Not all binary strings are instances of Hamiltonian Circuit but only those representing an undirected graph. For most interesting decision problems the in- stances are a proper subset of the 0-1-strings. We require that we can decide in polynomial time whether an arbitrary string is an instance or not:

  • quote from p350

decision problem is pair P = (X,Y), where X is a language decidable in polynomial time.

  • quote p351

Why decision problem required that decide in polynomial time whether an arbitrary string is an instance or not?

I can’t found any reasons of this restriction in the book.

What ability is needed for anticipating enemy actions?

I have a character that has an uncanny ability to be able to anticipate the enemy and figure out what they will do. He can watch how they array themselves for battle and intuitively know what actions they will take. But I don’t want him to be infallible so I would like to roll against an ability.

What ability stat would be responsible?

I don’t think it is intelligence because it isn’t a matter of studying and learning something. It’s more like when you are crossing the road and you judge whether the gap is wide enough for you to get all the way across without being trapped in the middle.

For example, being able to tell whether they will try to flank you or whether they will create a diversion etc. Things you can just tell will happen BEFORE they happen so that you can organise your own side to be ready for it. When you watch a movie you can always tell what’s going to happen before the protagonist does.

The only one that seems likely is wisdom but that’s not what it is usually used for…

Travel Website, No experience needed, Automated Content

Want to sale kylietravel.com No experience needed, new articles are being added automatically. This Website Special Design for Newbies, Who wants to make Money from Amazon, Clickbank, etc.

Site also has a Hotel, Flights and Car rental search featured base on WordPress platform which has information on over 265,000 Hotels and over 600 Airlines the content is updated all the time because it's truly 100% automated. Once the traffic starts coming to this…

Travel Website, No experience needed, Automated Content

Is using typical memory used when working under windows environment a good knowledge of needed memory for a new computer?

Let s suppose I want to buy a new computer. My reasonning for the amount of ram is the following.

Is it correct ?

I look under windows environment how much memory I use when a large amount of applications that I typically use are simultaneously active. This gives me the memory that I need for the next computer.

Not more is needed.

End to End Encrypted Traffic – Web Application Firewall needed?

Background

We have a Java Spring Server, MongoDB and an Angular Frontend.

Some Application Security Configs:

  • TLS
  • Basic Authentication (Password Strength Policy)
  • XSS Protection (Content Security Policy)
  • CSRF Protection (Double Submit Cookie)

All important user data which they generate through chats, creating topics, etc… is end to end encrypted (E2EE).

Now our hosting company can add a WAF (Web Application Firewall) to the Server Setup.

From the hoster’s advertisement:

OWASP Top 10 Protection:

  • Bot-Access Control
  • Remote File Inclusion
  • Illegal Resource Access- SQL Injection
  • Blocking policy (block request, block IP, block session)

Question

Do we need WAF if most of our data is E2EE? What would be the benefit of it in our setup?

String matching problem needed some explanation

This is a question from CLRS book. (Chapter 32, string matching, the question is the problem for the whole chapter, it’s in the end of the chapter)

Let $ y^i$ denote the concatenation of string y with itself $ i$ times. For example, $ (ab)^{3}$ = $ ababab$ . We say that a string $ x\in X$ has repetition factor $ r$ if x = $ y^{r}$ for some string $ y\in X$ and some $ r > 0$ . Let $ p(x)$ denote the largest $ r$ such that $ x$ has repetition factor $ r$ . Give an efficient algorithm that takes as input a pattern $ P[1..m]$ and computes the value $ p(P_i)$ for $ i = 1, 2,\dots,m$ . What is the running time of your algorithm?

I found an answer like this: First compute Prefix function (based on the prefix function from the book), so we return $ π$ . Then, Suppose that $ π[i] = i −k$ . If $ k|i$ , we know that $ k$ is the length of the primitive root, so, the word has a repetition factor of $ \frac{i}{k}$ . We also know that there is no smaller repetition factor $ i$ . Now, suppose that we have $ k$ not dividing $ i$ . We will show that we can only have the trivial repetition factor of 1. Suppose we had some repetition $ y^{r} = \Pi$ . Then, we know that $ π[i] ≥ y^{r}−1$ . However, if we have it strictly greater than this, this means that we can write the $ y$ ’s themselves as powers because we have them aligning with themselves.

COMPUTE-PREFIX-FUNCTION (P) 1 m = P.length 2 let π be a new array 3 π[1]= 0 4 k = 0 5 for q = 2 to m 6    while k > 0 and P[k+1] != P[q] 7       k = π[q] 8    if  P[k+1] != P[q] 9       k = k + 1 10   π[q] = k 11 return π 

The prefix function is a part of KMP algorithm

KMP-MATCHER (T,P) 1 n= T.length 2 m =P.length 3 π=COMPUTE-PREFIX-FUNCTION (P) 4 q= 0 // number of characters matched 5 for i = 1 to n // scan the text from left to right 6    while q > 0 and P[q+1] != T[i] 7        q= π[q] // next character does not match 8    if P[q+1] == T[i+1] 9        q = q + 1 // next character matches 10   if q == m // is all of P matched? 11       print “Pattern occurs with shift” i - m 12       q=π[q] // look for the next match 

I can’t still really understand completely the answer. Why should we suppose $ k$ not dividing $ i$ ? And the explanation for the case of $ k$ not dividing $ i$ , the repetition factor is 1, is confusing to me.

String matching problem needed some explanation

This is a question from CLRS book. (Chapter 32, string matching, the question is the problem for the whole chapter, it’s in the end of the chapter)

Let $ y^i$ denote the concatenation of string y with itself $ i$ times. For example, $ (ab)^{3}$ = $ ababab$ . We say that a string $ x\in X$ has repetition factor $ r$ if x = $ y^{r}$ for some string $ y\in X$ and some $ r > 0$ . Let $ p(x)$ denote the largest $ r$ such that $ x$ has repetition factor $ r$ . Give an efficient algorithm that takes as input a pattern $ P[1..m]$ and computes the value $ p(P_i)$ for $ i = 1, 2,\dots,m$ . What is the running time of your algorithm?

I found an answer like this: First compute Prefix function (based on the prefix function from the book), so we return $ π$ . Then, Suppose that $ π[i] = i −k$ . If $ k|i$ , we know that $ k$ is the length of the primitive root, so, the word has a repetition factor of $ \frac{i}{k}$ . We also know that there is no smaller repetition factor $ i$ . Now, suppose that we have $ k$ not dividing $ i$ . We will show that we can only have the trivial repetition factor of 1. Suppose we had some repetition $ y^{r} = \Pi$ . Then, we know that $ π[i] ≥ y^{r}−1$ . However, if we have it strictly greater than this, this means that we can write the $ y$ ’s themselves as powers because we have them aligning with themselves.

COMPUTE-PREFIX-FUNCTION (P) 1 m = P.length 2 let π be a new array 3 π[1]= 0 4 k = 0 5 for q = 2 to m 6    while k > 0 and P[k+1] != P[q] 7       k = π[q] 8    if  P[k+1] != P[q] 9       k = k + 1 10   π[q] = k 11 return π 

The prefix function is a part of KMP algorithm

KMP-MATCHER (T,P) 1 n= T.length 2 m =P.length 3 π=COMPUTE-PREFIX-FUNCTION (P) 4 q= 0 // number of characters matched 5 for i = 1 to n // scan the text from left to right 6    while q > 0 and P[q+1] != T[i] 7        q= π[q] // next character does not match 8    if P[q+1] == T[i+1] 9        q = q + 1 // next character matches 10   if q == m // is all of P matched? 11       print “Pattern occurs with shift” i - m 12       q=π[q] // look for the next match 

I can’t still really understand completely the answer. Why should we suppose $ k$ not dividing $ i$ ? And the explanation for the case of $ k$ not dividing $ i$ , the repetition factor is 1, is confusing to me.