instruction stringlengths 35 29.1k |
|---|
PROBLEM: Count the number of ways in which atomic operation(s) of n different processes can be interleaved. A process may crash mid way before completion.
Suppose there are a total of n different processes - P1, P2, P3 .... , Pn.
Each process can have a variable number of atomic operation(s) that constitutes that proce... |
I racked my brain,I saw other people's solutions and it don't make sense. I think my biggest problem is I don't know when one string ends,like for example w1 is >=3 and it can have how many ever b's or a's as long as it's 3 and above,so when do we get to have the First a that's after the W1?how do I make sure it's not ... |
I searched a lot on internet, including here, but I couldn't find an explanation that could convince me. The problem is the same of the title, if A is polynomial-time reducible to B and B is NP-complete, can I say that A is NP-complete too?
Actually, I would say yes, because if I can convert a problem that I don't know... |
After deleting a node in an AVL tree, self-balancing (zig-zag rotation or the left-right balancing) maintains O(logn) time that is not guaranteed in other unbalanced trees (like BST).
The Balancing operation is said to be O(logn).
What is the worst case for balancing? (I guess it will require balancing at every node al... |
I'm new to dynamic programming and find a problem about balancing parentheses and smileys ":)" and "(:" at HackerRank, which is impossible to do.
I've been trying to solve it by 3 days now. The main issue with this problem is that the input string size is in range of 10^9 (creating a dynamic programming 2d array of siz... |
An integral linear program is one that has a maximizer that is integral. Sometimes it's possible to prove that a particular LP has this property, for example by proving that it's constraint matrix is totally unimodular.
Suppose that we have an integral LP, how can we then efficiently find an integral maximizer? After a... |
Input: Recognized text from images of labels taken with a cell phone in varying conditions. One image may enclose the entire text, or just a part of it.
Expected output: The most likely version of the original text, ideally with an indication of the certainty. More images will of course provide better results.
Even tho... |
I am working on this problem in which I have a theory $T$ based on language $\mathcal{L}$ and the only information we have is that T is consistent and $\vdash \lnot(A \rightarrow A)$. Given this information, how can I know if this theory is sound, complete and/or decidable?
My only guess is that I can say that $T$ is s... |
Can there exist any integer sequence $A$ of length $N$ with all unique elements such that the length of its Longest Increasing Subsequence as well as that of its Longest Decreasing Subsequence is less than $ \displaystyle \lfloor \frac{N}{2} \rfloor $?
If yes, then give an example of such a sequence. Otherwise, can any... |
When I study Binary Search Tree, I try to use a pencil and paper to scratch the process of in-order traversal. However, I find that it is hard to maintain the call stack in my brain without paper and notes when the height BST is high.
Question: What should I? Is it normal and should I practice more?
|
I've been trying to piece together an implementation of the Commentz-Walter string search algorithm. The idea is to construct a state machine from a trie, working backwards from the earliest feasible position.
The paper is available here, though it is a scanned printout from 40 years ago. I have also found a better qua... |
I have a probabilistic greedy algorithm for Exact Three Cover. I doubt it'll work on all inputs in polytime. Because the algorithm does not run $2^n$ time. I will assume that it works for some but not all inputs.
Our inputs are $S$ and $B$
$S$ is just a set of integers
$B$ is a list of 3-element {}s
Algorithm
Input va... |
Hopefully this question isn't too general, but I was wondering what the relationship is between randomized algorithms that perform well with high-probability and those that perform well in expectation. My question is motivated by the definition of a randomized $\alpha$-approximation algorithm given here, namely that it... |
I am trying to solve a problem and I am really struggling, I would appreciate any help.
Given a graph $G$ and an integer $k$ , recognize whether $G$ contains dominating set $X$ with no more than $k$ vertices.
And that is by finding a propositional formula $\phi_{G,k}$ that is only satisfiable if and only if there exist... |
I am trying to solve the following problem:
Find languages S and T over the alphabet $\{a, b\}$ such that $ S \not\subset T $ and $ T \not\subset\ S $ ($S$ is not contained in $T$ and not equal to $T$, $T$ is not contained in $S$ and is not equal to $S$) but $S^* = T^*$.
It might be trivial, but I would appreciate some... |
L = {a^n b^2n c^3n | n∈N^+}
I'm trying to prove that L is a non regular language using Myhill-Nerode theorem.
|
Let $G$ be a graph and $X=x_1,x_2,...,x_n$ be an permutation/ordering of the vertex set of $G$. We then let $S_i = \{x_j:j\le i\}$, and $F_i$ be the number vertices $v\in S_i$ that are adjacent to some vertex $u \not\in S_i$. (where $u$ may depend on $v$ and $i$) We finally define $F$ to be a list of values $F_i$ sorte... |
As you see, the string production process never ends.
Can someone explain me if this language is regular or not ?
$ S \to Α Β S $
$ A \to S $
$ B \to a B b $
|
Each context-free language has an automatic stack received by a non-deterministic blank.
That is, it will not uphold the following determinism requirement:
|
Given a graph G, I need to find the number of ways to color it using two colors Black and White.
Constraints:
G will already have some nodes colored Black.
Every node of color White needs to have one or more Neighbors of color Black.
The nodes that are colored Black will always be leaf nodes.
Vertices<=32
Edges<=Ve... |
I want to write a function that takes N (maximum number of states) as a parameter, enumerates all possible finite state machines up to N states, and returns random FSM with a probability in proportion to the number of states (fewer states more probable). Alphabet = {0,1}
Can you please suggest how to implement this enu... |
Consider that there is sequence $a$ of length $n$ ,$a=[a_i,0\le i\le n]$. Now you are given with $\text{lcm}$ of some pairs of number from list that is, $\operatorname{lcm}(a_i,a_j)=k$ for $0\le i,j\le n$ and $i\neq j$ and $k$ is specific for given pair. Find number of sequences of $a$ that satisfy given $\text{lcm}$'s... |
I am working on an algorithm in graph theory which I wish to prove it's polynomiality/NP-hardness. I am investigating a binary variable (0, 1) integer program which has the coefficient matrix consisting of only -1, 0, 1 and it is ''almost total unimodular.'' There is no objective function and the existence of a feasibl... |
I have a slight technical struggle with this marvelous tutorial. On page 5 the tutorial talks about typing rules for Simply Typed Lambdas and presents following judgement as derivable via rules on figure 3.
I was unable to prove neither id nor const by the same reason. Take for instance the id example.
Say I am lookin... |
Currently studying for an algorithms exam and I came across this question and solution, but I can't understand the solution where it references nodes of depth less than $4\log n$ and not restructuring. I understand everything else except for the $4\log n$ part - thanks in advance.
The question:
Suppose that when we per... |
Question: Is a compiler a kind of Gödel numbering program?
Wikipedia tells us that a compiler is: "In computing, a compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language)". https://en.wikipedia.org/wiki/Compiler
A... |
Given arbitrary integers of $K$ and $M$, is $2^K$ + $M$ a prime?
K = int(input('enter exponent K: '))
M = int(input('enter integer for M: '))
if AKS.Primality(2**K + M) == True:
OUTPUT 'yes'
else:
OUTPUT 'no'
I am not knowledgeable enough in number theory or any other field of mathematics to know the answer t... |
I have course notes which claim the following two facts:
First, DFAs recognize exactly the regular languages.
Second, regular languages are closed under union, concatenation, and *.
Now I have as an exercise constructed a DFA which recognizes strings from {0,1} which have an odd number of 1s. So the language of string... |
Let $L_1$ be a regular language and $L_2$ any language. I want to prove that the language of $L_1$ truncated by $L_2$ is a regular language, i.e.
$$\{w| wx\in L_1 \text{ and } x\in L_2\}$$
is regular.
To prove that something is regular it is enough to prove that it is described by a regular expression. We know that ... |
does appending an element to a list through a for loop work in O(1) time or O(n) time? In addition, what is the time complexity does "".join that list into a string work in?
|
Is IP masquerade and Network Address Port Translation(NAPT) the same? I'm not sure whether it is the same thing or not but I realized the mechanism is almost the same where both IP masquerade and NAPT changes TCP/UDP port and many-to-one relation is allowed:multiple private addresses share one global IP address.
If it ... |
For language $L$ over an alphabet $\Sigma$ denote $\gamma_L(n)$ as the number of words of length $n$ in the language $L$. It is known that for regular languages this function represents a sequence with rational generating function (which is equivalent to that $\gamma_L(n)$ is linear-recurrent for sufficiently large coe... |
If there is a finite set of Instances of size n and the set of (reasonable) deterministic algorithms is finit.
Can any randomized Algorithm be seen as a probability distribution over the set of deterministic Algorithms? And if yes, why?
|
I am comparing two comparison and binary data structure based sorting algorithms, the Tree Sort, and the Heap Sort. I am measuring the time taken for both algorithms to sort an increasing size of an integer dataset. However, I am wondering if there are any other variables which I can modify, for example standard deviat... |
I read that the following language is r.e. but not not-Turing recognizable
$L$: On input $M$ (where $M$ is a Turing Machine), $M$ accepts at least 20 inputs
I am not sure why it is not not-Turing recognizable., since I could perhaps make the following reduction from $\overline{A_{TM}}$ to $L$ given this procedure $R$ n... |
The following is the definition for Proximate Sorting given in my paper:
An array of distinct integers is k-proximate if every integer of the array is at most k places away
from its place in the array after being sorted, i.e., if the $i$th integer of the unsorted input array is the
$j$th largest integer contained in th... |
I'm looking into implementing RLNC as a project, and while I understand the concept of encoding the original data with random linear coefficients, resulting in a number of packets, sending those packets, and thus the client will be able to reconstruct the original data from some of the received packets, even if a few o... |
It is simple to decide powers of 2 in $O(n)$ time because it's just "0-bit Unary" after bit-1. (eg. $1000$ is a power of 2 in binary).
I haven't found many other trivial powers of $K$ that can be decided in polynomial-time with the binary-length of the input.
Question
Can we decide if a number is a power of any given $... |
Please tell me why the expression i>0 && nums[i] == nums[i-1] && !used[i-1] works on getting unique permutations. And what is the math behind it?
The problem is as follows:
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
Example:
Input: [1,1,2]
Output:
[
[1,1,2],
... |
The problem is: count all increasing subsequence of s.
def main():
print(count([3,2,4,5,4]))
def count(s: list) -> int:
n = len(s)
counter = 0
result = {}
if n == 0:
return 0
for i in range(n):
counter += recurse(s[i+1:], s[i], result)
return counter
def recurse(s: list... |
Today I presented about IP address during my online class based on Computer Networks by Andrew S. Tanenbaum and during QnA session, I was asked about private IP Address range.
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
The questioner asked my why private IP address is determine... |
On page 235 of Turing's 1936 paper, in the figure marked (C), the illustration appears not to match the description. The description states that
space has been made on the left of the scanned symbol, and the m-configuration written in its place
but the illustration (repeated on p. 242 using SD encoding) shows no scan... |
I recently came across the question:
Show that there are at most $\lceil n / 2^{h + 1} \rceil$ nodes of height hh in any nn-element heap.
I looked for some solutions and found this one:
Binary heap: prove that number of nodes of height h is not bigger than $\lceil \frac{n}{2^{h+1}} \rceil$
But I got confused with the a... |
I've written an answer to this question, which asks about the following:
What is the time complexity for the given code that prints prime numbers from start to end? Is it $O(end*\sqrt{n})$?
/**
* Print prime numbers between start and end inputs
* Time-Complexity: O(end * sqrt(n))
* Space-Complexity: O(1) only one va... |
Consider a sorted list of numbers $C_{0}=\{0,1,2,3,...,n-1\}$ from where one element will be eliminated at each step. We are also given a value $L$ in $[0, 1)$ and let the indexing start from $0$.
Given a value $L_{0} = L$ in $[0, 1)$, we find $a_{0} = ⌊L_{0}⋅n⌋$ and remove the $a_{0}^{th}$ element $p_{0}$ from $C_{0}$... |
$L_1 ,L_2$ are regular language. We form a new language $L_{12}$ as follows:
$$L_{12}=\left \{ w_1\cdot w_2\mid w_1\in L_1\land w_2\in L_2\land |w_1|=|w_2| \right \}$$
In this exercise I am not given any alphabet and I'm required to build a PDA for $L_{12}$. But by definition $M=\left \{Q,\sum,\Gamma,\delta ,q_0,\dashv... |
Consider an undirected graph $G = [V,E]$. Let $V$ be the set of vertices: $V = \{v_1,..,v_n\}$ and $E$ be the set of edges. Let $C$ be the connected component that contains vertex $v_1$. I want to find the connected subgraph (not sure about this terminology) with maximum number of edges, among all the connected subgrap... |
The fake proof:
We know that $\mathbb{R}$ is uncountable, hence we cannot enumerate over it.
But what we do know is that $\mathbb{Q}$, the set of rationals, is countable, and even denumerable.
We also know that we can construct $\mathbb{R}$ through what are called Dedekind cuts.
We choose to let the partition itself d... |
I'd like to read up on non-recursively enumerable languages. Which textbooks should I look into to get a decent understanding about the subject?
Thank you.
|
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? A... |
Assume an undirected graph and a DFS traversal on it. I am interested in the DFS tree which encodes the discoverer/discovered (parent/child) relationships of the traversal. Just to make sure we are on the same page, define a discovered vertex x as one that has been visited but descendants of it are still being processe... |
global volatile RingBuffer queue;
global Lock queueLock;
global CV queueEmptyCV;
global CV queueFullCV;
public method producer() {
while (true) {
task myTask = ...; // Producer makes some new task to be added.
queueLock.acquire();
while (queue.isFull()) { //####
wai... |
I am given a Finite Automaton and the question is to design an Equivalent PDA for it. This is my FA:
Is this PDA correct or do I need to add a stack to it? If its right when is the stack needed?
|
In Computer Science μ-function is used to extend set of primitively recursive functions to generally recursive functions, and I can't understand what this function does.
There is a lot of formulae, but I can't understand what is is. Let's say I'm writing in Python (or any other general purpose language). What are examp... |
With my application, I have
Collection X: thousands of floating-point numbers with the value range [0, 1], not sorted.
Collection Y: 11 floats ranging from [0, 1], sorted.
The size of X is known. Let it be L.
The goal is to quantize X and map it onto Y, so that we get a hash array of indices of Y for X. Eventually Y ... |
Why do programmers write parallel programs instead of giving them the ability to automatically convert from serial to parallel?
|
I'm trying to analyze the following streaming algorithm for counting triangles (see below). It supposedly works also for dynamic graphs (i.e. "turnstile model", where edge deletions are allowed).
What am I missing? According to my (buggy) analysis of the reported estimator's variance, the variance equal to 0 (see belo... |
I need a data structure, which allows efficient queries for 'give me the group of x'.
Let me give you an example:
Group 1: [a, b, c]
Group 2: [d, e]
Group 3: [f]
getGroupOf(d) -> [d, e]
There are no significant constraints on storage or construction time. I only need getGroupOf to be O(logn) or faster.
I am thinking... |
Assume I have two Krom formulas $\psi_1, \psi_2$. Krom formulas are propositional formulas in CNF that have 2 literals in every clause. Each literal can be negated or unnegated. In other words, $\psi_1,\psi_2$ are 2-CNF formulas. For instance:
$(x_1 \vee \neg x_2) \land (\neg x_2 \vee x_3 ) \land (x_3 \vee x_4)$
I ... |
Suppose we have the following directed graph. When I click on - say - node $e$, it should make the in-pointing neighbors and out-pointing neighbors of node $e$ red, as shown in the below Expected Result. My purpose is that when I click on any node of a directed graph it should tell me what nodes it is influencing (out-... |
I'm working on an e-commerce application where users can add stand-alone products like speaker or they can add a bundle product like desktop that has options like mouse, keyboard etc. All the products and options are finally added as cart items to the cart.
For example
Desktop
- Mouse
- Keyboard
Speaker
After addi... |
In this paper (https://arxiv.org/pdf/1706.06708.pdf) the authors prove that optimally solving the $n\times n\times n$ Rubik's Cube is an NP-complete problem. In the process, they must show that the relevant decision problem belongs in NP (section 2.5 on page 6). To do this, they describe an algorithm that nondeterminis... |
Consider a bipartite Garph $G=(L \cup R, E)$. Naturally, a b-Matching problem is to find a set of edges $M \subset E$, such that each node in $L$ and $R$ are adjuscent to maximum $b$ neighbors, and a weight function $w(e), e \in E$ is maximized.
What if we have different $b$? e.g., $b(v)=5, \forall v \in R$ and $b(v)=2... |
Knowing that all Recursive languanges are Decidable and All Not R.E. Languages are Undecidable (correct me if I am wrong), Are all languages which are R.E. but not Recursive also Undecidable?
R.E. ==> Recursively Enumerable
|
Decision Problem: Is $2^k$ + $M$ a prime?
The inputs for both $K$ and $M$ are integers only. The solution is the sum of $2^k$+$M$. (Use AKS to decide prime)
The powers of 2 have approximately $2^n$ digits. Consider $2^k$ where $K$ = 100000. Compare the amount of digits in $K$ to the amount of digits in it's solution!
Q... |
Given a sequence $A$ of $N$ distinct integers, does there exist a strategy to get at least one subsequence with size $\geq \lfloor \frac{N}{2} \rfloor$ of the sequence in sorted order in $O(n)$ time?
For example, let's say that $A = [4, 11, 6, 2, 9, 7]$. Then, one of the required sequences can be $[2, 7, 11]$, which is... |
The following excerpts are from the section Fibonacci Heap from the text Introduction to Algorithms by Cormen et. al
The potential function for the Fibonacci Heaps $H$ is defined as follows:
$$\Phi(H)=t(H)+2m(H)$$
where $t(H)$ is the number of trees in the root list of the heap $H$ and $m(H)$ is the number of marked ... |
I have to count the number of one's in last $m$ bits in a stream of bits and $m \leq n,$ where $n$ is the window size and it should take polylogarithmic space in $n$. I could only store last $n$ bits and then count the number of one's in those $n$ bits but it takes $O(n)$ space. How to achieve it in $O(\log^k n)$, $k>0... |
Wikipedia claims that the Game of Life is P-complete (or the decision problem version of it is; the function version, I suppose, would then be FP-complete).
Colloquially, P-complete and FP-complete problems are difficult, if not impossible, to parallelize. However, most software for evaluating the Game of Life is para... |
I need to form PDA for this language: {$a^nb^m|n=m \vee n=2m$}
I know the idea of building each one separately but how do I combine them into 1 PDA?
LHS: for every 'a' I push 'A' inside stack and for every 'b' I eject 'A'.
RHS:for every 'a' I push 'A' inside stack and for every 'b' I eject 2 times 'A'.
How can I combin... |
Can we do multiprocessing on single core system ? I thought that single core means that ONLY one process/thread can execute at any time. For multiple processes , there can be concurrent execution to appear as they are executing Simultaneously.
|
Assume I have two Horn formulas $\phi_1, \phi_2$. Horn formulas are CNF formulas so that each clause has at most one unnegated literal. For example:
$x_1 \wedge (\neg x_1 \vee \neg x_2 \vee x_3 )\wedge (x_3 \vee \neg x_4)$
I want to decide whether $\phi_1,\phi_2$ are logically equivalent, i.e., $\phi_1 \leftrightarr... |
Given an array composed of pairs, like this:
[[3,5],[1,5],[3,2],[1,4]]
Each element in the array (call it pair) means that pair[0] and pair[1] are adjacent in the original array. Note, they can come in either order. For instance, for the sample array above, the original array would be:
4,1,5,3,2 (or the reversed versio... |
I want to determine the transitive reduction of this graph:
as of now, I only found the first step of doing this: represent the transitive closure of the graph as an adjacency relation, so this is what I did:
(a,b)
(a,c)
(a,d)
(a,e)
(b,d)
(c,d)
(c,e)
(d,e)
I'm not sure that this is the correct transitive clos... |
Knowing that O(n^2) > O(nlogn) > O(n) > O(sqrt(n)) > O(logn) > O(1) and having below python code:
import math
def f1(n=9):
return math.sqrt(n)
def f2(n=10):
return [math.sqrt(i) for i in range(n)]
Am I correct to infer that O(f1(n)) = O(1)
Am I correct to infer that O(f1(n)) = O(n)
|
This is from Kleinberg's Algorithm Design text (Theorem 6.14)
Let $M$ be an alignment of $X$ and $Y$. If $(m, n) \notin M$, then either the $m^{\text{th}}$ position of $X$ or the $n^{\text{th}}$ position of $Y$ is not matched in $Y$.
The theorem does not state that $m, n$ must be the last elements of $X$ and $Y$ respec... |
Decision Problem: Given integers as inputs for $K$ and $M$. Is the sum of $2^k$ + $M$ a $prime$?
Verifier
m = int(input('Enter integer for M: '))
sum_of_2**K+M=int(input('enter the sum of 2^k+m: '))
if AKS.sum_of_2**K+M == True:
# Powers of 2 can be verified in O(N) time
# make sure there is all 0-bits after the ... |
I am curently working on automatic label placement, so for evaluating a model, one metric is to calculate the Area A:
A is the sum of every part of a rectangle covered by another. So if two rectangle overlap, A = 2 * Arectangle, if three rectangle overlap A = 3 * Arectangle, ...
Because i am working in real time, i nee... |
Is $L=\{<M> | L(M) \ is \ finite\} $ decidable ? M is a TM.
I think its relative simple to proof with the theorem of rice. But I am interested in a solution which does not use the Rice theorem.
This my try :
Let f(<m,w>) be a function which works in the following way :
Run w on M
If M accepts Construct a TM Mwhich ac... |
I would like to write a grammar to convert EBNF description to a list of CFG production rules, instead of an algorithm.
Can CFG production rules is generated from an EBNF description by a rewrite system rewrite EBNF description to halt state that final string is composed by CFG production rules and separate character f... |
I'm working on a game-related application, and I'm trying to find the middle point of the most populated area in my map.
Example:
Positions (format [x, y]) :
[48, 49]
[51, 50]
[49, 50]
[51, 49]
[49, 48]
[130, 150]
[129, 148]
Excepted output : [50, 50] or something close enough like [49, 51], [51, 50]
To create this ... |
I encountered a problem which asks to give an example of an undecidable language $B$ such that $B \leq_m \overline{B}$...
However, I could find it hard to construct an example ... my difficulty is that given an undecidable but Turing recognizable language, say $A_{TM}$, its complement $\overline{A_{TM}}$ is not Turing ... |
Given a planar 1-in-3 sat formula, can someone reduce that formula into a graph that asks the question when ever there is an independent set for it, that's also planar?
|
I want to model the absorption of CO2 with multiple different materials such as cement, limestone, wood, etc? I know Matlab is capable of these types of physics simulation according to this research paper: Research Paper, however, I am not sure if Python or another programming language could complete this task easier.
|
I am pretty new in λ calculus. And I am now trying to understand Alpha equivalence. Basically can I think it in this way: as long as I make sure all the bound variables and their corresponding abstractions are noted as the same letter, the new expression is alpha equivalent to the old one? Here is one example:
(λx.(λx... |
I was wondering if it can be said that $\mbox{NL}^\mbox{NL}=\mbox{NL}$. That is, a decision problem $S$ can be decided using a nondeterministic TM using logarithmic space with oracle calls to $S'\in \mbox{NL}$ iff $S\in \mbox{NL}$.
My intuition is yes, because if $S'\in \mbox{NL}$ then there is a NDTM $M$ that decide... |
I have this doubt for long time. When i save a notepad file, it takes the memory for the information in the file. let's say, I type 'ABC' in notepad and saved the filename as stack, it shows that the memory consumed 3 bytes for the file but what about the file name " stack" ? Where does it store that particular informa... |
If $j \in Z^+$ and $k \in R^+$ and $j − 1 < \log k < j$. Why is $j = O(\log k)$? (All log's are in base 2)
I know I have to find constants where $j <= c \cdot \log k$ but I need some help with it.
|
I have this piece of code for counting sort and it is "counting" sort, because it actually counts occurrences. And it doesn't use cumulative sum. I want to ask why it is bad to not to use cumulative sum in counting sort algorithm? (BTW it has O(n) runtime complexity)
def my_counting_sort(lst):
counts = (max(lst)+1)... |
I am wondering if there are some particularly rich problems that have a large intersection with algorithms and data structures. An example could be the travelling salesman problem. Any other suggestions ?
|
I'm confused about the definition of prime implicates in Horn formulas.
For example in the paper of Kira 2012 on page 109 it is stated:
Now in the paper of Boros 2010 on page 82 the following definition is used:
My goal is to decide whether a Horn formula is prime or not in polynomial time. For that I want to assume ... |
Given an alphabet, say $\Sigma = \{0,1\}$, I can make a one-to-one mapping from all possible strings $x \in \Sigma^*$ to $\mathbb{N}$. This could be done by ordering $\Sigma^*$ lexicographically and assigning the $i$th string $x_i$ to number $i \in \mathbb{N}$.
But given strings $x_i,x_j \in \Sigma^*$, is there any spe... |
The following is an excerpt from a material on NP-Theory:
"Let G be an undirected graph and let s and t be vertices in G. A Hamiltonian path in G is a
path from s to t using edges of G, on which each vertex of G appears once and only once. By
HAM-PATH we denote the problem of determining, given G, s and t, whether G c... |
It seems that the General Number Field Sieve (GNFS) became number one and then RSA stopped its factoring challenges and there have been no advances in factoring algorithms besides quantum computers. So are there faster algorithms after GNFS for classical computers? Note that the 1980s and 1990s saw a series of new fact... |
This is taken from an old exam of my university that I am using to prepare myself for the coming exam:
Given is a language $\text{Goto}_{17} \subseteq \text{Goto}$. This language includes exactly those $\text{Goto}$ programs in which no constant is ever greater than $17$. Show that every $\text{Goto}$ program can be si... |
I need to implement piecewise linear functions (this is not homework, it is for my own personal project). However, I have been having difficulties to get it right. Below, I describe the characteristics of the function, operations, and what I have tried so far.
Function: It is defined by linear segments. It may be disco... |
I have shared the question above. My current algorithm does the calculation in O((n^4)*(2^n)).
Can someone please help me out to solve this faster?
|
$$L=\left \{ a^nb^m|n\leq m\leq 2n \right \}$$
Is this even context free?
I am asking because by looking at the condition, for an expression that holds:$n< m<2n$ can be written as : $a^nb^nb^c (c<n)$.
Following this term(taken from geeks for geeks https://www.geeksforgeeks.org/check-if-the-language-is-context-free-or-n... |
This question has two facets that are related.
Is the general problem of protein folding really NP-hard?
The hydrophobic-polar protein folding model (Ken Dill et al., 1985) stated the problem on a lattice (similar to self-avoiding walk):
Simplification significantly reduces the computational effort in handling the mod... |
Intuitively I think the answer is no since I don't think every certificate can be checked in polynomial time but I don't know how to give a formal proof. Is the statement true? Why or why not?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.