instruction stringlengths 35 11.4k |
|---|
I'm writing a program where I have a bounded semilattice (it has a root element at the top, all edges point downwards, and a node may have multiple parents). I need to precompute each node's depth (the max number of edges from the root node) and height (the max number of edges to any leaf). I have a naive implementatio... |
Suppose I have 2 intervals C1 = [x1, x2] and C2 = [y1, y2], where x1,x2,y1,y2 are variables in an Integer program, I want to compute the overlap of C1 and C2. I am interested in a tight formulation for computing the overlap as an another variable with as few big M constraints as possible. Any references or formulations... |
Is the question above still NP? I've been stuck on this question for couple of days now... I know k-Clique problem is NP-complete generally, but the problem is k = |V|-d where d is some integer constant...My current guess is that for large |V|,
d << |V| => Finding all subsets of size k = (V choose V-d) so this questio... |
Suppose $A$ depends on $B$ or $C$, but not necessarily exclusively. Is it possible to model this in a dependency graph?
Can we just link $A$ to $B$ and $C$ via a diamond (like in UML) (though I don't see how this can be represented mathematically)? Or do we have to condense $B$ and $C$ to a single node $D$?
|
Considering $n$ number of pieces of data, what would Dijkstra's shortest path algorithm time complexity be if it was stored using a data structure with following properties?
• delete the record with the minimum value of the key (complexity $O(log n)$);
• decrease the key of some record (complexity $O(1)$);
• find the... |
Okay can't figure this out. I want to make sure I understand it.
There are n random keys each being float numbers with p decimal places.
So, for example,
123.456,
343.645,
234.543,
863.238,
956.043,
etc.
For which values of p should you use counting sort, radix sort, and merge sort to make it the fastest.
I know cou... |
I am building genetic algorithm for feature selection. But there are vague things to me.
For example, there are 100 individuals with crossover probability 0.8. Does it mean I take 80 parents (40 couples), or 80 offsprings?
I'm using linear ranking as the parent selection because of the fitness values are close to each... |
I have noticed that I find it far easier to write down mathematical proofs without making any mistakes, than to write down a computer program without bugs.
It seems that this is something more widespread than just my experience. Most people make software bugs all the time in their programming, and they have the compile... |
This question is already asked:
To find a subsequence having largest sum among n positive integers by not choosing 3 consecutive elements
https://stackoverflow.com/questions/29249104/maximum-sum-in-ipl-matches
Problem Statement: https://www.codechef.com/ZCOPRAC/problems/ZCO14004/
Bonus/Similar link: https://discuss.cod... |
To describe the implementation of a dynamic programming language, I have seen the terms "Runtime" (e.g. Security transparency in the Python runtime), "Virtual Machine" (Python Virtual Machine (PVM), YARV (Yet another Ruby VM)) and "Interpreter" (Matz's Ruby Interpreter) used. JavaScript also uses the word "Engine".
IMO... |
Having trouble figuring this out.
If I have 2 sets of integers how would I use a hash table to test if set A is a subset of set B (in pseudocode).
I think I understand that basically I would need to create a hash table for all the elements of B. Then, the traverse A and search for each element in the hash table. If th... |
I'm interested to read about type theory, but I'm quite a beginner. I know what sets are and how to work with them, but I don't have a deep understanding of set theory. I don't really understand the motivation behind type theory, other than that it was first developed to solve the problems with naive set theory.
I'm ma... |
I've encountered this problem in a program analysis project I'm working on, where I've got a bunch of functions defined in terms of each other, and because I'm using SMT which doesn't support recursion, I'd like to define as many functions outright as possible, so that fewer are left to be solved by the SMT solver.
In... |
Given a set of $n$ items, each represented by $t_i=(w_i,v_i)$ for $1 \le i \le n$, the weighted average value of those items is defined as:
$$
\frac{\sum_{i=1}^{n}v_iw_i}{\sum_{i=1}^nw_i}
$$
The goal is to find a subset of items to double their weight, such that the weighted average value is maximized.
For example, s... |
I'm wondering if if is possible to have a function $f$ such that there exists $x,y$ such that we have $f_t(x) > f_t(y)$ where $f_t$ denotes the true value of $f$ and $f_a(x)<f_a(y)$ where $f_a$ denotes the value of f as stored in a computer? (I am referring to floating point numbers and numerical analysis)
I am looking... |
How to Think About Algorithms - Jeff Edmonds
Exercise 2.2.2
The problem asks to find $\sum$, Q, δ, s, and F of this program if we see it as an automaton. Edmonds characterized this as deterministic non-finite automaton since 'n' is not bounded.
$\sum$ is {0,1} but I'm not sure how to model Q and the transition functi... |
Recently I was reading again this propositions as types paper by Philip Wadler:
http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-types/propositions-as-types.pdf
It gives an impression, that programs are proofs. So my first question was that why they are not enough for mathematical proofs then, for example in... |
I've been trying to find the most efficient unification algorithm by following reference chains on the Wikipedia article on unification. As far as I can tell, the fastest one is the one presented in "A Practical Unification Algorithm", but is there a faster one?
|
On wikipedia page of register machines it says that all register machines defined appropriately are equivalent to Turing machines but that
Computational speed is very dependent on the model specifics.
Does this mean that when we say a problem has complexity $O(n^2)$ or is a polynomial time problem, or something like... |
I'm reading Wattenhofer's The Science of the Blockchain. On page 87, he states the following thoerem:
Theorem 7.22. Forks are eventually resolved and all nodes eventually agree on which is the longest blockchain. The system therefore guarantees eventual consistency.
Proof. In order for the fork to continue to exist, p... |
I have a query regarding the below information in http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map/
"In 64-bit mode it is possible to use physical addresses above the total RAM in the system to access the RAM regions that correspond to physical addresses stolen by motherboard devices. This is called... |
The Church-Turing thesis states that everything that can physically be computed, can be computed on a Turing Machine.
The paper
"Analog computation via neural networks" (Siegelmannn and Sontag, Theoretical Computer Science, 131:331–360, 1994; PDF) claims that a neural net of a certain form (the settings are presented i... |
Let N be any positive integer, then is following language regular for every $N$?
$L$ = { $B_n : B_n(modN) == 0$ } where $B_n$ is binary representation of a number.
E.g, $L=\lbrace B_n : B_nmod31 == 0,B_n \ is \ a \ binary \ number \rbrace$ is regular? Will the language be regular for any positive number in place of $... |
I'm struggling to understand this question using pumping lemma to prove a language is not regular. Any help would be appreciated.
Prove using the Pumping Lemma that the following language is not regular.
{0^n^3 |n ≥ 0 is an integer}
From my understanding a language isn't regular if the power is linear. But I just can... |
Let's say I have a 3D space containing spheres (for simplicity, all with the same radius). All spheres are in two disjoint sets, $A$ and $B$. It is guaranteed that spheres from $A$ do not intersect with spheres from $B$.
How can I find the smallest possible set $C$ of spheres (of any radius) that covers all spheres fro... |
I think I have a hard time understanding the definition for NP. It says: "All decision problem where every yes-instance can be verified in polynomial time". But doesn't this just mean that every possible solution can be verified to be yes or no in polynomial time? If co-NP then is verifying no-instances isn't NP alread... |
Define $Tape_M(t, i)$ as the symbol in the $i$-th cell of the tape of Turing machine $M$ with empty input at step $t$.
Does there exist a Turing machine $M$ such that no algorithm can compute $Tape_M(t, i)$ within $o(t)$ (or $o(t/\log(t))$ ) time?
Actually, it is inspired by the celebrated time hierarchy theorem. I b... |
It is an interview question:
Given a binary tree print the path of the tree which has
the highest number of bends.
I could come up with a solution which will keep track the left or right child being called but interviewer was not satisfied with that solution. Has anyone better solution for this problem?
|
Suppose algorithm $A$ on a digital computer takes as input integers $x$ and $y$ in binary. The algorithm outputs one if $x=y$, and zero if $x \neq y$. Is there a proof that for any input $x$ and $y$ in which $x=y$, there exists a one-to-one function $f: \mathbb Z \rightarrow \mathbb Z$ such that $A$ compares all of the... |
I have been thinking on this problem but couldn't come up with a good reduction yet. First part of the proof, i.e L is being in NP, is okay. However, I cannot find a proper reduction from 3-CNF-SAT to MAXIMUM-DISJOINT-SET problem.
Edit 1: MDS definition
MAXIMUM-DISJOINT-SET problem: We are given a collection S of
sets.... |
There was a question connected with one of the video lecture lessons that I'm currently watching.
Let two trees be given - the original and the tree after the zig-zig step:
Calculate the cost of this operation.
Where it is: the sum of the ranks of the new tree (after the zig-zig step) minus the sum of the ranks of ... |
Given a matrix $A \in \mathbb{R}^{n \times n}$ with no zero rows, what is the complexity of deterministically finding a vector $x \in \mathbb{R}^n$ such that every entry of $Ax$ is nonzero?
It is easy to see that a vector whose entries are realizations of Gaussian random variables works. Indeed, in this case every e... |
In Splay trees, by definition - the required element x - rises to the root of the tree, using the operations: zig, zig-zig, zig-zag. And the formula zig of the step is this: 1 + 3 (r '(v) -r (v)), where - r' (v) -r (v) is the length of the path before the path x is raised to the vertex, and the coefficient 1 is " actua... |
If $\mathcal C=\mathcal D$ then does $\mathcal A^\mathcal C=\mathcal A^\mathcal D$ hold ($\mathcal C^A=\mathcal D^A$ need not hold)? The class $\mathcal A$ could query same for $\mathcal C$ and $\mathcal D$ since $\mathcal C=\mathcal D$ as languages. Correct? Is there a counterexample?
If $\mathcal C\subseteq\mathcal ... |
We know $NP=\bigcup_{k\in\Bbb N}NTIME(n^k)$ and $\Sigma_2^P=NP^{NP}$.
Does $\Sigma_2^P\subseteq\bigcup_{k\in\Bbb N}NTIME(n^k)$ also hold (we can do $O(n^k)$ queries to $NP$ oracle which runs in non-deterministic $O((n^k)^c)$ time which is non-deterministic $O(poly(n))$ time)?
Is there a reason we cannot conclude $NP=... |
I'm looking for a hint to help me think through/solve the problem of finding the median of two sorted lists/arrays in O(log(m+n)) time, where m,n are the sizes/lengths of each list, respectively.
I can immediately think of an obvious O(m+n) time algorithm using big-theta of m+n space, as follows: Merge the two lists in... |
I have been taught that the A* algorithm visits every node on the graph, like Dijkstra's does, prioritising nodes with the smallest cost. However, visualisations of the algorithm, such as this one, appear to show the algorithm stopping after finding the first path as the white blocks spreading out on the linked video d... |
I recently came across a handwritten note with directions to push a string of text into a database. There was a strange character in the string I've never seen before, a lower case 'b' with a forward slash through it:
I asked the author about it and he said it was an old-school way of representing a space.
My question... |
I'm formalizing some properties of lambda calculus in Coq and I have some problems proving termination of substitution. My terms are defined as:
Inductive Term :=
TVar: nat -> Term
| TAbs: nat -> Term -> Term
| TApp: Term -> Term -> Term.
and I have a way of generating fresh variables using a function
fresh: Term ->... |
Does recursive enumeration implies countability?
Does countability implies recursive enumeration?
I believe the first implication holds but not sure about the second. A good example would suffice.
|
What is the difference between absurd reasoning and contraposal reasoning?
To show that a language is not regular
|
I would like to seek help on the complexity of the following problem. Given positive integers $m$, $n$ and $D$, find all sequences $0 \lt a_1 \lt a_2 \lt \dots \lt a_n$ are there such that:
each $a_i\in\{1, \dots, m\}$
$\sum_{i=1}^n a_i = D$
I want to know the complexity with respect to $m$, $n$, $D$. To what exten... |
I'm trying to prove $L = \{ w : w \neq w^R \}$ over $\Sigma = \{0,1\}$ is CFL.
Define $G = ({S,T}, \Sigma, R, S)$ where $R = S \to 0S0|1S1|0T1|1T0, \; T \to 0T|1T|\varepsilon$.
Now I want to show that $\mathcal{L}(G) = L$.
One direction is fine, where given $w\in \mathcal{L}(G)$, it must've deduced using $S \to 1T0|0T1... |
I've read many literature papers, but I still cannot understand their exact formalization definitions. Is their any difference among them or is there any relationship among them?
|
I’m asking this because, I’m thinking that it is possible to make a CD or ps vita cd to have an infinite space storage so that new updates will come.
And, it is possible for the company Sony to make the new memory of ps vita to be infinite space storage?
Can anyone tell me if it is possible for a company to do that?
O... |
When I went to London, I wondered how to visit all the London Underground stations as fast as possible.
Given
a randomly-chosen start station,
timetable of train arriving & departing of every station,
the time it takes to change from one to another line.
Assuming that there is no Tube strike on that day, and train... |
I've been having some fun with prime numbers. A few months ago I sat down to see if I could write something that could compete with Atkin Sieve and ended up with an algorithm that, on my local tests on my RAM-restricted computer provide results where my algorithm is either close to Atkin or it can be way faster (depend... |
I'm looking at the Multiplicative Binary Search and come across this.
It's the preparation you need to do for you to use the Multiplicative binary search procedure.
I somehow do not know how to do number 1. Can you explain how?
I thought it was getting like the formula for the binary search wherein
the index = floor ... |
Admittedly, homework.
For the purpose of this question: $\phi$ is a DNF formula similar to this one: $(x_1 \wedge \neg x_3 \wedge x_4) \vee (\neg x_1 \wedge x_2)$ Also $C_i$ is a clause in this formula, for example $C_1=x_1\wedge \neg x_3\wedge x_4$
The tasks is to do this in a little bit more sophisticated way than to... |
I'm reading Sedgewick & Wayne's Algorithms book, and one of the questions in one of the chapters is the following:
Develop an implementation of Boruvka's algorithm that uses doubly-linked circular lists to represent MST subtrees so that subtrees can be merged and renamed in time bounded by E during each stage (and the... |
I have an algorithm that:
1. takes in a book's text as a string.
2. splits that string into words and stores it in a list.
3. creates a hash table from this list by iterating over the elements of the list
4. It then iterates over a separate list of words to see if each of these words (in this separate list) is contain... |
We know $P\subseteq PH\subseteq PSPACE\subseteq EXP\subseteq NEXP$.
Is it known or believed that $\Delta_2^{exp}=EXP^{NP}\subseteq NEXP=\Sigma_1^{exp}$ and/or $EXP^{PH}\subseteq NEXP$?
Does $NP=coNP\iff NEXP=coNEXP$ hold?
Note $NEXP=coNEXP\implies \Delta_2^{exp}=\Sigma_1^{exp}$?
|
How would I start the recursive definition of the following language:
L over {a, b} such that L consists of strings in which each
occurrence of b is immediately preceded and followed by an a
The 'and' part is causing me problems with this problem and I don't see a clean way to gurantee the occurence being preceeded a... |
Let S be the set of total functions from $N \rightarrow M$, such that for each $f \in S$, there is $i > 1$ such that for
all $j < i$, $f(i)$ and $f(j)$ are not equivalent Turing machines. Prove or disprove that S is countable
I don't think this is actually countable, but I'm having a hard tie proving this using dia... |
I am given a set $U = \{1, \cdots, n\}$ and a set of subsets $C_1, \cdots, C_k$ of $U$; here the sets are all the same size.
The minimum set-cover problem of course is to find the minimum number of the $C_i$ such that their union is $U$.
I'm looking at the "opposite" problem: I want to find the minimum-size subset $K$... |
I can use the pumping lemma to prove simpler examples, but i'm finding this problem rather complex partly due to the notation.
Can anyone explain how I would do this problem:
For any string $s$ in $\{a, b\}^*$, let $n_a(s)$ be the number of a’s in s, and let $n_b(s)$ be the number of b’s in s. Let L over {a, b} be giv... |
I am sorta confused and also could not find a answer online, but in terms of expressive power, .
Non-deterministic FA, PDA, TM
NFA < NPDA < NTM
Deterministic FA,PDA,TM: This is where i am confused
DFA < PDA < TM?
In a whole: ?
DFA = NFA = e-NFA = RE < DPDA < NPDA = NCFL = DCFL < NTM = DTM?
Please correct me or am i... |
In any dynamic programming problem can there exist more than one optimal state ?
If so how would I enumerate all of them ?
For example: in the subset sum problem for the given set $\{-3, -2, 7, 5\}$ and target sum $0$.
There exists two ways of reaching $0$. ie. $\{\}$ = empty set as a sum of zero, or $\{-3, -2, 5\}$ = ... |
In the polynomial hierarchy we have $\Sigma_2=NP^{NP}$ and $\Pi_2=co\Sigma_2$.
So we have $\Pi_2=co(NP^{NP})$.
Is it same as $(coNP)^{NP}$?
I just wonder why not a hierarchy with $coNP$.
|
Title of the question pretty much summarises the question. Here is a concrete example of what I'm trying to achieve with no success.
Let's say we have a sorted list (but sorted is not a requirement) L = [1,3,20,100,150,200,260] and K = 260. I need a function f(L,K) which given this list and K will return a list B = [[1... |
Let $M$ be a Turing machine with oracle to $B$ that can decide $B$ in polynomial time. In the general case it means nothing, since we can just pass the input as a query to the oracle of $B$ and accept/reject according to its answer.
Now, we add the next limitation: given an input of length $n$, the queries' length can ... |
Let $f(n) = O(g(n))$. Then we know that $\log(f(n)=O(\log(g(n)))$.
Is the converse of this statement also true?
Does $\log(f(n))=O(\log(g(n)))$ imply $f(n)=O(g(n))$?
Let's say $f(n)=n!\ g(n)=n^n$.
Since $n!=O(n^n)\rightarrow \log n!=O(log n^n)$. This is true.
Now suppose I don't know that $n!=O(n^n)$. But I know t... |
I'm looking for best algorithms to compare two Circular Linked List?
For example :
List 1 = 1-3-5
List 2 = 3-5-1
I want to compare "same" or "not same" but need fast algorithm.
|
For decidable languages (or a particular subset of decidable languages, e.g., regular, context free) does closure under Kleene star follow from the proof of closure under union and concatenation? The only thing that the latter seems not able to produce is an empty string.
|
I have a large (~1k) number of boolean formulas like:
f1(x) = p1 AND p2
f2(x) = (p1 AND p2) OR p3
f3(x) = p4 OR !p5
The argument x is a set, and the predicates (the p's) assert that a certain condition is met on the set (typically, that x contains a certain value).
For every input, I have to evaluate all the formulas.... |
I've been trying for hours. I'm teaching myself automata theory right now and I have this DFA:
And I'm trying to create a regex from it by removing q1 first and then q2. I already managed to remove q1 by doing it like this:
But now I'm not sure how to continue. The next step I'm trying to do is remove q2 and then rea... |
We know that the INDEPENDENT-SET problem is NP Complete i.e $\langle G',k'\rangle$ means graph $G'$ has an Independent set of size $k'$. I am preparing for the finals an a sample question is to prove TRIANGLE-FREE-SET to be NP Complete.
$$TRIANGLE-FREE-SET:=\{\langle G,k\rangle| \text{$G$ has a subset of vertices of s... |
This is similar to Is there such a thing as an "or" case in a dependency graph?
I am trying to represent a dependency graph where the dependencies for an individual node may be a general boolean function of other nodes.
For example, node A may be reachable from node B or node C.
I can't see how to represent this with a... |
Can we assume that each clause in 3SAT contains at least one positive literal? That is, there is no clause with all negative literals (but it is fine that there is a clause with all positive literals).
|
I wondered if there was a generalized name for typing a variable by assigning a specific value to it. For instance
a = 4
This would make the variable a an integer, since 4 is an integer. Likewise
b = 0.8
is b a float in this instance.
Technically this is not dynamic typing (since there is only one defined type, i... |
Let us consider a plain search algorithm (Dijkstra being one example) which will calculate the shortest path from A to B.
Now introduce the additional constraint that the path must be as close as possible to a third point, C, without necessarily going through it (thus breaking down the route into an A–C and a C–B porti... |
Lets assume a hashing algorithm that runs in polynomial time and produces a hash that is mathematically impossible to reverse. As far as I know, the $P=NP$ problem states that if they are indeed equal, then if an algorithm exists to verify a solution in polynomial time, then an algorithm exists to find a solution in po... |
I need help with creating Deterministic pushdown automaton for language:
L = {v1w | v, w ∈ {a, b, c}*, #a(v) = #c(w)} where the number "a" in the string v is the same as "c" in the w string.
In the first state, I try to load the first string v. But I do not know how to control the same number of "a" and "c" characters... |
Regarding Lamport's mutual exclusion... Where messages are exchanged in the following sequence between nodes S, G1, and G2. G1 and G2 are the members of the group.
(for this, lets just assume that a1 is an acknowledgment of m1; a2 is an acknowledgment of m2)
S sends m1 to G1
S sends m1 to G2
G2 sends a1 to S
S sends m... |
The set of lambda calculus expressions $Expr$ is generated by the grammar
$$
Expr \ni e ::= x \mid \lambda x\ldotp e \mid e_1 e_2
$$
We can define an interpreter without explicit substitution by using environments and closures:
$$
\begin{align*}
Env &= Var \rightharpoonup Cl &\text{($\rightharpoonup$ is partial fu... |
If k is the height of an AVL Tree, the minimal number of inner nodes is:
N(k) = N(k-1) + N(k-2) +1.
Why is this formula true?
|
T(n) = 2T(√n) + n.
I tried putting n=2^m
T(2^m) = 2T(2^(m/2)) + 2^m.
If I subsitute T(2^m) = S(m) then,
S(m) = 2S(m/2) + 2^m.
This is same as (1*2^m) + (2*2^(m/2)) + (4*2^(m/4)) + ...
Now I am stuck in this summation as it's not a GP.
Can someone please help?
|
There is a preprint on arXiv that states (in my own words).
If there are three numbers (digits) and task is to add all three numbers. First we well take two number to add, set aside third number. Then we will add third number in previous sum of two numbers. So, addition of three number requires two steps, because we ... |
I am given a Turing machine M as input and i have to find out if this language below decidable and if not is it then in this case recursively enumerable .
$$L=\\\{<M> \mid \text{ is there $w_1,w_2$ for M so that M for both halts but with different results }\}$$
Somehow i ended up finding that the language i... |
Ideally, such an algorithm would not be a brute force one. Is there a clever way to do this?
|
I am given a task to prove using 3COLOR that Quadratic Programming is NP-hard. Does anyone have a clue on how this is meant to be done?
|
When I was reading Agda tutorial, I noticed resemblance between dependent type declarations and class definitions which I've been primarily used to work with. I'm not totally sure how much sense this questions makes, but what is the real practical difference between types and classes? Could we very well use object orie... |
I've seen often stated that Lambda Calculus can be used for mathematical proofing but I haven't yet seen any example how it is actually used for the task.
Is there a simple example, lambda abstraction or application that can be shown to be a valid mathematical proof? For example what does it take to make a Church numer... |
Please excuse the soft question and please dont close it prematurely as too broad.
When working on assignments that includes a wide range of topics from theoretical computer science (see tags), I often hit a wall that I cant seem to get over.
When I see the solution it often involved some kind of 'trick' that you had ... |
N.Wirth's book on compiler introduces the concept of symbol table and states that
every declaration statement results in a new entry in symbol table.
Then after showing how an entry in symbol table looks like he talks about types which can be specified anonymously like the following :
$\ VAR a: ARRAY 10 OF INTEGER $... |
I have been given an array of integers of size n and q queries which can be of 2 types:
1.Decrement all elements in the given range by some value
2.Find sum of all elements in the given range
1<=n,q<=10^5
I have tried brute force but it gives TLE
Same goes for prefix sum and even segment trees which improve sum query b... |
We define the following language:
$$L = \{M \mid \text{$M$ is a TM and there exists an input $x$ on which $M$ halts in at most $|x|$ steps}\}.$$
Following this question I understand that $L$ is not decidable, but I know that it is recognizable, and therefore I'm looking for a reduction from the HALTING problem to $L$.
... |
I have a problem in which I was given $n$ points and an integer $k$, and I need to find the $k$ points that are the closest to origin. My approach is to find the distances from origin of all points and sort them. Instead of using distances $\sqrt{x^2+y^2}$, can I use $|x|+|y|$ as my key? Also, I would like to find out ... |
long story short: I want to list all possible combinations of n tiles on a 3x3 board with the restriction that at least 6 tiles are part of a connected chain. Tiles are connected if the pattern continues from one to the other and a tile can be repeated any number of times (see image below for clarification, I would lik... |
Let us consider a product $P$ (whose factors we do not know). Given a base $b$, such that all the Modulus Residues are calculated using powers of $b$ w.r.t. $P$.
For some (unknown) power $x$ we know the corresponding residue ($R_x$), i.e.:
$b^x\bmod P = R_x$.
Query 1: Without knowing (or calculating) the factorizatio... |
If I have a statement int a=5, in which phase will symbol table be updated with value of a (which is 5) ?
Different websites have different answers to it. In some of the websites it is written that assignment happens in syntax analysis phase and in others it is written that assignment happens in semantic analysis phase... |
i just signed up here because im struggling very hard with a problem i gotta solve. What I wanna do is reducing an Instance of 3color to an instance of Quadprog to prove that quadprog is np-hard, and i have no idea how to do that. My first idea was to match every node to a varaible of quadprog, but i have no clue how t... |
According to the selected answer on this question NP-hard problems do NOT have to be decision problem. But by definition all NP-hard problems can be karp-reduced from any NP-problem in polynomial time; thus, implying that the answer from the reduction must be the same as the NP-problem which is yes/no => decision probl... |
I was reading this answer on how error-correction works on magnetic tape recorders for the Voyager space probes.
After watching one or two youtube videos I understand the principle of Hamming-coding and that some sort of this is probably used in encoding the Voyager data.
Also it is known that simple Hamming-encoding c... |
I am writing a function that can be split into cases
(1)$f(x) \leq f(y)$ and $f(x) \geq f(y)$
or into cases
(2)$f(x) < f(y), f(x) = f(y), f(x) > f(y)$
If I have f(x) = f(y), it is theoretically more efficient to use the cases outlined in (2), but is it actually more efficient in practice?
My concerns are that if $f(x)... |
Every red-black tree implementation I've come across use a strategy that considers re-balancing the tree after each mutation (e.g. insert, delete, ...).
I have a situation where I graft several sub-trees from one red-black tree onto another. After these grafts I would like to consider re-balancing the resulting tree.
A... |
From $P\subseteq \oplus P \subseteq PSPACE$ and $P\subseteq PP \subseteq PSPACE$ we infer $\oplus P\neq PP$ gives that
$$P\neq PSPACE.$$
Are there any other consequences?
|
https://www.iarcs.org.in/inoi/online-study-material/topics/dp-tiling.php
The second question in the above link requires us to fill an 2xN grid with tiles of dimension 2x1 and an L shaped tile.
Question 1) In the recursive formula for g(n):
g(n) = f(n-1) + h(n-1)
Why didn't we include the case that we can also put a 2x1... |
In describing the tokens of a programming language using regular expressions, it is not necessary to have the $\epsilon$, (for the empty set) or t (for the empty string). Why is this?
Please tell me why is it not necessary thanks
|
The question:
I want to buy $n$ books. In the book store there's a big sale according to which, if you buy three books, then the cheapest book in any triplet costs only 20% of its full price. Let $c_1, c_2, …, c_n$ be the full price of the books you want to buy.
Suggest an algorithm for minimizing your total payment.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.