instruction
stringlengths
35
29.1k
Covering an orthogonal polygon with rectangles is according to Culberson and Reckhow NP-complete, even for the case without holes. Franzblau shows an 2-approximation algorithm for simple polygons for this NP-complete problem that was later also shown to be an 8/3-approximation algorithm for the general case. I am curre...
Is it true, that the number of edges in residual network is always less than twise the number of edges in the original flow network? My thoughts, that it's false, because in residual network quantity of edges is always $2 * E_{G_{f}}$, even some of them are zero edges. Am I right?
Let f be a Boolean function on n variables. Let $DC(g)$ and $D(g)$ denote the deterministic communication complexity and the decision tree complexity of $g$. Why is the following inequality true: $$DC(f(x \land y)) \leq 2 D(f)$$
This is my first post on CS Stack Exchange. For some time, I have been studying basic graph algorithms, mainly BFS, DFS, minimum spanning trees and their basic algorithms (Kruskal and Prim). One thing I have noticed, as I have used both Skiena's Algorithm Design Manual and CLRS is that, at least in the pseuducode in CL...
I want to show that there is no TM $f$ such that whenever $W_x$ is nonempty then $f(x)$ is defined and is the least member of $W_x$, Where $W_x=\{w:w \in \Sigma^{*}\text{ and } M_x \text{ on }w \text{ Halts}\}$ Usually when I want to show that such a problem is not member of RE, I use Rice's theorem, diagonalization, t...
Can someone explain me how the code is working and what is the time complexity ? def foo(n): r = 0 for i in range(1, n): for j in range(i, n): for k in range(1, j): r += 2 print(r) x = int(input("Enter a number : ")) foo(x)
I have solved a problem that required me to find if the given directed graph had a cycle or not. The deal is, I used a recursive approach to solve it in the depth-first-search method. I was just wondering how the code would look in an Iterative approach of the same depth-first-search method. Here is my C++ code... clas...
How do you identify the answer sets for II if you know what the answer set program II looks like? Here is the problem: The answer is suppose to be 1 and 3. Here is what I am thinking, starting with looking at number 1: Okay so we got loc(1,ted, house1), loc(1, jane, house2), move(1,ted, house1, house2) all in II, so f...
Let $G=(V,E)$ be an undirected graph and $A,B,C\subset V$ disjoint subsets of $V$. I want to check whether or not $A$ and $B$ are separated by $C$ (i.e. every path from $A$ to $B$ passes through $C$). There are several ways to check this (via graph connectivity, DFS, brute force search over all paths, etc.). My questio...
Here is the problem: Let's say we have a random binary sequence, just an arbitrary sequence of zeroes and ones (of some arbitrary length of digits). Can we find an algorithm that would decode/decompress this sequence into a meaningful statement (say, in some natural human language)? I don't want to condition or bias on...
Let $\mathbb{H}$ be the set of all Turing machines that halt on all inputs. Consider the following Turing machine $T$. On input $\langle S \rangle$ where $S \in \mathbb{H}$ (note that the angle brackets indicate a string encoding of $S$), $T$ does the following: Simulate $S$ on $\langle S \rangle$. If $S$ accepts, rej...
Suppose I have the following MIPS code on a CPU with forwarding enabled: L1: LW R2 0(R1) ADDI R2 R2 2 SW R2 0(R1) ADDI R1 R1 8 SUB R4 R1 R3 BNEZ R4 L1 The last two lines are of importance for me. My intuition is that the output to R4 is calculated during the EX stag...
There are a number of rules (an order of 10K, may be 100K-ish) that looks like a tuple: (x1,x2,x3,x4), where xn may be a number (32 bit if it's matter) or a wildcard '*' (any). What approach may be taken for compact representation for this rules and fast lookups in runtime? It's looks like FSM, but are there any effici...
I was asked to give an example of a graph that has edges with negative weight, but Dijkstra's algorithm will still give us the correct output. It was part of a prove/disprove question. The claim was.. "If a graph has negative edges, Dijkstra's algorithm will return the wrong output".
I was reviewing All NP problems reduce to NP-complete problems: so how can NP problems not be NP-complete? I understand that the general way we show a problem A is in NP is to show there exists a poly-time certifier for A. However, I am confused if say, we know nothing about A, and it reduces to an NP-Complete problem ...
Let $S$ denote a deterministic process which generates a certain string, described through a Hidden Markov Model. More specifically, for a process with alphabet $\mathcal{A}$ and $n$ hidden states, the description is given through the $n\times n$ transition matrices $T^{(a)}$ with elements $T^{(a)}_{ij}=Pr(s_{t+1}=j,A_...
Let $G=(V,E)$ be an undirected graph with $|E|=m$ edges. Given that any clique of size $\ge 2$ can be identified with its corresponding edges, and at most every subset $S\subseteq E$ creates a clique, $G$ can have at most $|P(E)|= 2^m$ cliques of size $\ge 2$. However, based on the intuition that it's better to arrange...
What's the space-complexity of Newton-Raphson? I think it reduces to the space-complexity of storing the inverse hessian matrix.
I'm looking to formally define a tree and then extract the leaves from it in a concise way. Does this look ok? What is the best way of doing this? $ Y = \{a,b,c,d,e,f,g\} \\ R = \{a \mapsto b, a \mapsto d, d \mapsto e, d \mapsto f, f \mapsto g\} \ \text{, where R is a relation on Y.} \\ R^+ = \{a \mapsto b, a \mapsto ...
I'm prototyping a deterministic Risk like game. A player can move units from one node to a connected node if he has more than 1 unit the in origin node (must leave 1 unit behind). The player wins if he conquers the enemy's home node. Battles are settled by multiplying the node's defensive units by the defensive rate an...
I'm probably missing a lot of terminology here, so I'll try to rather be too clear than too vague. I have a Context-Free grammar as an input, that might contain direct or indirect left-recursion between some of the rules. Identifying the recursion is not too hard, can be done with a graph traversal algorithm. We simply...
I don't know much about memory. Here are some lines from CLRS: The words in a computer memory are typically addressed by integers from 0 to $M - 1$, where $M$ is a suitably large integer. In many programming languages, an object occupies a contiguous set of locations in the computer memory. A pointer is simply the addr...
Given an array $A$ of unsigned integers, a subarray is a contiguous interval $A[\ell],\ldots,A[r]$. The bitwise AND of the subarray is just the bitwise AND of $A[\ell],\ldots,A[r]$ (what is denoted by A[l] & ... & A[r] in C). I am faced with the following task: Given an array and an integer $k$, find the maximum lengt...
Take this example mentioned here: NP-hard problems with very fast exponential-time algorithms We can create such problem by padding assuming ETH‌. Take an NP-complete problem $L$ such that $L$ is decidable in time $O(2^n)$, by padding $L$ with some dummy 1's, create $L'=\{1^{n−(\log_21.01)n}x:|x|=(\log_21.01)n∧x∈L\}$....
Background information that I know(But not understand with examples, I will be glad if you could explain it to me with examples) A replicated service is said to be linearizable if for any executin there is some interleaving of operations that Meets the specifications of a non replicated service Matches the real time...
Let's say we have two sets $X = \{x_1, \ldots, x_n\} \subset \mathbb R^d$, $Y =\{y_1,\ldots, y_n\} \subset \mathbb R^d$, how can we find a permutation $\pi$ such that $$D = \sum_{i=1}^n d(x_i, y_{\pi(i)})$$ is minimal? (Here $d$ is some distance function, for simplicity we can assume it is the Euclidean distance, or ma...
Will the IBM PC ever move towards 128 bit architecture? Is that even possible or is the 64 bit architecture we have now the ceiling?
Is there a specific name when we refer to just the scheme and host of URL, for example http://localhost of the URL http://localhost:8080/help ?
I am looking for a discussion state that, why study of mathematics in designing algorithms, and find out efficient solution for algorithmic problems is so important?
I am looking to create a neural network architecture that takes two kinds of inputs: image and text, and outputs a predicted continuous variable. More specifically, I will have multiple images of a house as an input alongside numerical/text data like square meters, number of beds, baths, carspaces, latitude, longitude,...
I am trying to solve below problem Given a set of integers A, and target integer, find all subsets of size k such that sum of elements of subset equals target. One approach could be enumerating all subsets of size k and checking whether sum equals to target. However this takes O(n!) time. I am trying to find an algorit...
Desc' I was reading CLRS Book's chapter 11 Hash Tables, and encountering some problems. There is an corollary in CLRS book, in Page 275 (quoted on the bottom of post), which discussed the expected number of probes on a unsuccessful search, given open-address hash table. I think the proof is strongly convincing, and I h...
I am trying to have a deeper understanding of the following implementation of the Goemans-Williamson algorithm for solving the maxcut problem. def goemans_williamson(graph: nx.Graph) -> Tuple[np.ndarray, float, float]: """ The Goemans-Williamson algorithm for solving the maxcut problem. Ref: Goemans...
I encountered the following problem: Given a string which was produced by mixing up a string of digits (0-9), for example: "otetwonhree" was produced by "onetwothree"~123, find the original digits (without importance of order). in our example we would return "123". Another example: "oneoneeon", we return "111". My qu...
Original question: Given a symmetric matrix with matches count between different transcriptions, the objective is to maximize the batches total matches count while minimize the standard deviation between the batch match counts where each batch allows a fixed number S of unique transcriptions and the number of batches i...
I tried to find strict definition in Google and books, but didn't succeed. How it connected with max flow and residual network?
Suppose $A$ is an array of distinct natural numbers. We call an element $A[i]$ minimal if it's less than both the element before and after it (if any). Present a worst-case $O(\log n)$ algorithm for finding a minimal element. I wanted to find the minimum (since it's less than all the elements) and then use binary searc...
My algorithm $n$ times checking that $n$ clauses with $2$ variable, are satisfiable or not? (i.e. $n$ times my algorithm check $2-SAT$ Problem with different variable) that each time $2-SAT$ need's $O(n)$, so the running time will be $O(n^2)$. Are there a hint or idea such that prohibit my algorithm from doing repeat...
In Haskell, I made a class of admissible (that is, second-countable and $T_0$) spaces: {-# LANGUAGE TypeFamilies #-} class Admissible a where type BasisElem a -- Type of a basis element semidecide :: a -> BasisElem a -> [Bool] -- Semidecides whether an element is in a basis element countFirst :: a -> [Basi...
I'm working on reverse engineering the bit stream format of an FPGA, in particular regarding the address translation of the BRAM (block RAM), but the algorithm could in general be used for any permutation of an address space. The algorithm is as follows: Assign an index to each bit in the input space. For every bit in ...
In their book Fundamentals of Parameterized Complexity, Downey and Fellows claim (in chapter 27.1) that $\mathrm{FPT}\subsetneq \mathrm{XP}$, and that this is a "basic result" that follows by "standard diagonalization", without any further reference. I have neither been able to find a proof of this "basic result" in th...
I have a graph $G$ (NOT directed). $SP$ is one of the shortest paths between $a$ and $b$ ($a$ and $b$ are nodes of $G$). $e$ is the edge of $SP$ between the nodes $j$ and $k$ ($j$ is before $k$ if we go from $a$ to $b$). If I remove $e$ from $G$, in the new graph there is a path between $a$ and $b$. Can I say that, in ...
What do FPT and XP stand for in this question? Proving FPT is strictly contained in XP I don't have enough reputation to comment on that post and ask and I couldn't find the meanings of these acryonyms through Google
Consider the following model of computation (from here). Although Fractran is Turing-complete, it assumes that the "user" is able to perform the steps of encoding the input ($2^{n + 1}$) and decoding the output ($\log_3(x) - 1$). That is, as mentioned by the second bullet, there are computable functions that cannot be...
I have found two interesting questions regarding the quotient of languages, described as: $A/B=\{w \mid \exists z\in B\land wz\in A\}$ The first one is: Let $A$ and $B$ be regular languages, prove that $A/B$ is decidable By using the proof from this other question, it can be proved that $A/B$ is regular if $A$ is regul...
All O(N^2) solutions that I have seen for the longest increasing subsequence problem, as their first step, state something like this "Let L[i] be the length of the LIS ending at index i...": GeeksForGeeks HiredInTech AfterAcademy And, while this is a working assumption (the one that helps us solve the problem), I'm m...
I want to find an arrangement to evenly place 12 items ($a_1, a_2, ..., a_{12}$) into 4 boxes ($b_1, b_2, b_3, b_4$) such that the cost is minimal. Let $b(x)$ be the index of the box that contains item $x$. The cost of an arrangement is $$\sum_{i=1}^{12} \sum_{j=1}^{12} |b(a_i) - b(a_j)| M_{i,j}$$ where $M$ is a $12\ti...
I'd like to know if ${\Sigma_2^\textsf{P}}^\textsf{coNP}\subseteq\textsf{PH}$ or not. I know ${\Sigma_2^\textsf{P}}^\textsf{NP}=\Sigma_3^\textsf{P}\subseteq\textsf{PH}$, and I wish to know if this holds for ${\Sigma_2^\textsf{P}}^\textsf{coNP}={\textsf{NP}^\textsf{NP}}^\textsf{coNP}$. In other words, can we switch $\te...
I'm currently preparing for an exam and I'm having trouble to solve the following Questions. Let $w \in \{0,1\}^*$ and let $L$ be a language defined as follows $$L = \{w \mid \mathsf{time}_{M_w}(x) \leq |x| +1 \text{ for all words } x\}$$ Is $L$ co-semi-decidable? Is $L$ semi-decidable? For the first question, I th...
In Sipser's Theory of Comp in 2.2 the following PDA is provided for ${\{0^n1^n|n\ge0}\}$. I follow how to process "", "01", "0011". I want to reject "0101", however it seems one of the nondeterministic paths makes it to accept. I'm probably misunderstanding a detail of PDA -- my logic is as follows: Start in q1 Take ...
Inside the interval $[0,1]$, there are $n^2$ intervals of $n$ different colors: $n$ intervals of each color. The intervals of each color are pairwise-disjoint. A rainbow independent set is a set of $n$ pairwise-disjoint intervals, one of each color. A rainbow independent set always exists and can be found easily: take ...
For example, if we have a true algorithm that could generate any NFA of at most 42 states from any binary string of 2^32 length. So, this algorithm can not just recognize the string but just recreate it from a NFA of 42 states. The DFA taken from the NFA could be at most 42^2=1764 states. So, even the DFA could generat...
When a user writes a SQL query it needs to be scanned, parsed and validated. The question is in which order these three operations occurs in the process? Scanning, Parsing, Validation or any other order to execute the query Scanning refers to identifying the keywords, token, attribute names and relation names Parsing r...
Grady Booch in Object-Oriented Analysis and Design with Applications says: The state of an object encompasses all of the (usually static) properties of the object plus the current (usually dynamic) values of each of these properties ... Then: Another property of a vending machine is that it can accept money. This is...
Currently I want to come up with a program able to solve a specific type of board game, where we have a car moving across a randomly generated board, can't move backwards, a gas gauge and a food gauge. The goal of this game is being able to survive a certain number of turns (25) without running out of gas or food (star...
Given a graph G and an important (X,Y)-separator S, why is it true that for every edge e in S the set of S\e is an important (X,Y)-separator in G\e Important (X,Y) cut is defined as follows: S is an important (X,Y)-cut if it is inclusion-wise minimal and there is no (X,Y)-cut S' with $|S'|<=|S|$ such that R' dominates ...
When studying Chomsky's hierarchy of languages (starting from type 3), I find enlightening to encounter some language that can't belong to the current type but which very obviously belong to the next level (because some very easy grammar can be described). For instance, after having studying for a while type-3 (regular...
Every formal language is a subset of E*. Let's say this formal language is python. If a program is syntactically correct, then the Python Automata accepts the "word", which is the program. If that is true, what are the atomic elements like "print" called? Is this correct? Please correct my thought on this.
I am reading Distributed Algorithms by Nancy Lynch. I have come across lemmas, assertions and invariants, but I do not understand the difference between them. I think lemma means an intermediate result. Can someone please dexplain the definitions for each?
the size of one char in C is 4 bytes, however to define an 'A' character we use the sum of two values like this expression here: or in other way i want to say that the char is 4 bytes size, but in the example it shows that the size is 8 bytes. how it happens, what is wrong here ?
I am currently brand new to the correctness proof method, and have stumbled upon this algorithm which I find very tricky. Prove that the following algorithm for division and remainders of natural numbers is correct. function divide(y,z)  comment Return $q,r \in \mathbb{N}$ such that $y=qz+r$ and $r<z$, where $y,z \i...
Is there is a faster way to calculate the number of passes (not the number of swaps) needed to complete the bubble sort than actually doing the sort (as demonstrated in the code)? E.g. 1, 2, 3 -> 1 pass 1, 3, 2 -> 2 passes 3, 2, 1 -> 2 passes 3, 1, 2, 4 -> 2 passes 0, 4, 2, 6, 1, 5, 3, 7 -> 4 passes Code in Python: def...
When I open up a file two different editors, vscode and sublime, changes saved in vscode are visible directly in sublime text. Same doesn't work with nano text editor. Any help?
I haven't been able to find a good explanation of how these are different and relate to each other. I know that $\to$ is part of HOL and $\Rightarrow$ and $\Longrightarrow$ part of Isabelle, but it seems that they are basically doing the same thing and we could just have one object $\to$? (Taking into account the CH c...
Given a directed graph which may contain cycles, how can I find the maximum number of distinct nodes that can be visited on a single walk? I have done some research and the most similar-sounding problem I have found is the longest path problem, which is in fact rather different as far as I understand it: it is not conc...
Is there one (or a few) canonical/ specific use cases for "functions returning functions" (beyond "decorators")? What can you do with "functions returning functions" that you cannot (easily or elegantly or expressively) do with functions as variables ("functions taking functions as their arguments") and/or composing ...
I found this symbol in a book I'm reading. Does anyone know what this symbol means? Does it mean for all js?
What is actually meant when we say 'size/length of an input'? As far as I have interpreted it in different books,it means the values of the parameters to be inputted in an algorithm. But I am actually confused of what it really is. And further they state that time complexity of algorithms is usually a function of the s...
Consider this Problem $P$ as follows: $~$ Given a set $S$ and a constant $K$.. $~$Is there a subset $M$ of $S$, such that $|M| \ge K$? Of course, $P$ can be easily solved in time polynomial in $|S|$.. $~$We can design a Turing machine $T$ which decides YES or NO in polynomial time... Of course, $M$ is not given -- it i...
Suppose you have a DAG and the edges are positively weighted, and you want to find the maximum cost path from any node with no in degree to any node with no out degree. Is it possible to negate all the weights and then apply Dijkstra's algorithm on the negative weights? All the paths here will have a negative weight, b...
I'm trying to understand the Halting Problem. All the explanations I've seen state that the problem arises when passing a program to a halting check function along with itself as input. For example if halts(program, program) in the code below (please let me know if my code does not accurately represent the halting prob...
Is there somewhere a website/application/software/something where you can submit a list of string/image/audio/content/whatever and the appliance make a tournament sort by asking you question like "Do you prefer [Element K] or [Element J] or you don't know?". And depending on the replies he ask smartly for the other ele...
I was wondering what the complexity of factorization (on quantum computers or classical computers) is if we know that there must be exactly two prime numbers and we know the two prime numbers. For instance, if we know that our two prime numbers are $2$ and $3$ we want to know what $a$ and $b$ are because our number $N=...
Polynomial for producing hash values: $p(z)=a_0+a_1z+\cdots, a_{n-1}z^{n-1}$ Honor's method for that polynomial: $$ p_0(z)=a_{n-1} \\ p_i(z)=a_{n-i-1}+zp_{i-1}(z), (i=1, \cdots, n-1)\\ $$ Problem: For 50,000 English words and for $z=33$, we would get at most 6 collisions. So, how we can prove that please? Also, to calc...
When no path to the goalnode exists, does the A*-Algorithm a) visit and b) expand every node in an undirected graph? I have a monotone heuristic. Thanks
Let us consider a system having cache and main memory. Now suppose we are asked to find the average memory access time. Let $h$ be the hit ratio for the cache, $t_c$ be the cache access time, $t_m$ be the time to access a word of data from the main memory and cache block size be $b$ words. The picture below is from Wil...
What is the simplest way to transfrom $a\newcommand*\xor{\oplus}b=c$ to a CNF SAT expression with minimum number of clauses. The default transformation requires upto 9 clauses. I think we can do much better.
I am refering to MIPS (32 bits). Is there any particular reason that when loading or storing a word, we address memory in bytes, but when we jump or branch using beq we address memory in words? Thanks!
[CLOSED] Thanks! I am studying Linear Programming in college but I am facing some difficulties to assimilate some concepts. So do you have any recommendations of materials to learn or practice Linear Programming? Thanks
if there was an algorithm that runs in polynomial time, but its size requires $O(2^n)$ bits, would that still prove $P=NP$?
I am doing a prediction assignment as part of a machine learning course using loans data. I have just done some exploratory data analysis on my dataset of just over 9000 rows. There are 11 variables which I need to use to predict the output. Whilst exploring my correlation matrix, I have discovered that 5 pairs are st...
The problem: Suppose there are $n$ points in plane, and we want to partition points into two clusters such that sum of diameter of clusters is minimized. The diameter of cluster is maximum distance between each pair of points. My question is, how we can formulate above problem in LP manner? My attempt: I think so much ...
If $P=NP$ was proven with an algorithm, would that have to mean that there is one algorithm that has to work for all inputs of length $n$? More specifically, what if there were infinitely many polynomial time algorithms for $n=1,2,3,...$, but no algorithm would work for more than one value $k=n$. I don't mean that $n$ ...
S → aSa | aa generates all even-length strings of a’s We can devise a recursive descent parser with [backtrack] for this grammar. If we choose to expand by production S → aa first, then we shall only recognize the string aa. Thus, try S → aSa first. a) Show that this recursive descent parser recognizes inputs aa, aa...
The decision version of the Independent Set and Vertex Cover problems are phrased as: Given a graph G and a number k, does G contain an independent set of size at least k? Given a graph G and a number k, does G contain a vertex cover of size at most k? My question is, what is the reasoning behind using "at least" f...
I am having trouble understanding how to conclude if the statements are true or false, I would really appreciate your help. We know about three languages, A, B and C. There exists a mapping reduction from A ≤m B, and A ≤m C. What can be concluded about: A ≤m B union C ? What can be concluded about: A ≤m B intersection ...
The task was to give a type 1 grammar(can't be of type 2) which accepts the following words: baaaab, abb, abba(ab)^i for all i ∈ ℕ and doesn't accept these words: aabb, bba, bbabb(baaa)^i for all i ∈ ℕ My solution: S -> V | W V -> a B B W -> W W | A B | B A A B -> A A B B A -> B A A A -> a B -> b Example for baaaab: S ...
According to this post Given $n$ points $P=\{p_1,p_2,\dots,p_n\}$ in 2D space, and a matrix $D^{n\times n}$ with the distances between each pair of points, we want to partition the points into two clusters so as to minimize the clusters' diameters. This can be formulated as an integer programming problem as follows: ...
Suppose I have two tables of 2d intervals (axis-aligned rectangles) with values attributed to each interval. [d1_start, d1_end), [d2_start, d2_end), value 1, 3, 2, 5, 0.4 3, 9, 2, 5, 0.3 .... It is guaranteed that within a table no two rectangles (2d intervals) intersect. Is there any efficient way to merge t...
I cant proof that if f is the heaviest edge in weight from all the other edges in the circle which it is a part of, then f will not participate in any Minimum Spanning Tree. please help.
I never recall any problem making FOR loops in BASIC to 10000 on old IBM PC computers, but how does it work at the machine level when the number in the data register is (presumably) limited to a number from 0-255? [Edit: I can speculate that the processors had special instructions to use more than one word, but I neve...
It is well known that DFS can be implemented either with recursion or a stack, and that both approaches are equivalent, but how far can we take that statement? Consider the following LeetCode problem: Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n...
Reading wikipedia I found that they give this example Consider the problem of testing whether a number n is prime, by naively checking whether no number in $\{2,3,\dotsc ,\sqrt {n}\}$ divides $n$ evenly. This approach can take up to $\sqrt {n}-1$ divisions, which is sub-linear in the value of $n$ but exponential in t...
I'm reading Hopcroft and Ullman's '79 edition of "Introduction to Automata theory, Languages, and Computation". In chapter 3, the authors say "The lemma[sic] does not state that every sufficiently long string in a regular set is of the form $uv^iw$ for some large $i$". I can't see how this is true. If I'm not wrong, th...
Question:Given the following double hash function: $$h(k,i) = (h_1(k) + i\times h_2(k)) \bmod{N}$$, where $h_1(k): key \to \mathbb{Z}$. $h(k,i)$ can generate $N^2$ probe sequences at most and $h_2(k)$ can determine the increment for the probe sequence. Also, $N$ is the number of slots. Problem:Each sequence generated f...
It is a popular open question if there is a problem unsolvable in $2^{o(n)}$ on inputs with $n$ bits, assuming ETH. I recommend reading that question first. That question states that, assuming the ETH (Exponential Time Hypothesis), we know problems that cannot be solved in time something like $2^{o(n/\log n)}$ (namely,...
Given the following language: $$L=\left \{ <M> | \exists L \in R \quad s.t \quad L(M)\subseteq L \right \}$$ I need to determine it's compuation class(R or RE). I used Rice Theorem as follows to say it's not in R: The prperty is non trivial: $L(M_{1}) \subseteq L \subseteq L(M_{2})$ from this property I can infer that ...
Let $C_n$ denote the cycle graph over $n$ vertices. Let $C_n^k$ denote the $k$-th power of the cycle graph, or namely that for two vertices $i,j$, $(i,j)\in Edges(C_n^k) \iff |i-j|\leq k$ for a constant $k$. Now given a subgraph $G$ of $C_n^k$, how can we find a hamiltonian cycle (if it exists) in $G$ in polynomial tim...
I hope someone can take some time to consider the following problem and welcome to discuss together. Number partition problem is one of well-known NP-hard problems. Now I am considering the hardness of constrained partition problem. In particular, the cardinality of multiset $S$ is n, denoted by $|S|=n$. Now is it NP-c...
How does $Θ(\log(n!))=Θ(\log(n^n)$? I understand why $Θ(\log(n!))=Θ(n\log(n))$ and $Θ(\log(n^n))=Θ(n\log(n))$, therefore $Θ(\log(n!))=Θ(\log(n^n)$. But I am having trouble reconciling this with the following: $$\lim_{x\to \infty}\left(\frac{\log_2(x^x)}{\log_2(x!)}\right)=\infty. $$ So how could there be constants such...