instruction stringlengths 35 29.1k |
|---|
The teacher gave us this code that inserts a node in a binary search tree, but I am not sure what the $z.p = y$ instruction does. wouldn't the algorithm work without it?
abr_insert(T, z) //z is the node that must be inserted
{
y = NULL;
x = T.root;
while(x != NULL)
{
... |
I’m kind of a newbie to neural networks (and CS in general) but I was wondering if there are any methods to apply them in such a way with the aim of producing algorithms that solve difficult math problems.
A few CS/math friends were teaching me about P=NP and I was wondering whether a potential way to identify an algor... |
Is there a name for the problem:
Suppose you have a connected, undirected graph; find a path that touches every node exactly once.
This is basically the complement of the Hamiltonian Path problem, and the Traveling Salesman Problem without the minimum distance constraint.
I've googled and StackExchange'd and come up ... |
A decision problem is in NP if a candidate "yes" can be verified in polynomial time.
Are there decision problems whose "yes" is verified with an algorithm that is P-complete (reducible in logspace)? Are those problems in NP?
If so, can the "yes" be verified in logspace?
I'm told "for every NP language we can find a ver... |
For a graph G and a legal vertex-colouring ψ : V(G)→N of G,
let σψ(G) be the sum of ψ(v),
and set σ(G):=min σψ(G),
where the minimum ranges over all valid vertex colourings of G.
Prove that {(G,k): σ(G)≤ k}∈ NPC.
I thought of reduction from subset-sum but my problem is with the min and not with the sum, I don't und... |
I have to write an algorithm that checks if a tree is full binary tree (each node, except the leaves, must have 2 children), but I don't know if this version is correct.
isComplete(u)
{
if(u == NULL)
return false
else
{
left = isComplete(u.left);
... |
Suppose I have a CNF formula with clauses of size 2 and 3. It has a unique satisfying assignment.
I know the value of each bit of the unique assignment because it was made from a binary multiplication circuit where I multiplied two primes numbers A and B such that A*B=S where S is a semiprime number. I added the condi... |
I was going through the classic text "Introduction to Automata Theory, Languages, and Computation" by Hofcroft, Ullman and Motwani where I came across the proof the Rice theorem as shown.
$L_u$ => Language accepted by universal turing machine
$P$ => property of a regular language
$L_P$ => set containing the codes of th... |
I came across the below statement in the classic text "Introduction to Automata Theory, Languages, and Computation" by Hopcroft, Ullman, Motwani.
All problems about Turing machines that involve only the language that the TM accepts are undecidable
They say that the above theorem is per Rice theorem which states that:
"... |
Is it possible to compute time complexity of Depth First Search (recursive version) which is O(E+V) using a recurrence relation?
|
I was solving the following problem, just for reference (441 - Lotto). It basically requires the generation all $k$-combinations of $n$ items
void backtrack(std::vector<int>& a,
int index,
std::vector<bool>& sel,
int selections) {
if (selections == 6) { // k is always 6... |
Overview
The process manufacturing is (in contrast to discrete manufacturing) focused on the production of continuous goods such as oil. The planning is typically solvable by means of Linear Programming, come constraints can be introduced for MILP.
Problem Formulation
The problem consists of
Sequence of consecutive t... |
I'm trying to devise an algorithm to solve the bin packing problem with conflicts (sometimes referred to as BPPC, or BPC).
The problem is defined as follows: consider a set $V$ of $n$ items, where each item $i$ has an associated positive weight $w_i$, and $n$ identical bins of capacity $C$. In addition, there is an und... |
given a 3d cube with a size of m x m x m, is there an efficient algorithm to find N integer points with the average Euclidean distance between each pair maximized? If not, is there any evolutionary approach I can take to this, so in each step the solution will be improved?
Thanks!
|
I have a calibrated camera whose intrinsics were calculated prior.
Suppose I have multi images with the same camera. Using the first two views.I have the
1) initial reconstruction using 8 point algorithm to find the fundamental matrix and then I computed the essential matrix as E = transpose(K)FK
2) camera matrices P1 ... |
“Computer programs usually operate on tables of information. In most cases these tables are not simply amorphous masses of numerical values, they involve important structural relationship between the data elements.”
Knuth, Art of Computer Programming, vol. 1 (Fundamental algorithms), 3rd edition, p. 252.
My question... |
I was submitted an interesting problem, but I wasn't able to find a solution.
Define a function p(x, y) that takes int x and y, with y > x and returns an int.
p(x, y) = x & (x+1) & (x+2) & ... & (y-1) & y
There are then two arrays X of length N and Y of length M representing x and y, in binary with M >= N > 0. X and Y... |
Suppose I have a CNF formula with clauses of size 2 and 3. It has a unique satisfying assignment.
It was made from a binary multiplication circuit where I multiplied two primes numbers A and B such that A*B=S where S is a semiprime number. I added the conditions that A != 1, B != 1 and A <= B, then added the value of S... |
I was reading universal Hashing from Introduction to Algorithms by Cormen et al., and came across the following corollary regarding search, insert and delete functions on Universally Hashed tables:
Corollary 11.4
Using universal hashing and collision resolution by chaining in an initially empty table with $m$ slots, i... |
Can anyone explain to me how to demonstrate that,
$$T (n, d) ≤ T (n − 1, d) + O(d) + d/n (O(dn) + T (n − 1, d − 1))$$
is solved by
$$T (n, d) ≤ bnd!$$
for some constant $b$ using the substitution method?
I have done this but I don't know if it is correct:
$T (n-1, d) ≤ b(n-1)d!$
$O(d) ≤ bd$
$d/n (O(dn) + T (n − 1, d −... |
I am new to natural deduction and upon reading about various methods online, I came across the rule of bottom-elimination in the following example.
I do not understand the step in line 10.
Upon inspection, my initial thought would be that the assumption of ¬p and p both being true is absurd, hence anything can be in... |
I am a bit confused on how to give a formal definition of the language accepted by A?
I can describe it by "The language of all strings starting with n-many a's or n-many c's followed by n-many b's" and I have tried to give a formal definition by:
L(A) = {a^n c^n b^n | n ∈ N}
Is that the correct way to define it?
|
I am trying to find a computable, injective and bijective function $f: \mathbb{N} \to A$ where $A$ is the set of all (finite) directed graphs up to isomorphism (also with no edge repetitions). Which means $A$ is containing equivalence classes defined by isomorphism.
i.e, given a graph (class) example $[G] \in A$ where... |
LUKE is a new state-of-art in question answering system and after googled keywords LUKE Studio Ousia NAIST and RIKEN AIP (I suppose LUKE is a colaboration between several research centers) I couldn't find any information.
LUKE is mentioned in the following pages:
https://paperswithcode.com/sota/question-answering-on-sq... |
I'm currently experimenting with some tree-like data structures and came up with a structure that has the following properties:
It consists of nodes and leaves
It has a single root element
Both nodes and leaves each hold a single element
Each node can have a non empty list of subtrees (a leaf could be considered a nod... |
For a study, I have a system (black-box) that requires an input in the form of an array with 4 values (input_array) and depending on their values it produces an output (response) signal.
The input_array contains 4 real values (parameters P1-4), with given and separate ranges. The output signal's quality is measured by... |
in studying Quicksort using the book "Introduction to Algorithms" by Cormen, Leiserson, Rivest and Stein, they describe in order to show correctness, an invariant must hold for the 3 stages of the loop, the initialization, the maintenance and termination of the loop.
Based on the following algorithm, I don't understan... |
So a tournament is just a complete directed graph, I believe.
I'm having trouble proving this problem. I know it is induction however. I was thinking
the base case is $2^1$ vertices, and therefore we have a sub-tournament of 1 + 1 vertices, which holds.
Then in our induction step we have to show $2^{n + 1}$. But I'm ... |
I am seeking a graphical model that is a generalization of both a Markov random field (MRF) and a Bayesian network (BN).
From the Markov random field wiki page:
A Markov network or MRF is similar to a Bayesian network in its representation of dependencies; the differences being that Bayesian networks are directed and... |
When reading about SiamMask (Wang et al., Fast Online Object Tracking and Segmentation: A Unifying Approach), I encountered the terms "Jaccard decay" and "Jaccard recall".
I know what Jaccard index means, but not sure what is the meaning of Jaccard decay and Jaccard recall, and the difference between these terms.
Also,... |
I understand that the general problem of program equivalence is undecidable, but I'm wondering what approaches exist to tackle the problem? I am familiar with Hoare-style verification, but are there any other frameworks for proving program equivalence?
|
For example, assume the input array is $$[121212,212121]$$
Say we are in base 10, so count sort will work in $O(n)$ time. We have 6 iterations which is approximately $n^2$. Is this a worst case example for radix sort?
If so, can I generalize this and say that given $k$ is the total number of digits, a worst case for th... |
The tit-for-tat strategy is a well-known strategy that can be applied, for example, in the Iterated Prisoner's Dilemma (IPD). Roughly, the idea is that you always repeat what the opponent did in the previous round.
I was wondering, does there exist a name for the opposite of a tit-for-tat strategy? That is, a strategy ... |
Let TOT be the set of all Turing Machines that halt
on all inputs.
Find a computable set B of ordered triples such that:
TOT = {e : ($\forall$x)($\exists$y)[(e, x, y) $\in$ B]
This definition means that TOT is a set of all Turing machines e such that they halt on all inputs. The "for all" x denotes all inputs to that m... |
I'm struggling to understand why this piece of lexical grammar works for multi-line comments in JavaCC (posted here):
"/*" (~["*"])* "*" (~["*","/"] (~["*"])* "*" | "*")* "/"
As I read it, the parser scans the input /*, and then zero or more optional occurrences of * can appear, followed by a *, and then zero or more... |
Question is as follows: Given regular languages $L$, $M$. Is $K=\{uw | u,w \in \Sigma^*,(\exists v \in M) uvw \in L\}$ necessarily regular?
Thank you for any input.
|
Let Σ = {0, 1} and let A ⊆ Σ* be a language contained in DTIME(4n), and define
B = {xx | x ∈ A}.
(a) Show that B ∈ DTIME(2n).
(b) Prove that A ≤pm B.
I'm new to complexity theory. how can I show that if the language has the time complexity O(4n) how can i got about proving that its sublanguage has the complexity O(2n)... |
I have designed this Grammar but it is ambiguous:
$$S\to aSbS \mid bSaS \mid aS \mid\epsilon$$
Would anyone help me make it unambiguous? Assume the alphabet is $\{a,b\}$.
|
Can one imply that natural languages can be described by regular grammar? Is that what happens through NPL? Trying to understand the subject of how spoken language can be converted to data and how.
|
My question is regarding the last paragraph of this excerpt from "Cracking the Coding Interview." (For some reason, my table is not formatting here.)
What's the runtime of this code?
int f(int n) {
if (n <= 1) {
return 1;
}
return f(n -1) + f(n -1);
}
The tree will have depth N. Each node (i.e., function cal... |
Suppose we have two markets. Each market has various buy & sell orders that we can sell to or buy from respectively. Each order represents a specific number of a particular item type that someone is selling or buying for a specific price per item and we can buy/sell any amount of items from/to any order. Each item typ... |
Given a partition $[0,1]$,there are 5000 partition subsets $P_i=[a_{i1},a_{i2}]\in[0,1], 0≤a_{i1}\leq a_{i2} \leq 1, i \in \{1,2,...,5000\}$. I want to analyze these subsets and find 10 subsets to contain sixty or seventy percent of the subsets. These 10 subsets could be disjoint, or even overlapping.
|
Its namesake invented the Von Neumann architecture (VNA) in a specific computing environment and a specific context. In light of those two:
What kind of limitations was the VNA designed to work with?
What features in the VNA reflect that?
What kind of purpose did Von Neumann intend for the VNA?
How did the design of t... |
Suppose in a plane, there is a set of points, whose distance to $(0,0)$ is always 1:
$[(0,1),(1,0),(0.707,0.707),(0.707,-0.707),...]$
Each point is assigned with a weight (possible negative):
$[w(0,1) = 1, w(1,0) = 2,w(0.707,0.707) = -1,w(0.707,-0.707)= -2,...]$
Suppose the standard deviation of the points are defined... |
I am an ML Engineer who works alone in projects most of the time. I don't have people who are much smarter than me working alongside.
Most of the time, I feel that working alone is a tedious job,one may get stuck at a lot of problems. In such cases my only go to option is Google. What effective techniques you use while... |
Given the following grammar with terminals $VT=\{[,],a,b,c,+,-\}:$
$S \rightarrow [SX]|a$
$X \rightarrow +SY|Yb|\epsilon$
$Y \rightarrow -SXc|\epsilon$
This should be the FIRST function:
$first(S) = \{[,a\}$
$first(X) = \{\epsilon,+,-,b\}$
$first(Y) = \{\epsilon,-\}$
What would the FOLLOW function be?
|
hope you all are doing well.
I have a question about the time complexity of solution 1 for question 16.4 - Generate Power Set from the book Elements of Programming Interviews by Adnan and Tsung-Hsien.
The question instructs the reader to "Write a function that takes as input a set and returns its power set". The input... |
There is a question to show that $L=\{a^{n!} \mid n \geq 0 \}$ is not regular using Pumping Lemma. However, I have the answer in the book which is found to be somewhere wrong. I am sharing the snapshot of the answer which I could not figure out. Could anybody correct it so that the puzzle could be solved?
|
I have a large set of lines in 2D with a known start point and end point, and would like to find the nearest (defined by perpendicular distance) of those edges (or the extension of those edges past their start and end points) to an arbitrary point.
The best I have done so far is to generate a set of sample points along... |
I am trying to apply PTAS on an algorithm. I think that we apply PTAS on the running time equation of the algorithm. We use the term (1-ϵ) and (1+ ϵ) in the running time of the algorithm but I don’t know how we insert these terms in the running time equation of the algorithm, and that’s what I want to understand. Also ... |
You are given a number n, representing the count of elements.
2. You are given n numbers, representing n elements.
3. You are given an integer k.
3. You are required to find the maximum sum of a subsequence having at most k elements.
4. Adjacent elements can't be selected.
*You have to solve it using Dynamic Programmi... |
Problem
Consider two functions $f: \mathbb{N} \rightarrow \mathbb{N}$ and $g: \mathbb{N} \rightarrow \mathbb{N}$ such that $f(k) = \sum_{d | k} g(d)$ for all $k \in \mathbb{N}$. So, the questions are:
Let's say $f(k)$ is known for $k \in \{ 1, 2, \dots, n \}$. How to evaluate $g(k)$ for all $k \in \{ 1, 2, \dots, n \... |
While preparing for an algorithms exam I came across the following problem in a practice test:
Let $G = (V,E)$ be a connected, undirected graph with weighted edges (all weights are rational numbers but not necessarily all unique) and let $v$ be some node in $G$.
Design an algorithm that finds a minimum spanning tree of... |
We are given a tree with $n$ vertices and some of the vertices act as a "hotspot".
We have to answer multiple queries of type $(a,b,c)$, which means we have to find the distance to the nearest hotspot from $c$ such that we do not travel through the edge between nodes $a$ and $b$.
I have tried many data structures like... |
I have some doubts about this algorithm which checks if a binary tree is a binary search tree:
isAbr(x)
{
if(x == NULL)
return <true, -∞, +∞>;
if(x.left == NULL && x.right == NULL)
return <true, x.key, x.key>;
<abrLeft, minLeft, maxLef... |
It is often asserted that the halting problem is undecidable. And proving it is indeed trivial.
But that only applies to an arbitrary program.
Has there been any study regarding classes of programs humans usually make?
It can sometimes be easy to analyze a program and enumerate all of its degrees of freedom and conclud... |
Today I had a weird dream about a kind of automata. Each automaton has a finite 2D grid wrapped around like a torus, formatted as a table. Execution starts in one cell. Each step it executes whatever is in the current cell, and in each cell there's a symbol and a numeric operator. In one variant the numeric part is sai... |
In computational complexity theory, NP (nondeterministic polynomial time) is a complexity class used to classify decision problems. NP is the set of decision problems for which the problem instances, where the answer is "yes", have proofs verifiable in polynomial time by a deterministic Turing machine.
The proofs for... |
I have a situation where there are a million Keys of type String and I want to use the Symbol table to store the key and the value.
The problem that the retrieval process is too slow and I want to improve the retrieval. I wonder if there is a good hash function to help me with this task.
I am using Separate Channing fo... |
After removing multi-sets and sets that have elements that don't exist in $S$.
$S$ = $[9,6,7,4,5,1,8]$
$C$ =$[[9,6,7],[4,5],[1,8]]$
Transform the values in $C$ of the shared index values with $S$. (This must be done before touching $S$)
$C$ = $[[1,2,3],[4,5],[6,7]]$
And do the same for $S$
$S$ = $[1,2,3,4,5,6,7]$
Squa... |
I am now studying Knapsack Problem (KP), and find the Meet-in-the-middle algorithm described in Wikipedia a little unclear that, how to realize it in the theoretical time complexity of $O^*(2^{n/2})$? I can understand the algorithm for Subset Sum Problem (SSP) which is a particular instance of 0-1 KP, but for the gener... |
Given how important these are for parsing, I'm surprised I wasn't able
to find anything about their complexity. I'm interested in all combinations of:
What is the (edit: best known) time complexity of calculating
<FIRST | FOLLOW | FIRST and FOLLOW> of a <single | all> nonterminals of a <context-free | LR> grammar?
Link... |
This question is related to Master Theorem on oscillating function.
Consider a recurrence of the form
$T(n) = a T(n/b) + f(n)$
Master Theorem's regularity condition excludes some cases (for example, when $f(n)$ is oscillating).
Suppose, however, that $f(n)=\Theta(g(n))$ for a function $g(n)$ that does not violate the r... |
Wondering if compilation increases file size in general, is the source file size smaller than the executable file size?
|
I beg some help with this problem.
There are 2 boolean satisfiability problems.
Problem $A$: Determining whether an arbitrary formula of size $n$ is $satisfiable$.
Problem $B$: Determining whether an arbitrary formula of size $n-1$ is $satisfiable$ in which $n$ is a positive integer $\ge 2$
Prove that $A$ can be s... |
Brief introduction
In all boolean (or more generally mixed-integer) linear programs, constraints are represented as a matrix $A$, a support vector $b$ and is computed by $A^T x \leq b$, where $x$ is a boolean vector one wants to optimize in some way. Another way of formulating the problem is to say that one wants to s... |
I need help with this problem.
There are 2 versions of the satisfiability problem:
[1] decision version: determine whether an arbitrary formula f is
satisfiable or not
[2] search version: if an arbitrary formula f is satisfiable, return
an assignment of truth values to variables in the formula that makes f
satis... |
The problem
The input is a list of $N$ cylinders in 3D space, and the output should be a list of $M \leq N(N-1)/2$ pairs of cylinders that intersect. ($M$ depends on the input data, obviously.)
If it matters, the cylinders are very thin (with a diameter less than 1% of the length for all cylinders), and a solution for ... |
What is the technical term that describes a programming language that abstracts (or at least largely abstracts) the machine location of programs? I’m thinking here specifically of the evolution of handheld calculator programming languages, from early (and some late) models where each instruction exists in a single line... |
I know the reduction to from $A_{TM}$ to $HALT$. But is
the following reduction from $HALT$ to $A_{TM}$ correct?
We are looking for total computable function $f$ mapping from $HALT$ to $A_{TM}$.
The following TM $F$ calculates the reduction $f$.
F = on input <T, w>
create the following TM T':
T' = on input v:
... |
I need help coverting these two question to Math Jax
((50^A)*((((50^B)(((50^C)+1)/(4)))+1)/(4)))/(4)
and
(((50^A)(50^B)(50^C))/(4^2)) + (((50^A)(50^B))/(4^2))+((50^A)/(4))+(1/4)
I don't know how to do it, for a mathstack exchange question.
|
I enjoy reading research on satisfiability, but sometimes it's easier to find relevant information when you know the names of the variants.
Example:
All the clauses are width 3 and must have exactly 1 true literals and 2 false literals: 1-in-3 SAT
Each clause of width n must have exactly 1 true literal and n-1 fals... |
given a formula S (that is built of binary variables and "or", "not", "and" gates).
IS there a polynomial algorithim that builds S' that satisfies:
S' satisfied if and only if S doesn't satisfied.
which means: S' is in SAT if and only if S not in SAT
|
So the algorithm I thought of, is to iterate through the n points, centering a ball at each point, and keeping track of the point where we centered that encapsulated the most points. Then remove the encapsulated points from this max ball we found, then iterate through all the points again. Continue until there are no ... |
What is the time complexity Big-O of this algorithm?
, The first assumption it's O(N * lg N) but it is not correct, why?
count = 0
for i = N : 1 {
for j = 0 : i {
count = count + 1
j = j + 1
}
i = i/2
}
print(count)
|
To the best of my knowledge search engines such as Google index the web using MapReduce amongst many other tools. With my limited experience this would make hash tables the most practical option for storing the MapReduce output which by default is in the form of an inverted index.
Are hash tables in fact used by Googl... |
Here's the question:
Assume there exists a polynomial time machine $M$ that receives two formulas $\varphi_1,\varphi_2$ and satisfies the following:
If $\varphi_1 \in \mathrm{SAT}$ and $\varphi_2 \notin \mathrm{SAT}$, then $M(\varphi_1,\varphi_2)=1$
If $\varphi_1 \notin \mathrm{SAT}$ and $\varphi_2 \in \mathrm{SAT}$,... |
Sorry I don't know how silly a question this might be, but i've been reading up on the halting problem lately, and understand the halting problem cannot possibly output a value that is "correct" when fed a machine that does the opposite of itself. This therefore proves the halting problem cannot be solved by contradict... |
So the question gives us some mysterious algorithm, that given a graph G and an integer k, it outputs true/false to whether there is an independent set of size k in G.
So we have to design an algorithm that can call this mysterious algorithm within a polynomial number of times, to return an independent set of size k fr... |
I am a software developer new to the site. I am currently learning about LFSR (linear feedback shift register). Every day I solve a question which is given to me, but today I am lost. I can not solve this one, so I am asking for your help, for hints, or for any thoughts.
TASK:
Make a linear automaton with the help o... |
Disclaimer: I know nothing about differential equations, and I don't know if this belongs here...
Wikipedia states that a Zeno machine is a hypothetical machine able to compute infinite
steps in finite time, by making use of supertasks. Building such a machine is physically impossible. My question is this: Is the Zeno... |
I am currently studying Shannon's entropy and I have just come across an exercise related to typical sets. More specifically, given a certain type $t$ for the set, the exercise asks to demonstrate that
$$|B_t|≤2^{nH(t)}$$, where $$B_t=\{B:t_B=t\}$$. I have made an attempt using the entropy and the Kullback-Leibler div... |
For every nondeterministic finite state automata that has self-loop(s), there exists an equivalent NFA that does not have any self-loop. How can we prove this statement in a general basis without the use of examples?
|
So the question is:
"Given an undirected graph G=(V,E) with positive edge weights, and E'⊆E, show an algorithm that finds, from all the minimum spanning trees, the one that has more edges from E' ".
|
Given a regular language $L$ (so there is an automaton $A$ which recognizes $L$), I need to determine whether $ L'$ is also regular, where $L'$ is given by
$$ L' = \{ \alpha \in \Sigma^* \mid (\exists \beta \in \Sigma^*)[ |\alpha| = 2 |\beta| \wedge \alpha\beta \in L \}.$$
As far as I understand, I have to construct ... |
I have this question I found regarding n-gram modeling in the Speech and Language Processing textbook by Daniel Jurafsky:
Suppose we didn’t use the end-symbol </s>. Train an unsmoothed bigram grammar on the following training corpus without using the end-symbol </s>:
<s> a b
<s> b b
<s> b a
<s> a a
Demonstrate that ... |
Why do use epipolar lines and what are it's benefits in computer vision ?I am unable to find the uses of epiploar lines and how they are helpful although i am aware of epiploar geometry concepts.
I would be so helpful if someone could pin point one or two uses of epipolar lines in computer vision .
|
The question is to determine whether L is a context free grammar language, what do you think?
|
We are given the following corpus, modified from the one in the chapter:
<s> I am Sam </s>
<s> Sam I am </s>
<s> I am Sam </s>
<s> I do not like green eggs and Sam </s>
If we use linear interpolation smoothing between a maximum-likelihood bigram model and a Maximum-
Likelihood Estimate unigram model with λ1 = 1/2 and ... |
I am wondering what is the relation between line distance and the amount of data transmitted on that line. I know only the basic of computer science. Let's say I want to calculate the time it takes for 100 GB to transfer over a line with the speed of 100MBps. If I just divide them, I will get 1000 seconds but in my onl... |
I'm trying to figure out the following problem:
If algorithm $A$ has a big theta notation of $n^3$ and algorithm $B$
has a big theta notation of $n^2$, there might be an infinite number
of inputs for which $A$ has a lower running time than $B$. Is the
statement correct?
My guess is that it's not correct, becaus... |
I'm a little bit confused about the difference between forward/backward slicing and the use/def-def/use as part of the reaching definitions technique. Isn't the use-def chain supposed to be equivalent to the backward slicing?
Let's assume we have a line that uses some variables. Like: x = y + z.
If we try to find all t... |
For a specific natural $k$ we define the language of couples $(\langle M \rangle, x)$ such that $M$ stops on $x$ and the couple's encoding is bounded by $k$ i.e $L_k := \{(\langle M \rangle ,x)\in HP : |(\langle M \rangle ,x)| \le k \}$
This language is finite thus in $R$. I wish to understand how to build (Not formall... |
Is it true that every regular language can be expressed as a finite union of periodic sets? In other words, if $L$ is regular, then do there exist finite sets $A_1,\dots,A_n,B_1,\dots,B_n$ such that
$$L = A_1 \cdot B_1^* \cup \cdots \cup A_n \cdot B_n^*.$$
I know this is true for regular languages over a unary alphabe... |
In the companion code to A Tutorial Implementation of a Dependently Typed Lambda Calculus
- prelude.lp - there is a rather intimidating definition of a boolElim function that's not described in the paper itself:
let boolElim =
( \ m mf mt -> finElim ( nat2Elim (\ n -> Fin n -> *)
... |
So I am given this blackbox algorithm, in which given a Graph G and a integer k, it returns yes if there is an independent set of size k, no otherwise.
My algorithm is suppose to output impossible if there is no independent set of size k, or output an independent set of size k if it exists.
How might this be approached... |
Given a list of vectors consisting n integers that has been sorted by their components in certain priority, how do you find the possible sorting keys, i.e. the order of precedence?
Suppose there is a sorting function:
def some_sort(vectors):
priority = (vector[i],..., vector[j])
return sorted(vectors, key=prior... |
Design a Context-free grammar (CFG) for this language
|
In website geeksforgeeks i read that adding a vertex to graph in adjacent matrix takes O(V^2) time but i am not getting it. It requires adding a row and a column which should take linear time ?
I am a beginner hence forgive me for such a question
Link:- https://www.geeksforgeeks.org/graph-and-its-representations/
|
How can I interpret a time complexity of $2^{O(n)}$? Is it simply equal to $O(2^n)$?
I'm pretty new to this, so would appreciate any kind of help.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.