instruction stringlengths 35 29.1k |
|---|
I have a problem in error-correcting codes.
Say we have a generator matrix of a linear binary code
$$g=\begin{pmatrix}
10011 \\
01101
\end{pmatrix}
$$
Q1: How many different codeword do we have? How many code bits can the code correct?
Say the generator matrix of a $(6,2)$ binary code is
$$g=\begin{pmatrix}
101001\\... |
Given a language L, I've shown that L is not regular. Can I conclude that it is not decidable or are there non-regular languages that are decidable?
|
I am trying to write an efficient Parallelised algorithm for Data Averaging. By this I mean I have a list of tuples (K, V1, V2, V3) and in the end, I want a dictionary mapping K to the average of all V1, V2 and V3 present in the list with K.
If anyone can think of something it would be much appreciated.
Thanks,
Harris ... |
I am supposed to find a language $$L\subseteq \Sigma ^*, \Sigma \subseteq \mathbb{N}$$ that fullfills the pumping lemma and is not in RE and not in coRE. I've never constructed a language with a given constraint, I've only shown that a certain language satisfies a given one. Not wanting to waste a bunch of time guessin... |
So the complement of L1 = $\{a^{n}b^{n}c^{n} \mid n \geq 1\}$ would be L2 = $\{a,b,c\}^* \setminus \{a^{n}b^{n}c^{n} \mid n \geq 1\}$.
In other words, any combinations of a,b and c where we dont have an equal number of all three letters and w = $\varepsilon$ is also legit.
However, while I'm certain that there should ... |
Is there a trick for computing the expression
$x + (exp(x)-x)/(exp(2*x) + 1)$ while avoiding an overflow?
Currently, computation seems to fail for any $x \geq 710$, presumably because computing $exp(2*x)$ leads to an overflow. The expression as such never produces particularly large numbers, but exponentiation seems ... |
I know that every DPDA (deterministic PDA) is a PDA (more specifically, non-deterministic PDA). But I found it hard to understand, not that every DPDA is an NPDA, but some results that contradict this fact:
In PDA we have two modes of accepting the language, which are "empty stack method" and "final state acceptance m... |
I am looking for an algorithm to solve the following variant of interval scheduling : schedule some tasks on multiple machines, which are only available during a given interval of time. Two tasks cannot be performed at the same time by the same machine. I am trying to maximize the number of scheduled tasks.
More form... |
I have a set of touching rectangles (Initial problem), and an associated graph relating the rectangles through the edges. I want to reduce the rectangles through graph operations to the minimum internal border (Optimal solution). Sub optimal solutions which can be solved quickly are also acceptable. The reason why the ... |
Lamport timestamps and vector clocks sound like almost the same thing. Both are used to determine the order of events in a distributed system. What are their key differences?
|
Before I found out about FFT https://m.youtube.com/watch?v=spUNpyF58BY but having seen and been impressed by spectrograms/sonograms, I developed my own algorithm for converting to the frequency domain from the spacial domain.
The following sudocode describes the approach.
// epsilon_n constants are small adjustable val... |
So I know that these are both true, but if I change the values would they still be true? Do these statements hold for any value?
A) Suppose f is a flow of value 50 from s to t in a flow network G. The capacity of the minimum s-t cut in G is equal to 50.
Suppose we were using 100 or maybe 75 instead of 50. Is this stil... |
I'm looking for an efficient solution to the problem of tracking the number of connected components in a general graph under edge deletions.
General connectivity algorithms like that from
Holm, Lichtenberg and Thorup solve this problem and also feature edge insertion and connectivity queries, which I dont really need,... |
I'm trying to understand cache misses/iter and came across this that I couldn't understand or reason out.
For ijk iteration, my slides say that there are 2 loads and 0 stores.
for (i=0; i<n; i++) {
for (j=0; j<n; j++) {
sum = 0.0;
for (k=0; k<n; k++)
sum += a[i][k] * b[k][j];
c[i][j] = sum;
}
}
Sim... |
I provided my answers in the "answer your own question" bit.
I have applied the same logic for my answers to a&b and c&c which seem to be essentially the same questions. Am I right though?
a) Suppose f is a flow of value 50 from s to t in a flow network G. The capacity of the minimum s-t cut in G is equal to 50.
b) Su... |
Threads called the "unit of dispatch" but what does that mean? I was looking over the web and two operating systems books but I can't find the answer. It seems that processes are defined by two characteristics: resource ownership and scheduling/execution. I understand that threads are within processes, and that there m... |
Consider the $\text{CTL}^*$ formula $E[pU(qUr)]$.
It is not hard to show that it is equivalent to the $\text{CTL}$ formula $E[pU(EqUr)]$.
The informal reason is that a path where $p$ is true until $qUr$ is true is the same as a finite branch where $p$ is true along it, followed (concatenated with) by a path (starting ... |
For comparing two images, one can use the Peak Signal-to-Noise Ratio (PSNR) metric, defined as follows:
$\mathrm{PSNR} = 10 \cdot \log_{10}\left(\frac{\mathrm{MAX}^2}{\mathrm{MSE}}\right) = 20 \cdot \log_{10}(\mathrm{MAX}) - 10 \cdot \log_{10}(\mathrm{MSE})\ dB.$
with $\mathrm{MAX}$ being the maximum gray-scale value (... |
For a certain parameter $k$, is the algorithm with the running time of $O(k.n^{\log{n}})$ in class $FPT$? I would appreciate if you can kindly guide me through.
|
If there's no deletion, we can use $2$ balanced trees to maintain $2$ half convex hulls(up and down). In this way, we can insert $n$ points in $O(n\log n)$ time.(In the beginning, there are no points)
A completely dynamic convex hull means that I can insert and delete a point without rebuilding the whole convex hull, w... |
I'm studying $\lambda$-calculus and came across a problem that I'm not sure how to understand. More specifically, it's about evaluating $\lambda$-calculus expressions using $\beta$-reduction.
I was taught that the basic steps for performing $\beta$-reduction are to
Find reducible expressions in the form of ($\lambda ... |
Let $G$ be a graph such that $V$ denotes a vertex set and $E$ is an edge set of the graph $G$. Let us consider that for the input graph $G$ it is the case that $|E| \le O(|V| \log |V|)$. Given a graph $G$, I want to answer whether $(u,v) \in E$. If the input graph is given by adjacency representation then I can answer ... |
This question is related to Amazon's QLDB, but my question is about the generic architecture of such a software system. The question arises from the fact that Amazon advertises the service as "highly scalable".
System Definition
So, let's forget about Amazon and dive into the abstract software system. We want to develo... |
I am trying to find the total number of distinct minimum weight spanning trees(MWST) in a simple, undirected, unlabeled and weighted graph but I am confused whether should I have to consider Isomorphic trees(if it is present) as a single minimum weight spanning tree or not while counting the distinct MWSTs because grap... |
It seems that there's no end to knapsack variations… here's the one I bumped into (at work):
There are:
N items, each with the usual value and weight properties.
M bins, each with an upper bound and a lower bound on the total weight of the items that can be assigned to it. (That is, the total weight of the items assi... |
Many sources for good software architecture will use objects, pointers, memory allocation in their solutions. The PLC programming language 61131-3 Structured Text is really limited in this regard, more like a limited version of Pascal. Reasons for this are often cited as i.e. safety and determinism.
Here are some of th... |
I apologise if this is not the right place for this question... I didn't want to ask on Stackoverflow or CodeReview as it will closed in minutes as "too broad".
A client of mine is writing an API that takes a piece of personal-identifying information as the parameter in the URL, and has asked that the value is hashed u... |
I'm trying to determine whether it is possible to decide if a system of $n$ linear equations with integer coefficients and $n$ variables has a solution in $\{0, 1\}^n$ in polynomial time.
Additionally, all of the coefficients of $A$ are in $\{-1, 0, 1\}$, but I couldn't find a way to use that.
The trivial case is if th... |
Wikipedia lists the following algorithm for normalizing a lambda calculus term $t$:
If $t$ is not in head normal form, beta reduce the beta redex in the head position to get $t'$. Then normalize $t'$ to get $t''$. $t''$ is the normal form of $t$.
If $t$ is in head normal form, normalize each of its subterms to get $t'... |
I'm currently learning some things about BSS RAMs.
For sake of simplicity, please imagine them as a Turing machine over the reals.
Now, this machine gets some real numbers as input. The input values form nearly a string, but are not of finite length as decimal representation. Additionally, there are infinitely many rea... |
Consider this problem: you are searching an array of elements and are comparing the square of the current element to some number K. Essentially, you are looking to see if the square root of K is in the array. With this algorithm, chances are, you will not search the entire array because you will either find the square ... |
Suppose $G$ is a connected graph and $S$ is a vertex cover. Prove that $S$ is also a dominating set.
Can I get some help with proving this? I know that a dominating set in an undirected graph $G=(V,E)$ is a subset $S$ subset of $V$ such that every vertex is either in $S$ or has a neighbor in $S$.
I know that a verte... |
This question is about file-hashing/fingerprinting algorithms (similar to SHA-1 and MD5 and so on). Those algorithms are handy because they give you a small (and fixed-sized) hash code for any file, which can be later used to efficiently determine if that file is different from another file, and (if we are willing to ... |
I have recently read that turing machine can be remodeled to perform as PDA now, i have a question that since DTM = NDTM ( non deterministic Turing machine) then every DTM can remodeled to be NDTM thus taking same analogy to PDA , we have DPDA = DTM( remodeled) = NDTM = NPDA thus creating DPDA = PDA . there is no debat... |
I'm trying to show that the language {(m,n)|m has exactly n divisors} is in NP.
The input (m,n) is in binary.
The non-deterministic Turing machine for the language would be:
1) Guess the prime factors of m.
2) Verify that ∏i(di+1)=n.
The problem is that I can't find a way to factorize in polynomial time (in the input) ... |
I tried looking this problem up for quite a bit now, but can't seem to find a whole lot of discussion about this. At first it sounded like the TSP to me, but I don't think so (it's much harder to do I believe). Maybe I am over thinking this though? I'm not looking for the fastest solution, but I fear a brute-force algo... |
Undirected graph is given which has M edges and N vertices we have to convert every edge from u−v to u→v or v→u such that the total outdegree of every vertex is even.
For example, consider a graph which has the edges 1-2, 1-3, 2-4, 3-4. We can direct it as 1→2, 1→3, 2←4, 3←4, so outdegrees of 1,2,3,4 are respectively 2... |
I've been asked to solve this problem, but I'm completely stuck now.
Is the set $\{G \in\text{CFG} \mid L(G)\supseteq L(A) \}$ where A is DFA fixed beforehand decidable?
I know I've to find a reduction, and as a hint they told me that it is related to Acceptance Problem or Post Correspondence Problem, or probably wi... |
Consider the following languages:
$$ \begin{align*} L_1 &= \{ 0^p 1^q 0^r \mid p,q,r \ge 0 \}, \\ L_2 &= \{ 0^p 1^q 0^r \mid p,q,r \ge 0, \; p \neq r \}. \end{align*} $$
Which one of the following statements is false?
A. $L_2$ is context-free.
B. $L_1 \cap L_2$ is context-free.
C. $\overline{L_2}$ is recursive.
D. $\o... |
Is it true to say that $\Sigma^* \cdot$ {$a^nb^n: n>=0$} = $\Sigma^*$
Becuase if we take $\Sigma^*$ and concatenate it to {$a^nb^n: n>=0$} we don't get any "new" words than those we had in $\Sigma^*$ in the first place.
|
Let's say we want to build data structure able to perform two operations.
First one, query is asking for the sum of values in the range $[i, j]$. And the second one, the update is setting all values on the range $[i, j]$ to have value $1$. On the beginning all elements of the array are $0$.
What is the fastest data str... |
Can someone explain to me if this is true or not?
|
Whenever a caller or client modifies a library collection class, all iterators are made invalid (with the exception of the iterator through which the change was made, in the case of remove). Give a reason for this rule in the case of an array list (using a dynamically sized array, in which an iterator has a pointer to ... |
Let relational schema R(A,B,C,D,E,F,G,H,I).
The functional dependencies are: A -> BC, AD -> BE, C ->F , A->F , D-> E
Find the number of non-trivial functional dependencies ? I know that R has only five non-trivial functional dependencies but i do not know how to prove this(How to think)?
|
I am having a hard time understanding if this would be true or false, can someone point me in the right direction?
|
If this question is completely garbage I apologize because I am new to CS and haven't understood at how programming languages (Python specifically) work.
I was reading about how in a standard two-byte representation of a number, if one was to increment 65,536 times, the integer would wrap back to one. Would this case o... |
I run a testing application that, using Selenium, runs testing "scenarios" each of which visits a bunch of pages on a website. Each page is modeled by a Java file that contains locators, each of which are used to locate certain elements on the page maybe to verify that they exist or, beyond that, that they work as inte... |
What would be a regular expression for the language of words containing a single 1 and an even number of 0s?
|
Consider $\mathsf{REGULAR_{TM}} = \{\langle M \rangle \mid \text{$M$ is a TM and $L(M)$ is a regular language}\}$.
Let $S$ be the following algorithm, which solves $\mathsf{A_{TM}}$: “On input $\langle M, w \rangle$, where $M$ is a TM and $w$ is a string:
Construct the following TM $M_2$:
$M_2$ = “On input $x$:
If $x... |
If I know that problem $A$ is NP-hard, but know nothing of problem $B$ and I know that the following Karp reduction is true:
$$A \to B \, .$$
Is it correct to conclude that $B$ must also be NP-hard?
|
Here is exercise 1.5.15 in Algorithms 4th Edition by Robert Sedgewick and Kevin Wayne.
Show that the number of nodes at each level in the worst-case trees for weighted quick-union are binomial coefficients. Compute the average depth of a node in a worst-case tree with $k = 2^n$ nodes.
Here are my questions:
1) What i... |
Can we use recursive algorithm to find the greatest element of a finite list when numbers are unsorted.
How to use recursive algorithm to find the least element of a finite list of unsorted numbers where repetitions of number is allowed.
How can Mergesort calls itself n^2 times on a list with n numbers.
Is it true if... |
Suppose there is a statement -
Some students in this class has visited Mexico.
Solution given is: considering the universe of discourse for the variable $x$ consists of all the people. Our solution becomes $\exists{x}[S(x)\land{M(X)}]$ where the predicate $S(x)$ tells $x$ is a student in the class and $M(x)$ tells $x... |
It is given that for a relation R all the attributes of the relation appear in some of the candidate keys. It is also given that there is only one compound candidate key which exists for a relation, all the other candidate keys are simple candidate keys. What can be said about the normal form of R?
In my opinion, since... |
The wikipedia page on computational resources states that there are many different resources that have been defined:
In computational complexity theory, a computational resource is a resource used by some computational models in the solution of computational problems.
The simplest computational resources are computati... |
Is there a data structure or an algorithm or a combination of both to allow me to filter a set of documents based on the number of missing words (compared to another list)?
Problem Definition
We have a list of documents $D = \{d_1, d_2, \dots, d_n\}$. Each document $d_i$ consists of a subset of words from a word pool $... |
The requirement is that two adjacent vertices have different colors, and max. 42 colors.
I show that $ \text{42-COLOR} $ is in NP and then I must reduce it from $ \text{3-COLOR} $. Here it becomes complicated.
Is it similar to $ k\text{-COLOR} $ for any $k$?
|
I got that I can get (1) followed by not (1) like this
$$ (0+2)^*1(0+2)^* $$
From this point I'm actually stuck. I can't set the (0) to be somewhere in expression. The only expressions I get are ambiguous (where I can get the same word different ways from regex) and quite long. Is there more elegant and right way to w... |
I am confused about how denormalized numbers work in floating point representation.
I was referring to Stallings book and this article. The book initially explains floating point number format in general and then explains IEEE 754 floating point format. I will tell explicitly when I am talking about floating point form... |
I could not figure out an efficient way (better than $O(n^2)$) to count the number of contiguous subsequences of an array of both positive and negative integers summing up to a given number $k$.
For example, if $A = \{2,5,6,-1\}$ and $k = 5$ then the answer is $2$, since both $5$ and $6,-1$ sum to $5$.
|
Problem
I have $J$ matrices $C_{j}$, which are $K \times M$.
Elements of each matrix $C_{j}$ are between 0 and 1.
I want to randomly choose $J$ matrices $A_{j}$ and one matrix $B$ such that:
Elements of all matrices $A_{j}$ and matrix $B$ are between 0 and 1
$A_{j}B = C_{j}$ for all $j$.
Dimensions of each matrix $A_{... |
I'm learning about single source shortest path algorithms and need to clarify few doubts-
Does Dijkstra’s assumes that the weights of edges in a graph searched by it are positive integers.
Does Dijkstra’s assumes that the graph searched by it is free of cycles.
Relaxing an edge is same as setting its weight to 0.
Doe... |
I see everywhere that the recursive equation for the complexity of Strassen alg is:
$$T(n) = 7T(\tfrac{n}{2})+O(n^2).$$ This is not so clear to me.
The parameter $n$ is supposed to be the size of the input, but it seems that here it is one dimension of a matrix while the input size is actually $n^2$.
Also, each matrix ... |
Coming from non-computer science background, I am trying to understand the different types of equivalence and equality usually used in type theory. Ideally, I am looking for clear definitions and notations (ie the symbols commonly used) of:
difference between equivalence and equality of types $T_{1}$ and $T_{2}$
defin... |
A finite automaton (FA), A, may accept or reject its own encoding, {A}. A machine, M, can be written that accepts {A} iff A rejects {A}. Turing gave a famous proof that M is not an FA. The proof relies on a contradiction that occurs when one assumes M is an FA and then runs M on its own encoding. However, it may st... |
My initial thought is that L can't be context free since I can use the pumping lemma. I also don't think a grammar can be generated since it needs to keep track of the number of c's and a's. However, I'm having a hard time coming up with an algorithm for this language.
|
This DFA is a token scanner for a programming language.I would like to add keywords of the programming language(if,else,end ... etc) in the DFA so the lexical analyzer can recognize them.
The Question is : Do i have to convert the entire given DFA to an ε-NFA(which will result in more states),add the keywords(with ε t... |
Recently, I was looking at the underlying data/implementation of a survey application created using a RPA tool. As a user progresses through the survey, the "decisions" reveal a predominantly tree-like structure, with some graph-related elements (there is essentially a "GO TO" component that allows a single node to sha... |
Electrical engineers often use multiplexers to implement Boolean functions. What is the correct technical term for this model of computation? Is it Decision Tree model or is there another name?
|
Is $\{\langle G \rangle | L(G) = \sum^{\star}\}$ in co-RE? $\langle G \rangle$ is the encoding of a context free grammar. My intuition is that this is false.
|
Lets say I have a set: $ L = \{\langle G \rangle | L(G) = \Sigma^{\star}\}$ and the question asks if it is co-RE. I know that if something is co-RE, it halts on every input not in L but may or may not halt on inputs in L.
So in this case would something "not in L" be nothing?
|
I have the following problem:
Consider the MAX-3-SAT problem: given a Boolean function in
Conjunctive Normal Form (CNF) determine the maximum number of clauses
that can be satisfied. Prove that this problem is NP-hard.
I know that I'd have to reduce 3-SAT to MAX-3SAT, but I'm pretty lost on how that would work. T... |
Learning induction proof now, found a "simple" example, which is a bit confusing to me (not sure if it is a valid example). If so, why the IH(
suppose a root of rank k has at least $2^k$ vertices in its tree
)is a valid one since it just repeating the statement that we are trying to prove ? What about the induction s... |
In the book by William Stallings the overflow rule overflow rule for 2's complement addition is stated as follows:
Overflow rule: If two numbers are added, and they are both positive or both negative, then overflow occurs if and only if the result has the opposite sign.
Then the book gives the following examples:
Do... |
I have been tasked with reducing the following lambda expression:
(λpq.pqp)(λab.a)(λab.b)
using call-by-name and call-by-value reduction strategies.
Call-by-name
strategy: Left-most, outermost redex first but no reduction under lambda.
Step 1) alpha-equivalence
(λpq.pqp)(λab.a)(λcd.d)
Step 2) Reduction - using the ... |
The following is an excerpt from Information Theory: A Tutorial Introduction, page 65.
Now, supposing the identity of each letter in English does not depend
on any letter that is more than 10 letters away. In practice, the
dependency between letters diminishes rapidly as inter-letter distance
increase, as shown in Fig... |
Give a context-free grammar for the following language: $\{ a^i b^n a^n \mid i \ge 0, n \ge 0 \}$
So far, this is the solution that I have been able to come up with, though I am not sure how accurate it is:
$$\begin{align*}
S &\to aSa \mid X \\
X &\to bX \mid a \mid \varepsilon
\end{align*}$$
I worked this out from o... |
I am trying to figure out the difference between information and conceptual models. For me, both terms seem to mean be the same, but I cannot find a reference where this is established. They are never used together; maybe because they are from different domains?
My question is: What is the difference between informatio... |
M is a turing machine description, L(M) is recognized by M, |L(M)| is the size of this language.
{M : |L(M)| <= 330}
{M : |L(M)| >= 330}
I don't quite understand what this question is asking. Does the first question mean M accepts at most 330 inputs?
My thoughts:
co-CE
CE (Construct a M to check the input, if >= ... |
I have a tree where each node is assigned a weight (a real number that can be positive or negative). I need an algorithm to find a simple path of maximum total weight (that is, a simple path where the sum of the weights of the nodes in the path is maximum). There's no restriction on what node the path starts or ends.
I... |
How can I design a sorting algorithm of n elements using a Fibonacci Heap?
Will it be a flavoured version of heap-sort where I replace the heap data-structure with Fibonacci Heap?
Your help is appreciated
|
i am trying to understand Context free grammar and generate a CFG for any given language.
when you're given a language , what is the best way to generate a CFG from it? are there any steps to follow to help you create a CFG for any language? is there ways of breaking down the language to make it simpler so that it hel... |
Why would you want to traverse a binary tree in preoder, inorder or postorder? Why not use an order like breadth-first search for all graphs?
|
Is odd length pallindrome DCFL or NCFL?
Like
1) $L=\{w1w^R\mid w \in \{0, 1\}^*\}$
or
2) $S\rightarrow aSa\mid bSb\mid a$
or
Suppose odd length String like
3)$S\rightarrow aSa\mid bSb\mid aSb\mid bSa\mid a\mid b$
We get information about even length palindrome, that it can never be DCFL, but what about odd length?
|
I'm beginning to have an understanding thanks to some videos relating to "Proposition as Types". But, I don't come from a theoretical CS background, so maybe I'm blocked probably a bit by notation...
Given that I have understood, Conjunction, Disjunction, Implication,
I'm stumbling on Negation:
intro:
[A]
/\
---
¬ A... |
I was asked this question and could not come to the correct answer:
Let $L$ be the language of all words over $\{a,b\}$ where the first letter is identical to the letter that is next to last. (Pay attention – every word with length 2 is in the language.)
Sketch a nondeterministic automaton that accepts this language.
... |
I know that if a language is regular or context free, the language is decidable. However, if a language is decidable does that imply that it is also regular or context free?
|
Let $G=(V,E)$ be a directed graph, $\omega : E \rightarrow R$ a weight function, and $s,t \in V$ a pair of different nodes. It's given that $G$ doesn't have a negative cycle. Moreover, 10 of its edges are colored in red (let's say that the rest are colored in blue).
I want to find an efficient algorithm that find the s... |
I'm considering the general resource reservation problem: n processes, m resources. Each process requests a set of resources and each resource can be used by exactly one process. Processes are only active if they have all requested resources.
Instance: A set of processes P, a set of resources R, the set of resource req... |
Post's Correspondence Problem is known to be undecidable. A variant of PCP, namely PCP with partially commutative alphabets is also known to be undecidable.
Is the following variant also known to be undecidable?
PCP with commutative alphabet.
Given and alphabet $\Sigma = \{a_1, a_2, \ldots, a_K\}$ and $2N$ sequences $... |
I have several series of integers (vectors) that could be plotted at equal distances apart:
1: [0,1,2,1,5,3,5,7,4,2,3,4,3,4,5,6,8,1,3,1,3,8,4,3,5,1,3,8,3,4,1,8,8,6...]
2: [5,3,7,4,2,3,4,1,2,11,5,3,15,7,4,13,7,2,13,8,9,11,1,19,11,8,11,16,11...]
...
n: [40,31,32,41,45,43,45,57,54,42,53,44,53,44,53,35,31,33,8,3,4,1,8,8,... |
Can anyone help with this question? I currently have this solution that prints
1 2 3 4 5 6
but I'm having trouble going back down to 1.
public class noLoop{
public static void main(String []args){
noLoop(6);
}
public static void noLoop(int n) {
if (n == 0) {
return;
... |
Whenever I've come across this question whether on the internet or in my class everybody mentions the 4 address sequencing capabilities required in a control memory and the steps of address sequencing:
1. Incrementing of the control address register
2. Unconditional branch
... Etc.
But what is the "definition" of addr... |
I am trying to find references on a particular idea, but I don't know which keywords to use in a google search.
the idea is: as an example, consider graph search. maybe the problem is: find a path from node $X$ to node $Y$. We can consider two versions of this problem:
For any node $n$, we can query only the informati... |
I've been reading about the Grover algorithm for finding elements in an unstructured database by the means of quantum computing, and even done some exercises.
What I don't understand (and can't find anywhere) is what is supposed to happen if the element is NOT present in the database. The oracle would never flip any qu... |
I found a question.
Least number of temporary variables required to create three address code in static single assignment form for the expression $p+q*r-s/(q*r)$
My attempt:
$t_1 = q*r$
$t_2 = s/t_1$
$t_3 = p + t_1$
$t_4 = t_3 - t_2$
So, I got $4$ variables but their answer is $5$. Am I missing something? Where ... |
Tl;Dr;
Given:
type A = { int: foo, int: bar }
type B = select foo from A
What is the name of the typing relationship between A and B?
What is the name of the operation of deriving type B from type A?
Long Version
When we talk of subtyping in programming we typically think of it in terms of whether a new subtype B o... |
I have a context-free grammar with the following production rules, $S$ being the start symbol:
$$\begin{align*}
S &\to AB \\
A &\to a \\
B &\to a\end{align*}$$
Is this in Chomsky normal form?
My problem is I thought CNF is supposed to be an efficient way to write a grammar, yet the grammar is not efficient in the sense... |
I'm learning graphs these days and need to clear few doubts-
Can I determine weather 5 points in two dimensions whose X and Y coordinates are given lie on the same straight line in O(1).
What is the efficient way to find out the degree of the specified vertex in an undirected graph (V,E)? I'm thinking of O(|E|)?
What ... |
I am a beginner developing kernels (though I have developed several Hello World programs in C and C++). I frequently see reference being made to global constructors (e.g., osdev https://wiki.osdev.org/Calling_Global_Constructors), but I have not been able to find a clear definition or in it.
Could someone please guide ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.