instruction stringlengths 35 29.1k |
|---|
Some lambda terms, such as the church number 3: (f x -> (f (f (f x)))), are easily typeable on the simply typed lambda calculus. Others, such as pred, (a b c d e f -> (d (g -> (t -> (t (g e)))) (g -> f) (g -> g))), are known to require more complex systems such as System-F. Some of them aren't typeable on System-F itse... |
I don't know if there is a canonical problem reducing my practical problem, so I will just try to describe it the best that I can.
I would like to cluster files into the specified number of groups, where each groups size (= the sum of sizes of files in this group) is as close as possible to each other group in this clu... |
How many operations are performed in the following in order to get a running time function of an algorithm:
x = x + 1
x += 1
x++
I know that in (1) there are 2 operations: an assignment and an addition.
Does the same criteria apply to (2) and (3)?
|
Would a class in Linear Optimization/Programming be useful for a CS degree?
What is it used for or how useful is it.
Can someone please help me decide. Thanks in advance
|
Let's say I have a programming language that allows procedures, i.e., methods without return values, and immutable data-structures, so no sideeffecting inside a procedure. Is it possible to simulate a program written in a language with return values in our language?
In other words, do return values allow for a more adv... |
Recently I've accepted a job offer to work on compiler design. To be properly prepared I've decided to review the material. The book that is being used for that is Cooper and Torczon's Engineering a Compiler. That's the one we used in a class. On page 645 there is a definition of a schedule, but I can't figure out what... |
The question is a bit unclear, so let me explain. Finding local alignments in sequences like protein sequence is a well studied area in bioinformatics, and I do not think there is any lack of information on that.
However, recently, I had to tackle a problem in which sequences had partial orders - meaning that some par... |
I was watching a lecture and got confused over a slide. This is what it says:
Consider a polynomial - first representation
$$P = 2 + 4x^{3} + 8x^{6} + 7x^{25} + 6x^{99}$$
The space complexity is 100 memory locations.
The time complexity is:
Access lookup operations: 100
Multiplication operations: 4 + 7 + 26 + 100 =... |
In my Algorithms and Data Structures course, professors, slides and the book (Introduction to Algorithms, 3rd edition) have been using the word NIL to denote for example a child of a node (in a tree) that does not exist.
Once, during a lecture, instead of saying NIL, my classmate said null, and the professor corrected... |
According to the answer of Andrew Yeats in this link, quantum computer's advantage is so narrow that personal computer is not likely to benefit from the development of quantum computer. I think this is understandable, so will the growth of calculation speed of personal computer end after that of classical computer will... |
I've been programming in languages (C/C++/Ruby/Java/HTML) for some time now and am currently entering my senior year of high school. I'm taking AP Comp Sci, which uses Java, but want to have a better grasp of some of the more "math-y" concepts in computer science, like hashes/algorithms/etc. For someone who has done ba... |
I'm reading a book on compilers, Engineering a Compiler, 2nd ed. by Keith D. Cooper & Linda Torczon and I came a across two new terms that I can't understand, they are:
transitive successor and transitive predecessor of a node $i$
I tried to find definitions of those online, but I'm having hard time with it. Everythi... |
For a set of items with two properties, how can it be detemined if they can be ordered in a way so that for every value of either property all items of that value are grouped together.
Obviously trying every possible ordering is out of the question.
For example, if each item has a number and a letter, the following seq... |
A threshold function is a function $f: \{0,1\}^n \to \{0,1\}$, defined by $n$ integer-valued weights $w_1, w_2, \ldots, w_n$ and an integer valued threshold value $w_0$. It works as follows:
$$f(x_1, x_2, \ldots, x_n) = \begin{cases}0 \text{ if } \sum_{i=1}^n w_ix_i \ge w_0 \\ 1 \text{ otherwise.} \end{cases}$$.
I'm co... |
http://cs.jhu.edu/~misha/Spring14/Preparata77.pdf
This is a divide and conquer algorithm for computing the convex hull in 3 dimensions.
I am having trouble understanding the merge step, which is titled Merge in 3 Dimensions, outlined in the paper.
I am specifically having trouble understanding how the number of compa... |
I'm working on a programming task that I, without good evidence, have a sneaking suspicion is NP-Complete. With that said, I would like confirmation on this if possible, as well as some suggestion for a way to approximate a reasonable solution. Lastly, if this problem is just some popular problem in disguise, I'd love ... |
I have been reading about the Rabin Karp algorithm and I kept wondering what's the big deal with keeping our rolling hashes values bounded by a value Q?
I'd thought that as our integer number representation on the typical computer is 2-complement, it's actually exactly equivalent as bounding all our operations over th... |
The project I am currently working on (in C#) requires generating random integer between 0 and Int64.MaxValue.
I have access to a Uniform RNG, which for pseudo-code purposes in the question, I will refer to as:
MyRNG(min, max)
My overall question has to do with how best to use MyRNG(min, max) to create a Non-Uniform ... |
I have an AVL Tree which every node has a filed with a key which is an integer. I need to save a pointer to the Minimum , Maximum and the $\left \lfloor \frac{n}{4} \right \rfloor $ nodes. the first and the second were pretty easy i just saved a pointer between each node and its follow and back nodes. But i couldn't f... |
For a code similarity detection framework I need to eliminate references to non-local variables, for example having the following closure:
{
var a;
var b;
var f = function() {
a = 5;
b = 6;
}
f();
}
would be converted into something like:
{
var a;
var b;
var f = function() {
var a = 5;
... |
Where is program counter stored? CPU caches?
Also how big are these counters?
What happens if that memory has been filled up?
I know that it's a value that stores the next instruction for the CPU to process, as well as it increments with the size of the next instruction to cycle for the next instruction for the CPU to ... |
I tried to prove that the following language is recursive: for $\Sigma=\{0,1\}$, $k$ a positive integer:
$$
L_k= H_{\mathrm{TM},\varepsilon}\cap \Sigma^k
$$
where $H_{\mathrm{TM},\varepsilon}=\{\langle M\rangle\mid M \text{ is a TM that halts on an empty input}\}$
It is easy to prove because $L_k$ is finite, but I didn... |
I have this language $ L = a^* \cup \left \{ a^mb^n|m>n\geq 0 \right \}^* $ I have to prove that this language is not regular but still satisfies the pumping lemma for regular languages (Since the pumping lemma is a necessary but not sufficient condition for a language to be regular).
First I made the leap that $L$ i... |
I'm trying to understand how trace scheduling works. The book that I'm reading, Engineering a Compiler by Keith D. Cooper & Linda Torczon, states that this method is using profiling. Profiling ranks each edge if the CFG by its frequency of execution. In other words the more a particular edge is followed the higher rank... |
I was just wondering on a more technical side, if anyone could explain what Google does to create these amazing images from it's deep dream system.
Could anyone explain to me in a step by step way, what the program does and how it does it.
|
I am given (or rather, generate randomly) three positive integers $a, b, c$. I want to know if there exist integers $m \ge 2, s \ge 1$ such that $ms+m = a, ms+1 = b, 2s+1 = c$. If there are multiple solutions, I want the minimal (if possible).
It is clear that $c$ has to be odd, so if $c$ given to me is not, then I ca... |
I have some heavy calculations that essentially takes a point in the plane as input and gives an integer as output. Points in the same region gives the same integer (think about the regions as pieces in a jigsaw (every point in completed puzzle belongs to a specific jigsaw piece), the boundaries being simple, closed cu... |
I tried to prove that the following language is recursive/decidable/in R: for $\Sigma=\{0,1\}$, $k$ a positive integer:
$$
L_k= H_\text{TM,epsilon}\cap \Sigma^k
$$
where $H_\text{TM,epsilon}=\{\langle M\rangle\mid M \text{ is a TM that halts on epsilon input}\}$
It is easy to prove because $L_k$ is finite, but I didn't... |
According to various informal analysis, we know that the running time of quickselect is o(n), by assuming thay the partition is always taking half of the array. However, my lecture gives without proof that if we do a formal analysis, we will get the following formula:
$$C_N = 2 N + 2 k ln (N / k) + 2 (N – k) ln (N / (N... |
We all know in the case of web sites, to make update just means opening the code, editing it and saving it. And to view the changes we just have to refresh the browser.
But what about in the case of compiled programs like a game or other apps or even an OS. How does it work? What happens to the code?
|
Is it possible to do universal classical computation using bits and 2-bit gates when you cannot perform a NOT operation on a single bit (hence cant do CNOT and so on). If yes, what are the possible universal sets of gates that do not utilise the NOT transformation. Thanks!
EDIT: to clarify, you can perform any set of o... |
I'm referring to the proof outlined here (and wikipedia.org):
https://proofwiki.org/wiki/Deterministic_Time_Hierarchy_Theorem
In my understanding, if I relaxed the conditions such that $K$ decides the input in time $O(f(m)^3)$, there should not be a contradiction in the final step because an appropriate TM $K$ should r... |
For the sake of simplicity, lets say I have a bunch of 2d points, each have X and Y. The points are distributed somewhat randomly but not completely, they will be biased to be closer to the world center (where ever that might be, completely random) and they are likely to have some kind of a shape. You can imagine that ... |
There is a similar question that has been asked, but my question addresses particular detail of an answer.
I am trying to reduce SUBSET-SUM to SET-PARTITION. I found the following description:
SUBSET-SUM is defined as follows: Given a set X of integers and a target number t, find a subset Y from X such that the members... |
Well, my question is simple, I would like to compute the complexity time of an algorithm related to image processing.
I simplified the algorithm ... so that we focus only on the problematic part.
Algorithm
You have an image/matrix of $N =n \times m$ size and a block of size $b \times b$ (block is just a window or rec... |
Old algorithm textbooks often covered algorithms that did well on tape drives, since tape drives used to be a common storage type on almost all computers. Since memory on modern CPUs with data prefetching is starting to more and more resemble a tape drive, I was wondering if there used to be some "canonical" books/pape... |
There's a line from (x1,y1) to (x2,y2) in a grid of squares of unit length. Write a program to
compute the number of squares which are intersected by the line internally, i.e squares which are
only touched by the line should not be counted.
Notes
x1,y1,x2,y2 are all integers.
0 <= x1,y1,x2,y2 <= 10000
Write the prog... |
I have a graph of a large number of targets. Each target depends on a list of other targets. The graph is very large and filled with cycles of dependencies.
My goal is to find the smallest subset of targets that, if I remove all of their dependencies, breaks all of the cycles, leaving me with a buildable dependency tre... |
Assignment question
For algorithm APPROX-SUBSET-SUM, prove by induction on $i$ that for every element $y \in P_i$ that is at most the target sum $T$, there is a $z \in L_i$ such that
$$\frac{y}{(1+\frac{\epsilon}{2n})^i} \leq z \leq y$$
Here $\epsilon$ is the relative error bound, $P_i$ is the set of all subset sums of... |
$L_4 = \{ w | w \text{ does not contain symbol a immediately followed by symbol b} \} $
where: $ \Sigma = \{ a, b, c \} $
So far I believe I have a defined regular grammar for this language, however I am having trouble coming up with an equivalent regular expression.
$<Language\_4> ::= a <AOrC> $
$<Language\_4> ::= b <... |
I'm reading The Art of Multiprocessor Programming and am currently trying to understand Chapter 4 — The Foundations of Shared Memory.
In section 4.2 it is shown how to build a multi-reader, single-writer (MRSW) safe Boolean register from a single-reader, single-writer (SRSW) safe Boolean register. So, the only differen... |
Suppose I have an Image $I$ of $n\times m$ (or a matrix), I would like to compute its histograms in a loop.
Pseudocode:
for i=1:s1:n
h = hist(I(i:i+s1,m),bins)
end
$I$ is a matrix (or an image of data). When we say, $I(i:i+s1,m)$ we take the block of the matrix that starts in row from $i$ to $i+s1$ and have... |
I didn't understand some things about $ P/POLY$ class, and I will be thankful if you could help me.
as I learned in class,
a turing machine M accepts language L with advice $ {a_n} $ if
$\qquad\displaystyle M(x, a_{|x|} ) = 1 \iff x \in L$.
Does it mean that M with the advice decides L (halts on every input)?
or reco... |
On the Sorting Algorithms website, the following claim is made:
The ideal sorting algorithm would have the following properties:
Stable: Equal keys aren't reordered.
Operates in place, requiring $O(1)$ extra space.
Worst-case $O(n\cdot\lg(n))$ key comparisons.
Worst-case $O(n)$ swaps.
Adaptive: Speeds up to $O(n)$ wh... |
I'm given a graph $G = (V, E)$ with $|V| = N$ and $|E| = m \ge N^{1+c}$ edges for some constant $c >0$. $G$ is called a $c$-dense graph.
Karloff [1, p.6] has given a map-reduce algorithm called "Finding an MST of a Dense Graph Using Map-Reduce" which finds an MST of $G$ by randomly partitioning the vertices int... |
Given a random graph on $n$ vertices where each edge is included with probability $1/2$. Lets call it $G=(n,1/2)$. How can we show that the probability that this graph has a stable set of size at least $2\lceil \log n\rceil$ is sub-constant?
|
I've read and been told way too many times that functional algorithms and data structures have an obligatory O(log(N)) slowdown in respect to their procedural (for-loop/array-based) counterparts. But, after thinking about it, I don't see how that could be true. Mind this for loop
int arbitrary_sum(int* arr, int size, i... |
Right now, I'm working on a computer verified proof in Agda, showing that the Parikh images of regular languages are semi-linear (i.e. a limited form of Parikh's Theorem).
Right now, I'm trying to construct the equivalent of *-closure for a linear set. (Once I have this, it's easy to find for semi-linear sets).
More fo... |
I'm working on this project for an oil and gas company. One of the main features is a visualization of their pipe network.
I'm trying to create a tree of all possible paths. The only limit I have to avoid circular loops and that
the six valves just below the A,B,C,H,G,F,E,F tanks are one way only, e.g. the oil can't ... |
A heap sorted by levels is a heap which:
Every parent is smaller than its children.
The nodes in each level are sorted from the smallest to the greatest.
I need to describe an algorithm with $O(n)$ runtime that prints the values in the heap in sorted order.
I only manage to do it in $O(n \log(\log n))$ using another... |
I have been analyzing an algorithm for several hours in order to find out why it is expressed as $O(n)$ (I saw this solution in a PowerPoint presentation which refers to it as a linear algorithm). I see a while loop inside a for loop.
The for loop executes $n$ times.
The while loop executes "at most" $n$ times $(0, 1... |
Random walks are well known from probability theory. I have the idea for hash walks. If h(x) is a hash function and a,b,c,d,e,f is a boolean sequence then the sort of hash walk I am talking about is h(x+a), h(h(x+a)+b), h(h(h(x+a)+b)+c),....
At each step in the hash walk there are only two possible next states. If t... |
The RPN expressions
a b + c *
and
f d e + *
are algebraically equivalent, though the names of the variables are different and the order of evaluation is slightly different. The expressions
a b * c +
a b * c *
though they have the same length and number of variables as the first expression, are not algebraically equ... |
I'm working through Elements of Programming Interviews as practice for finding a job. I've spent a ridiculous amount of time on Problem 18.7.
In the gas-up problem, $n$ cities are arranged on a circular road. You
need to visit all of the $n$ cities and come back to the starting
city. A certain amount of gas is ava... |
I stumbled across this paper from Ball et al.
In their paper they assign specific values to the edges of a graph. When the graph is traversed, or lets call it executed (since they talk about control flow graphs of programs), these values are summed up. Afterwards they are able to reconstruct the executed path from the ... |
In the paper
Quick Detection of Brain Tumors and Edemas: A Bounding Box Method
Using Symmetry, Saha et al
the authors claim that the running time of the algorithm (Matlab implementation) is $O(h)$. I don't understand how they arrive at this.
The algorithm works as follows:
The algorithm does a vertical sweep of a who... |
Youtube recently added a feature called autoplay, where each clip is assigned a (presumably related) clip that follows it. This, in effect, defines a directed graph on the set of youtube clips, where each vertex has outdegree 1. The user starts at a vertex of his choice and takes a walk along this graph.
This got me th... |
I'm trying to solve an interesting problem. Imagine a square surface, onto which we spray randomly $p$ points. We also (randomly) place $c$ circle centres. I'm trying to find an algorithm that will allow me to find the radii for the circles that cover as many points as possible, subject to the constraints that:
the ra... |
I am a new learner to Background Subtraction (Background Modeling) and I am reading a few previous works on how it is performed. Starting with Wikipedia (by searching "Background Subtraction"), I could understand the first few simple methods, until the part "Running Gaussian average". I simply have no idea why a Gaussi... |
From my readings about Operating Systems (reading the basic material on Wikipedia, tech sites, etc) I've learned that the Operating System is a program that allows programs and applications to interact with the hardware in an efficient and safe way.
However I'm confused about how the Operating System oversees the compu... |
Suppose that the input graph $G$ does not have any negative cycles but however it is permitted to contain edges having negative weight. Let $s$ be the source vertex.
How do I prove that for every vertex $v$ in $G$, there is a shortest $s-v$ path with $<= n - 1$ edges?
Where $n$ is the number of vertices in $G$.
|
prove that in algorithm insertionsort, for successively considered element a[i] there is equal probablity that element will be inserted in one of i positions:
a[1] <= a[2] <= ... <= a[i-1]
To my eye it is obvious and I can't prove it. What is your opinion ?
|
Lets say $G$ is complete undirected graph with a set of edges coloured either black or red. The problem is to find an algorithm answering if it is possible to remove a subset of nodes from $G$ in a way such that all black edges are gone, but for any two nodes in the set of removed nodes there was no red edge between th... |
I have a file containing a subset of possible strings from a context free language. I am looking for a mechanism to induce the grammar from this information. Is that possible?
|
Given a binary heap $H$, indexed in $[1..n]$, whose elements are integers, is there a way to quickly find its median in $O(\log n)$-time?
|
I have to compute the space complexity of this function:
double foo(int n){
int i;
double sum;
if(n==0) return 1.0;
else
for(i=0;i<n;i++)
sum+= foo(i);
return sum
}
What I have done:
When function is called, the activation record is created on the call stack. For $foo(... |
I have recently stumbled upon the following interesting article which claims to efficiently compress random data sets by always more than 50%, regardless of the type and format of the data.
Basically it uses prime numbers to uniquely construct a representation of 4-byte data chunks which are easy to decompress given th... |
In a set associative cache (in this case 4-way) what happens when you try to read an entry with e.g. the tag 0x3B and this tag appears two times within the same set. Given the first is invalid, would you search on for the second (which is valid) or simply get a miss? And why do would there be a duplicate line at all?
|
Is there any way to prove that an admissible heuristic may not be consistent?
Most proof I came across are through examples .Is there a generalized proof?
|
The following are the Pages-96 and Page-97 of the book Schaum's outline series of Computer Graphics.
The algorithm considers several things:
(1) Whether the polygon is Convex or Concave.
(2) Whether the polygon is positively or negatively oriented.
(3) And, finally, testing polygon edges against the edges of the clippi... |
i have to write an exam in a course given by one of the contributing professors of this paper: http://www-db.in.tum.de/~leis/papers/ART.pdf
Of course this could also be a possible topic in the exam. Now i understand the basic advantages and structure of this tree, but i just cannot fathom some details. Maybe someone he... |
I had an algorithm with time-complexity of $O(h\times w)$, knowing $h$ is the height and $w$ is the width of an image being processed (or a simple matrix of size $h\times w$).
I managed to reduce the range that the algorithm process. So rather than dealing with $h\times w$ elements, it is dealing with $n\times m$ eleme... |
Given a set of (propositional) formulae $\Phi$, two formulae $\phi$ and $\xi$, determine whether there exists $\Psi\subseteq \Phi$ such that $\Psi\models \phi$ and $\Psi\not\models \xi$.
Question: what is the (theoretical) complexity of this problem? Is it in DP?
|
I am a M.Sc. student in computer science, working on information networks and recommender systems. This days when I went through the top-tier conferences papers in the field I have seen most of them use solely simple machine learning tools such as generalized linear model, Expectation Maximization, Maximum Likelihood, ... |
I read that overflow is more frequent when we work with normalised mantissas. Why is this? Is it because when we adopt a normalised representation, our range is smaller than in a unnormalised representation?
Source: I read this in: Hwang, K. Computer arithmetic. John Wiley & sons, 1979. Chapter 10 "Advanced topics on ... |
This question refers to this paper: Using Free Energies to Represent Q-values in a Multiagent Reinforcement Learning Task
In section 2.1, equations (5) and (6), I am wondering which Q values are being used to adjust the weights of the restricted boltzmann machine:
Option 1: the Q values generated by the original MDP
Op... |
Could a Universal Turing machine be set up so that it is able to 'reprogram' itself to 'behave' like any specific Turing machine without using some 'outside' source of info to cause it to do this?
|
What am I doing?
I have been digging more and more and googling more than often finding very small amount of results
I am trying to make a RAM testing program that can do memory testing with the ability to detect most RAM problems, I am making this app because I want to add networking functionality to it so all of the ... |
Let $G=(N,E)$ be a undirected graph of nodes $N$ and edges $E$. Each node $n \in N$ has a weight $w(n)$. The weight of a graph is defined as the sum of the weights of its nodes, i.e., by $w(G) = \sum_{n \in N}w(n)$. The connectivity of the graph is defined to be $c(G) = \#E_G / (\#N_G \cdot (\#N_G - 1)/2)$ -- this me... |
Suppose I have an algorithm $F$ that, given a numeric input $x$, generates an infinite sequence of numbers that converges to a $f(x)$, where $f$ is some continuous real-valued function.
Similarly, I have an algorithm $G$ that, given a numeric input $y$, generates an infinite sequence of numbers that converges to $g(y)$... |
I just learned about the Inverted Page Table and immediately thought about the chaining model used.
If two processes use the same virtual address, resolving the address will have to include following the chaining information in the table.
If all memory addresses were used uniformly, that should not be a problem, since... |
I need to use a data structure, implementable in C++, that can do basic operations, such as lookup, insertion and deletion, in constant time. I, however, also need to be able to find the maximum value in constant time.
This data structure should probably be sorted to find the maximum values and I have looked into red-b... |
I have a bunch of boolean conditions, let's call them A, B, C, D, ....
In my code, I need to use these conditions to distinguish between several different possible scenarios. For example, I could have something like this (in pseudo code):
if ((A and B) or not (C or D)) then process case 1
if (A and (not B) and (C or D)... |
Obviously, if you have 2 GPUs, it is double the hardware, and thus it should be double the power of a single GPU (assuming all GPUs are the same, of course). So why is this not the case? I searched this question on Google and things about optimization and things came up, but I still don't understand.
|
I have the following question for the travelling salesman problem:
The TSP algorithm is to find a complete hamilton cycle with minimum cost in a weighted graph G. Instead of the traingle inequality, the weight function satisfies the following inequality:
cost(u,w) < cost(u,v) + 2 x cost(v,w)
Find the approximation rat... |
Suppose there's an entity which produces files. User A has one of those files and decides to send it to user B.
How can user B validate the authenticity of the file without communicating with the producer? Is it even possible?
|
From an initial set $S$ of 2D points, how to efficiently compute a minimum(-size) dominating subset $M$ ?
$M$ is a dominating subset of $S$ if for any $(x,y)$ in $S$ there is at least one point (a,b) in M such that $x \le a$ and $y \le b$
Another related question: is any minimal set also minimum?
It is trivial to find ... |
In the context of rule-based systems, is forward chaining more efficient than backward chaining?
I know that forward chaining is used when we know some facts and from there we want to conclude some new facts. For backward chaining we use it when we want to assert a particular hypothesis. Is forward chaining faster or m... |
We have $10^5$ fractions: $\frac{p}{2^q}$ such that $0 \leq p,q \leq 10$.
Find (fast) algorithm which sorts them.
I ask you to look at my proposition and tell me your ideas. $\frac{p}{q}$ is represented as the ordered pair $(p, q)$.
On input we have an array a.
My idea:
for i = 1 to n
do t[i] = a[i].first * 2^(10... |
This is the problem:
Merge two sorted series of numbers. Their lengths are $n$ and $m$, respectively, but $n \gg m$. Your algoritm should take $O(m \log(n/m))$
comparisons.
I have come up with this algorithm:
1. Choose n/m "special" elements among n elements.
2. for i = 1 to m do
2.1 Using binary search find ... |
Assume I have a polygon chain implementation which is backed by a key-value store which stores the position of a point inside the chain as key and the point itself as value. So a polygon chain of the points $p_1\rightarrow p_2\rightarrow p_3$ is stored as $\{0\Rightarrow p_1,1\Rightarrow p_2,2\Rightarrow p_3\}$. The ke... |
A question in my algorithms text-book requires that we,
Describe an efficient $(1 - \frac{1}{k})$ -approximation algorithm for this
problem.
It is my understanding that $(1 - \frac{1}{k})$ being $p(n)$ is the approximation ratio and that an approximate solution differs from an optimal solution by a factor of $p(n)$... |
Is there any algorithm that finds the common edges and vertices between two graphs? Its not a common subgraph problem though, the edges which are common between the two graphs may not be connected to each other, may be far apart. How to find all the common edges in the graph? Like finding the common subgraphs between t... |
I am looking for the minimal size of a context-free grammar which defines the finite language $$L_n=\{a^k\mid 1\le k\le n\}.$$
The size of a grammar is defined as the total length of all right-hand sides of the rules.
For example a grammar with
$$S\to A_1A_1\\A_1\to A_2A_2\\A_2\to A_3A_3\\A_3\to A_4A_4\\A_4\to aa$$
has... |
I know that sometimes we can use absolute values into the objective functions or constraints. Is it always possible to use them, anywhere ?
Example of use of absolute values:
Minimize |a+b+c| + |a-c| s.t.
|a| + b > 3
| |a| - |b| | <= 5
| |b| - 3 | = 0
|
I am a beginner in the topic of algorithms. I have a query about Greedy Algorithms.
From what I understand, if there is a function and we are supposed to find its maxima/minima, if we find the local maxima/minima, we become 'greedy' and declare that as the global maxima/minima.
I suppose that is wrong?
|
Is there an example of a particular ruleset for a Markov algorithm that is Turing-complete? If so, what is the simplest example of such a ruleset?
|
Suppose I'm doing a large number of pseudo-random but deterministic experiments, where each experiment requires generating several random numbers.
I'm approaching this by having each experiment use a random number generator seeded with a random-looking seed - e.g. hash of the index of the experiment. This is especially... |
In a simple architecture(not considering parallel architecture) how exactly this can be performed in a single clock cycle:
P:R1 <- R2, R2 <-R1
where R1 and R2 are registers and P is a control variable.
I do not exactly understand when does this microoperation gets completed on the rising edge of the beginning of the cy... |
I'm looking for research that has been done towards finding types of computations that take the same exact amount of time to run, regardless the amount of computing power one has.
I've been thinking about also computations that might require external factors - for example being able to hash tomorrow's newspaper is a t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.