简体   繁体   English

NP中两种语言的串联

[英]Concatenation of two languages in NP

I have a hard time to understand why the concatenation of two languages over an alphabet, which is in NP, doesn't imply that each of the languages for themselves are in NP. 我很难理解为什么在NP中用字母组合两种语言并不意味着每种语言本身都在NP中。 I talked with my Prof about the problem today, but I can't wrap my head around it. 我今天和我的教授讨论了这个问题,但是我无法解决这个问题。 Can you help me out? 你能帮我吗?

Here's a counterexample to the claim that if A and B are languages and AB ∈ NP , then A ∈ NP and B ∈ NP . 这里有一个反索赔,如果A和B是语言和AB∈NP,那么A∈NPB∈NP。 First, consider all subsets of the set 1*. 首先,考虑集合1 *的所有子集。 There are countably infinitely many strings in 1*, so there are uncountably many subsets of 1*. 1 *中存在无限多的字符串,因此1 *中存在无数子集。 Since there are only countably many decidable languages, at least one of these languages is undecidable; 由于仅有许多可确定的语言,因此这些语言中至少有一种是不可确定的。 let's have that language be A. For B, choose 1*. 让我们将语言设为A。对于B,选择1 *。

My claim is that AB is some language of the form { 1 n | 我的主张是AB是{1 n | n ≥ k } for some natural number k. 对于某些自然数k,n≥k}。 To see this, let k be the length of the shortest string in A. Then any string in AB has the form 1 k+m 1 r , where 1 k+m ∈ A and 1 r ∈ B. Such a string necessarily belongs to { 1 n | 看到这一点,令k是最短串的A.长度如果是AB任何字符串的格式为1 K + M 1 r,其中,1个K + M∈A和1个R∈B.这样的字符串必定属于{1 n | n ≥ k }. n≥k}。 Similarly, if we take any string from { 1 n | 同样,如果我们从{1 n | n ≥ k }, we can see that it has the form 1 k+m = 1 k 1 m , where 1 k ∈ A and 1 m ∈ B. Therefore, AB = { 1 n | Ñ≥ķ},我们可以看到,它具有如下形式:1 K + M = 1 K 1 m,其中的1K∈A1m∈B.因此,AB = {1 N | n ≥ k }. n≥k}。

The language AB is regular because it's given by the regular expression 1 k 1*, but A is not in NP because it's undecidable and all languages in NP are decidable. 语言AB是正规的,因为它由正则表达式1 k 1 *给出,但是A在NP中不是,因为它是不可确定的,并且NP中的所有语言都是可确定的。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM