If we prove that there is an NP-complete problem that is P, Can we consider that P=NP?

I discover this in All NP problems reduce to NP-complete problems: so how can NP problems not be NP-complete?

  • If problem B is in P and A reduces to B, then problem A is in P.
  • Problem B is NP-complete if B is in NP and for every problem in A in NP, A reduces to B.
  • Problem C is NP-complete if C is in NP and for some NP-complete problem B, B reduces to C.

My questions are (if I then II then(?) III/I. If III/I and III/II then IV.)

  • I: Are there a generalized form to reduces NP problem to either P or NP-complete?
  • II: Are there a certain number of NP-complete problems?
  • III/I: Are all of the NP-complete problems can be reduces to all other NP-problems?
  • III/II: If we can reduce B in NP-complete problem to A in P, can we prove that all problem reduces to B is in P?
  • IV: If we prove that there is an NP-complete problem that is P, Can we consider that P=NP?

Why do we consider enumeration up to $w$ instead of leaving it to as many ordinal numbers?

A few minutes ago I asked a question about a "proof" that $ \mathbb{R}$ is enumerable that crossed my mind: What's wrong with this "proof" that $ \mathbb{R}$ is enumerable?

I was told to look into ordinal numbers, and that after crossing $ \omega$ we stop considering something to be an enumeration.

Why is this the case? Are there negative consequences if we don’t put this limitation?

Edit: I always thought of $ \mathbb{N}$ as the "counting numbers" – but… when we cross over to ordinals like $ \omega$ , $ \omega+1$ , etc, aren’t we still effectively counting?

Google search console consider 404 urls as crawl anomaly category and not 404 not found category

I’ve got a site which we have mention as 404 not found for a few particular pages so that google can consider and push it to Excluded Not found (404) category, but still, google is considering those pages as crawl anomaly category. Please find the screenshot below.

enter image description here

enter image description here

Consider the following ckt. given in figure

Con

The present state Q2,Q1,Q0 of the counter before applying the clock pulse was (101). If the input Clock frequency to the circuit is 100KHz, then the output frequency of the circuit will be ?

My Approach: I have build the table from 101 it goes to 010 and from 010 to 101 again so it acts like mod-2 counter But I don’t understand the part in which we’re applying frequency. Can someone help me to visualize it.

What is the time complexity of sorting n words length wise and then alphabetically? Should we consider the length of the strings in the complexity?

Let’s assume I have a list of some words found in the English dictionary: ["hat", "assume", "prepare", "cat", "ball", "brave", "help" …. ]

I want to sort these words (which are n in number) in a way, such that they are ordered based on their length, but if 2 words have the same length, they are ordered alphabetically.

What is the time complexity of this sorting operation?

Would it be fair to say that the complexity is just O(nlogn) and not take into consideration the length of the strings? If the largest length is S, can the complexity also involve a factor of S?

How to consider combinatorial optimization problem with multiple objectives?

I am considering a combinatorial optimization problem with two objectives. The two objectives have a trade-off between each other which means if I minimized the first objective alone it gives the worst solution to the other one and vise versa. How I should start tackling such problems and if anyone can recommend a famous combinatorial problem has the same nature I appreciate.

How can this Line-Breaking algorithm consider spaces as having width different than 1.0?

The Divide & Conquer Algorithm for Line-Breaking described here is given below, both in Python and in Dart (which is similar to Java/C#).

Line-breaking is also known as “line wrap”, “word wrap”, or “paragraph formation”, and this algorithm is used for achieving minimum raggedness.

This algorithm works, but it considers each space as having exactly width = 1.0 .

My Question:

How can I modify this algorithm so that it ignores spaces? In other words, make it consider spaces as having width 0.0? (or it would also work for me if I could define any width I wanted for the spaces, including 0.0).

Python Implementation:

def divide(text, width):     words = text.split()     count = len(words)     offsets = [0]     for w in words:         offsets.append(offsets[-1] + len(w))      minima = [0] + [10 ** 20] * count     breaks = [0] * (count + 1)      def cost(i, j):         w = offsets[j] - offsets[i] + j - i - 1         if w > width:             return 10 ** 10         return minima[i] + (width - w) ** 2      def search(i0, j0, i1, j1):         stack = [(i0, j0, i1, j1)]         while stack:             i0, j0, i1, j1 = stack.pop()             if j0 < j1:                 j = (j0 + j1) // 2                 for i in range(i0, i1):                     c = cost(i, j)                     if c <= minima[j]:                         minima[j] = c                         breaks[j] = i                 stack.append((breaks[j], j+1, i1, j1))                 stack.append((i0, j0, breaks[j]+1, j))      n = count + 1     i = 0     offset = 0     while True:         r = min(n, 2 ** (i + 1))         edge = 2 ** i + offset         search(0 + offset, edge, edge, r + offset)         x = minima[r - 1 + offset]         for j in range(2 ** i, r - 1):             y = cost(j + offset, r - 1 + offset)             if y <= x:                 n -= j                 i = 0                 offset += j                 break         else:             if r == n:                 break             i = i + 1      lines = []     j = count     while j > 0:         i = breaks[j]         lines.append(' '.join(words[i:j]))         j = i     lines.reverse()     return lines 

Dart implementation:

class MinimumRaggedness {    /// Given some [boxWidths], break it into the smallest possible number   /// of lines such as each line has width not larger than [maxWidth].   /// It also minimizes the difference between width of each line,   /// achieving a "balanced" result.   /// Spacing between boxes is 1.0.   static List<List<int>> divide(List<num> boxWidths, num maxWidth) {      int count = boxWidths.length;     List<num> offsets = [0];      for (num boxWidth in boxWidths) {       offsets.add(offsets.last + min(boxWidth, maxWidth));     }      List<num> minimum = [0]..addAll(List<num>.filled(count, 9223372036854775807));     List<int> breaks = List<int>.filled(count + 1, 0);      num cost(int i, int j) {       num width = offsets[j] - offsets[i] + j - i - 1;       if (width > maxWidth)         return 9223372036854775806;       else         return minimum[i] + pow(maxWidth - width, 2);     }      void search(int i0, int j0, int i1, int j1) {       Queue<List<int>> stack = Queue()..add([i0, j0, i1, j1]);        while (stack.isNotEmpty) {         List<int> info = stack.removeLast();         i0 = info[0];         j0 = info[1];         i1 = info[2];         j1 = info[3];          if (j0 < j1) {           int j = (j0 + j1) ~/ 2;            for (int i = i0; i < i1; i++) {             num c = cost(i, j);             if (c <= minimum[j]) {               minimum[j] = c;               breaks[j] = i;             }           }            stack.add([breaks[j], j + 1, i1, j1]);           stack.add([i0, j0, breaks[j] + 1, j]);         }       }     }      int n = count + 1;     int i = 0;     int offset = 0;      while (true) {       int r = min(n, pow(2, i + 1));       int edge = pow(2, i) + offset;       search(0 + offset, edge, edge, r + offset);       num x = minimum[r - 1 + offset];        bool flag = true;       for (int j = pow(2, i); j < r - 1; j++) {         num y = cost(j + offset, r - 1 + offset);         if (y <= x) {           n -= j;           i = 0;           offset += j;           flag = false;           break;         }       }        if (flag) {         if (r == n) break;         i = i + 1;       }     }      int j = count;      List<List<int>> indexes = [];      while (j > 0) {       int i = breaks[j];       indexes.add(List<int>.generate(j - i, (index) => index + i));       j = i;     }      return indexes.reversed.toList();   } } 

Prove that the language $\{a^ib^i | i\geq 0\}$ is not regular? (Do we just consider $a^nb^n$, where $n$ is the pumping length?

I think to prove that $ \{a^ib^i | i\geq 0\}$ is not regular, we just have to consider the string $ a^nb^n$ (which is in the language) and apply the pumping lemma. But I’m not sure how to proceed using the pumping lemma (even though I know it applies with our choice of string, since the string is at least $ n$ long).