instruction stringlengths 35 29.1k |
|---|
I want a queue like data structure in which a new element inserted has to be some elements away from a related element.
While reading from this data structure, related elements should only be read after some time.
Suppose X is inserted. Then Y which is related to X should only be inserted at a position which is k eleme... |
I'm struggling to understand this factorial algorithm.
Falling(n, m):
if m = 0
return 1
if m = 1
return n
return Falling(n, floor(m/2))*
Falling(n - floor(m/2), ceil(m/2))
The algorithm should compute $n!/(n-m)!$
I'm analyzing it in the case of n = m, i.e it returns n! Now I'm g... |
I seem to be having trouble understanding the connection between the formal definition of co-NP and how problems are concluded to be in it. co-NP is defined to be the class containing the languages that are complements to languages in NP (I'm using this definition).
So, given this problem: "given a finite set of integ... |
This was a question given in a course, without answer. The referenced literature (just a few books) do not cover it, unfortunately.
I think there is no relation with the range as the range of the Halting problem is {0,1} and the range of the successor function is infinite. But I feel like I'm missing some subtleties he... |
First off, I should mention that I am a new contributor on this site and as such, please bear with me if this has been asked and answered before. I searched to the best of my ability to find similar questions and didn't find any.
The Question
Consider the definition of a deterministic finite automaton given below:
A d... |
I have a problem I've been dealing for the past few days, and I'm pretty stuck.
Each user has a schedule for a given week, such as Mondays 9:00-12:00 and 14:00-18:00, Tuesdays... and so on. Each provider has another schedule for himself.
The problem is: Get the best k (different) solutions such that each solution assig... |
why is this Problem$$L = \{ \langle M\rangle \mid L(M) \text{ is undecidable}\}$$ undecidable?
I thought if we know $L(M)$ the turingmaschine accepts all $x \in L(M)$, so $L(M)$ is in every case decidable and $L=\emptyset$ especially finite and decidable.
I know we cannot find an algorithm but every TM has a language a... |
Problem
Given a range of integers $\{a,a+1,...,b-1,b\}$, find a subset of size $k$ such that the sum is equal to $s$.
Question
This problem came from evaluating some scheduling algorithms that I am interested in optimizing for some small home grown useless embedded system I am playing with. My problem is that I do not ... |
Would the intersection of a recursive language and a recursively enumarable language be recursive or recurisvely enumbarable or neither?
Assume $L_{3}$ is the intersection of some language $L_{1}$ $\epsilon$ RE and some other language $L_{2}$ $\epsilon$ REC .
Since $L_{2}$ $\epsilon$ REC, there must be a Turing-Machin... |
I'm on the Wikipedia page for Hindley-Milner type systems, on the section about "let polymorphism": https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system#Let-polymorphism
I'm a bit confused on this sentence:
Ideally, this would be allowed with any use of a bound variable
What does that mean exactly? I'm no... |
I’ve searched around for this already but ironically the results have been overshadowed by “Why C was named C” instead.
If C was named “C” because it came after B, why was B named "B", since the only languages preceding B were FORTRAN and Plankalkül?
Is it possible naming B - “B” was a play on “Assembly” abbreviated - ... |
It is well known that the Kolmogorov complexity is uncomputable in Turing-complete programming languages. However, what about total programming languages?
For example, is the Kolmogorov complexity of natural numbers computable if we work in Gödel's System T? (I suppose not, but I don't have a proof.) Furthermore, is it... |
If I show that a language $L$ is contained in $\textbf{P}$ and $\textbf{NP}$ and I know that the language is $\textbf{NP}$-complete, why did I proof that $\textbf{P} = \textbf{NP}$?
|
The function $\mathrm{INDEX}:\{0,1\}^n\times\{1,\dots,n\}\to \{0,1\}$ is defined as
$$\mathrm{INDEX}(x,i)=x_i,$$
where $x=x_1\dots x_n$. I am looking for the randomized communication complexity of $\mathrm{INDEX}$ for an arbitrary number of rounds.
Somehow, I do not manage to find it in the literature.
The deterministi... |
I came across following problem:
If the CFG is left factored then it must be Unambiguous and Not left Recursive.
TRUE/FALSE?
I have many thoughts about this. But I feel they are somewhat contradicting and hence form a bigger doubt. May be I lack some understanding.
Thought 1
Ambiguity has nothing to do with determi... |
The problem is the following:
Give an example of a graph that has a unique minimum spanning tree but for every cut of the graph, there is not a unique light edge crossing the cut.
I am trying to find such a graph, but I have not find any example. Is it possible to have such a graph? If not, why?
|
Suppose you have 1. a grammar for terms of a language; 2. type-assignment rules, 3. a set of reduction rules. You want to prove that your language is adequate for mathematical reasoning. If I understand correctly, the right way to do it is to develop a semantics for it, and then prove certain desirable properties such ... |
Egg drop. Suppose that you have an $n$-story building (with floors 1 through $n$) and plenty of eggs. An egg breaks if it is dropped from floor $T$ or higher, and does not break otherwise. Your goal is to devise a strategy to determine the value of $T$ given the following limitations on the number of eggs and tosses:
... |
Preface: This is not an attempted proof at P vs NP
Starting with some CNF Boolean expression ϕ, by the rules of logical disjunction, a clause is only unsatisfied if each of the literals in it are themselves forced into being unsatisfied. A trivial example is (x OR y) with the interpretation XY=00. Non-trivially, we can... |
This may be a silly question, but if a computer works in binary how can you encript numbers using decimal?
|
we know the performance of Dijkstra's algorithm with binary heap is O(log |V |) for delete_min, O(log |V |) for insert/ decrease_key, so the overall run time is O((|V|+|E|)log|V|).
Now let's modify the Dijkstra to stop once it reaches T (Destination) from S(Start). The given performance is:
Understand that we don't ne... |
Is there any existing work done on finding paths that are geometrically straight?
I encountered a problem where I'd need to find the longest straight(-ish) path in a web of connected nodes, each of which has a defined position in euclidean space (they're taken from a picture). Specifically, I want to find all straight... |
My whole life I thought
a collision is a situation that occurs when two distinct pieces of data have the same hash value.
Everything looks a little bit different now: A few days ago we had to analyse common collision resolution strategies to handle the event that at least two keys being hashed to the same slot of an... |
Let PARTITION-INTO-THREE-SETS be defined as following:
Input: Positive integers $a_1, ..., a_n$
Problem: Are there three pairwise disjoint sets $I, J, K \subseteq \{1, ..., n\}$ with $I \cup J \cup K = \{1, ..., n\}$, so that $\sum_{i \in I}{a_i} = \sum_{j \in J}{a_j} = \sum_{k \in K}{a_k}$?
It's easy to show, that PAR... |
" How long will it take for 2 jobs to complete if they're running in parallel, knowing that both have a total of 20 minutes of CPU usage time and 50% IO"
I calculated the CPU usage: 1-0.5²=75%.
To my understanding, if they're running sequentially, time needed to completion is 80 minutes (each job needs 40 minutes to co... |
I am trying to polynomial-time reduce the decision version of vertex cover to the decision version of binary programming. Here are the problem statements.
Vertex Cover Decision Problem
Instance: A graph $G=(V,E)$ and an integer $k$.
Question: Does $G$ have a vertex cover of size at most $k$?
Binary Programming Decisio... |
For RDBMS viz. MySql, PostgreSql a common solution for scalability and high availability is to run a primary instance as master that is a read-write instance and one or more read replicas. If the master fails, a failover happens and one of the read replicas become the master. The problem happens, when a network partiti... |
Reading the book of Dasgupta-Papadimitriou-Vazirani.pdf about the performance of Dijkstra's algorithm on Page 118, we are given:
4.4.3 Running time
At the level of abstraction of Figure 4.8, Dijkstra's algorithm is structurally identical to breadth-first search. However, it is slower because the priority queue primit... |
I have read few research papers in which given a graph $G$ where $V$ denotes its vertex set and $E$ denotes its edge set. Model of computation is word RAM. "Without loss of generality assume that vertices are numbered from $1$ to $n$"
Question : How to justify the above mentioned assumption? I am not getting why this a... |
What does Grover's algorithm output when the desired element is absent from the database? Since there will be no phase inversion, how exactly will the probabilities work?
|
It can be shown that every graph G has at most $\binom{n}{2}$ min-cuts.
It follows from Karger’s algorithm Analysis.
Is there a different combinatorial proof of this fact? Was this known before Karger’s paper?
|
I need SAT instances, involving 9 to 20 variables. They need to be hard to solve for humans. Both SAT and UNSAT instances are needed.
I tried random-SAT generators on the web, but the results were not satisfactory because they are trivial. A good example of what I'm looking for is the following 4-variable instance from... |
I was hoping someone could help me in understanding how to achieve a DFA here. The question is how I would create a DFA that accepts unsigned decimal integers whose digits are in non-decreasing order, such as 1234, 1589? The numbers can't start with 0.
|
In CLRS, in the later part of breadth first search topic, for unweighted graphs, it says:
At the beginning of this section, we claimed that breadth-first search finds the distance to each reachable vertex in a graph $G=(V,E)$ from a given source vertex
$s \in V$ . Define the shortest-path distance $\delta(s,v)$ from... |
How can I construct a PDA which accepts the language
$\{a^ib^j \mid 0 \leq j \leq 2i\}$?
|
Recap to the Johnson's shortest path algorithm:
By the procedure extending the original graph $G^\prime = (V^\prime, E^\prime), V^\prime = V\ \cup \{s\}, E^\prime = E\ \cup \{(s, v)\ |\ \forall v \in V\}$, and then extend the original weighting function $\forall x \in V,\ w(s, x) = 0.$
Finally define the reweighted fun... |
Let $L= \{\langle M \rangle \mid M \text{ halts on } \langle M \rangle \} $
be a language where $\langle M \rangle$ is the Code of the TM $M$. $L$ is undecidable.
I've heard that I can't use Rice's theorem to proof its undecidability.
But why? I can construct a set $S = \{f_M \mid f_M(\langle M \rangle)\in \{0,1\}\}$.... |
If SAT can be decided in polynomial time, is it clear that Min-ones SAT can be decided in polynomial time? The idea I had was to take a poly decider of SAT and try it on a formula OR'd with all settings of the variables with exactly $k$ ones. If it is satisfiable for $k = 1$, then we know the Min-ones SAT on the formul... |
C++ templates have type variables and can express lambdas, so they must have System F embedded. But is that exactly where they are located in the lambda cube? Can C++ templates produce new types or express dependent types?
(I originally posted this to Stack Overflow, but they referred me over to here.)
|
For example, consider an AVL tree:
Performing the two_close(T) should give back (13, 12), as they are the closest elements together. Said another way, you can take any two other elements in the tree, and their absolute difference will always be greater or equal to that of the result:
$|c_1-c_2|\leq |o_1-o_2|$, where $... |
I'm studying about Cook-Levin theorem but there is a problem I faced. Cook-Levin theorem shows that any NPTM can be encoded as a boolean formula. About given language $A$, instance $w$, and NPTM $M$ that decides $A$, I understand that when a boolean formula $φ$ is true when $M$ accepts $w$ and false when $M$ rejects $w... |
Min-ones SAT is apparently NP-complete. I get that it is NP-hard (because SAT is trivially reduced in polynomial time to it), but I don't actually see how minimality can be verified in polynomial time.
Thus, my question: why is Min-Ones SAT in NP?
|
The problem is as follows: design DFA over an alphabet {a,b}, that accepts a language: L = {$xwx^R$ | $x \in \{a,b\}^+, w \in \{a,b\}^+$}
I have no idea how to remember the first word to be able to detect a reverse of it. I will appreciate any help.
|
Suppose we have an $n\times n$ zero/one matrix $M$, with $k$ ones. Let us say that the extent of $M$ is the maximum of $i+j$ over all ones at positions $(i,j)$ of the matrix, and the quality $q(M)$ is the minimum of the extent of $PMQ$ taken over all permutation matrices $P$ and $Q$. Let $f(n,k)$ be the maximum of $q(M... |
Given a set of strictly positive numbers $a_1, ..., a_n$, the problem is to determine if $\lfloor n/2 \rfloor$ different indexes $i_1, ..., i_{\lfloor n/2 \rfloor}$ exist so that $$\frac{a_{i_j}}{a_{i_{j-1}}} = \frac{a_{i_{j+1}}}{a_{i_j}}$$ for $2 \leq j \leq \lfloor n/2 \rfloor$.
How to show that this problem is in co... |
As an outsider, it sounds like a lot of progress has been made on understanding rank 1 elliptic curves. Much of the BSD conjecture is known for rank 1, and Heegner points provide a way to calculate a rational point of infinite order on the curve.
However, as an outsider, it is hard to understand what properties are fe... |
I'm undertaking Theory of Computation Classes. I came across this sentence while studying Recursively Enumerable Grammar:
Type-0 grammars generate recursively enumerable languages. The
productions have no restrictions. They are any phrase structure grammar
including all formal grammars.
What is difference betwee... |
Example: Finding an element from a sorted array
Let's say we have an algorithm that accepts a sorted array of length N as its input. Then in each iteration it randomly selects an element from the array and performs the following operation:
if (value == A[randomIndex])
// element found
else if (value < A[randomIndex]... |
I'm currently reading a book about artificial intelligence and i frequently come across the concept of universal computers, as it is essential to understand the book i would like to know the meaning of author's statement referring to Turning's paper of 1936:
If a type of computer can perform a certain bare minimum se... |
I studied Computer Architecture from David A. Patterson and have came across the idea of Response time.
Response time also called Execution time. The total time required for the computer to complete a task, including disk accesses, memory accesses, I/O activities, operating system overhead, CPU execution time, and so... |
I am working on this paper titled “the microarchitecture of superscalar processors by Smith and Sohi” and it says that there are 3 methods of organizing instruction queue. I know that the method “Multiple queues” is the same as the method “Scoreboard” and also the method “Multiple reservation stations” is the same as t... |
When we do register renaming to avoid WAR and WAW hazards while executing instructions, how can we know that there is no need for a physical register anymore and we can put it back in the free list?
|
I know all computable partial functions are countable. Wondering if it is the the other way around as well.
|
There are two operations as follows:
insert(num): insert num into the data structure.
find(sum): return a pair(a, b) such that a + b = sum, if no such pair exists return -1
How such data structure could be designed, possibly with find $\in o(N)$ and insert $\in o(\log N)$ operations?
|
Given a context-free grammar $G$, how can one systematically construct a grammar $G_k$ such that
$$ L(G_k) = \{w \in \Sigma^* : |\text{Pref}(w) \cap L(G)| = k\} $$
where $\text{Pref}(w)$ is the set of $|w|+1$ prefixes of $w$? Assume $G$ is unambiguous, if needed.
|
While watching a sports tournament, I noticed that the tournament tree looks a lot like a heap. I came up with the following data structure: A complete binary tree where the leaves are elements of some set, and each internal node is the $\max$ of its two children. I came up with a BuildHeap algorithm that's $O(n)$, a G... |
Consider the algorithm findMax that finds the maximum entry in an integer array.
Algorithm findMax($A$)
Input: An integer array $A$
Output: The maximum entry of $A$
1. m <- A[0]
2. for i <- 1 to A.length - 1 do
3. if A[i] > m then
4. m <- A[i]
5. return m
Show that there are constants $c_1,d_1,c_2... |
The universal approximation theorem states that a feed-forward network with a single hidden layer containing a finite number of neurons can approximate continuous functions on compact subsets of Rn, under mild assumptions on the activation function.
How many neurons is needed? For a function in 3 variables and one outp... |
As an example, here are all possible trees for the case $k=3$:
On each node written is its arity (= the number of children).
While this should be solvable by dynamic programming, I think there was a combinatoric result on this (either exact or a rather fine grained upper bound). Does anybody know it?
Edit:
The size ... |
The question is in context to multilevel page table. I was trying to solve numerical on multi-level paging and noticed that page size might not be same at all levels. I came across the point "Outer level page tables need not be page aligned to inner page tables".
Question 1: Does this mean that outer level page tables... |
Will a study of the mathematical proof of a (data structure and algorithm based) problem, when posed as a proposition, highlight peculiar properties of the problem which may help in designing an optimal algorithm?
I think that proofs should yield interesting insights, and therefore can be used in designing algorithms.... |
The algorithm take in an integer $n$ and outputs the $n$th number in the Fibonacci sequence ($F_n$). The sequence starts with $F_0$. I am trying to prove the correctness assuming valid input:
int Fib(int n) {
int i = 0;
int j = 1;
int k = 1;
int m = n;
while(m >= 3){
m = m-3;
i = j +... |
The Estrin model for polynomial of degree $n$ is well known. But the reading of the Knuth (vol 2) or the original's paper Estrin do not help (or I miss it). I am not able to determine the complexity of the algorithm for the number of multiplication. The main equation is:
$$
\begin{align}
c_i^{(0)} &= a_i + x_0 a_{i+1}... |
May a DFA recognize a language which is a proper subset of the set of all accepted inputs?
For instance, if there is a DFA which decides if an input $W$ has $w_0 = w_n$, can it recognize a language $L$ where there is some $\sigma \in \Sigma$ that does not exist in any element of $L$?
|
So, using Church numerals, we define
$3 = {\lambda} f. {\lambda}x.f(f(f(x)))$,
and
$4 = {\lambda} f. {\lambda}x.f(f(f(f(x))))$.
We can then add with an expression like
$3\ g\ (4\ g\ z)$
And this reduces to:
$(g (g (g (g (g (g (g\ z)))))))$
... but why?
$g$ is a free variable in each expression, and my understanding is... |
This is really a second part to my first question, but I felt that this was different enough from the first part that it merited its own question.
So, using Church numerals, we define
$3 = {\lambda} f. {\lambda}x.f(f(f(x)))$,
and
$4 = {\lambda} f. {\lambda}x.f(f(f(f(x))))$.
We can then add with an expression like
$3\ ... |
When deleting nodes from an R-tree, if a branch underflows, then it's meant to be dissolved and its children are meant to be reinserted into the tree. But most R-tree implementations that I've seen just keep the node until it's completely empty. Does this lead to unbalanced R-trees?
|
I'm trying to prove that for arbitrary $c > 0$,
$f(n) = o(n^c) \rightarrow \exists \epsilon > 0 \ s.t. f(n) = O(n^{c-\epsilon})$
Intuitively, this seems to be true to me (little-o implies some gap "between" $f(n)$ and $n^c$ that we can formally express as $\epsilon$). However, I'm having some trouble formalising this ... |
Prove that if $L, G$ are regular languages over $\{a,b,c\}$ then $H=\{w\in L|\exists x\in G: |x|=2\cdot |w|\}$ is a context-free language?
I think this could be a good exercise and the conditions are very simple.
Because $L,G$ are regular they have corresponding DFA's:
$$
L=\bigg(\sum,Q_1, q_{01,\delta_1, F_1}\bigg)... |
In the context of Upper bounds computaion and Big Oh Notation, I was wondering if the following could be proved... if they are equivalent.
$\mathcal{O}((log(n))^{-1}) = (\mathcal{O}(log(n)))^{-1}$
$\mathcal{O}((log(n))^{-1})$ can be rewritten as
$\mathcal{O}(1/(log(n)))$ which is
$\mathcal{O}(1)/ \mathcal{O}(log(n))$ ... |
I read that the mapping for user-space processes is changed after each process switch. By mapping I mean the translation from virtual addresses to "real" memory address. I thought that processes are loaded into RAM and are held there (that's what the RAM is for). So the addresses in "real" memory addresses shouldn't ch... |
I have a set of nodes and a function foo(u,v) that can determine whether two nodes are equal. By "equal" I mean transitive equivalence:
If 1==2 and 2==3 then 1==3 and also: If 1==2 and 1!=4 then 2!=4
When given a set of nodes I can find all connected components in the graph by passing every possible combination of nod... |
I wanted to know which implementation is better to find the root of the element in the Quick Union implementation of the UnionFind problem.
The professor has used a while loop to find the root of the element, while I have implemented it using a recursive approach.
Which approach is better in terms of space complexity,... |
I have proposed a load balancing algorithm for a group of homogeneous processing devices and now I want to measure the average waiting time to see if my algorithm is successful in decreasing the waiting time. I have considered number of tasks on each device as the load of that device.
Imagine at first there are 54 task... |
As I'm reading the movfuscator paper by Stephen Dolan, I encounter this claim:
In order to have Turing-completeness, we must allow for nontermination.
This seems like a reasonable statement. But I'm also aware of this work by Wouter Swierstra which aims to prove quite the opposite (as I see it): that one can simulate... |
Prove that if $L$ is regular over $\Sigma=\{0,1,2\}$ then the following language over $\{0,1,2,\$\}$ is also regular:
$$
G=\{\$x\$|\exists w\in L: x\text{ is derived from }w\text{ by substituting } 01 \text{ with }\$\$ \}
$$
For example, if $10112\in L$ then $\$1\$\$12\$\in G$.
I think this can be solved using cl... |
I'm looking at the name of a variant of the Stable Roommates Problem, when the rooms have more than 2 mates, ie for example 6 to 8. Does this problem has a specific name? A well-known algorithm?
To summarize, the problem is the following: Given a set of $n$ people, and a symetric $n\times n$ affinity matrix between eac... |
I have a graph $G$ with $m$ vertices $V$ and $n$ edges $E$. $G$ is weighted, directed, and cyclic. I want to select heaviest $k$ edges from $E$ such that all of the edges form a connected, undirected graph. Note that when selecting these edges, the graph is considered to be connected even when two vertices $v_1$ and $v... |
We have a function which takes an array as input. It breaks an array into $\log_2(n)$ parts with equal sizes where $n$ is the size of the subarray. It keeps breaking each of the subarrays until there are only two elements left in it. What is the depth of this recursion?
Example of the process:
First we have $n$ elemen... |
There's a story I've heard a few times in various computer science talks, usually offered as a cautionary tale, that goes something like this:
In the late 50s, the British gov't purchased an early computer, and tried to build a computer model of the gov'ts budget, including every variable and factor they could think o... |
I'm looking at this pdf for problems: http://www.public.asu.edu/~ccolbou/src/355hw5solf10.pdf
I found question 3g to construct a pushdown automata for the following:
{$ {a^i b^j}$ | ${i \neq j}$}
The solution they provided is below:
The issue is, when I use JFLAP to test out, I get aabb to pass - when it should just b... |
Consider the following decision problem:
Input: a set $X = \{x_1, \ldots, x_n\}$, a mapping $f \colon 2^X \mapsto \mathbb{N}$ such that for $f(Y)$ is computed in polynomial time for any $Y \subseteq X$, and an integer $k \in \mathbb{N}$.
Question: does $\sum_{Y \subseteq X}{f(Y)} \geq k$ hold?
Is this problem in the c... |
Are there conditions under which given text $T$ that huffman code and arithmetic code will produce the exact encoding of $T$?
|
I can calculate this by trying out manually inserting $n$ keys in $m$ order B Tree as follows:
Assume median to be selected for split be left biased. That is $m/2$. For example, if $m=4$, then a node [1,2,3,4] need to be split with 2 as a median and resulting in nodes [1] and [3,4]. So, we selected 2 as a median, wh... |
Let's say you want to get the value of all nodes in a binary tree (order doesn't really matter). If in each thread, you spawn two more threads to deal with the left subtree and the right subtree, then wouldn't the big O time complexity be O(log n). I was under the impression that you could never traverse an entire tree... |
I am working on some set theory and am trying to prove how a set can have the property $A^* = A$.
For set $A=\{0^n1^n \mid n \ge0\}$, I still do not understand exactly what $A^*$ is. For example, I thought $A^*$ is the enumeration of the set $A$ so
$A^* = \{\epsilon,01,0011,000111,00001111,....\}$
Any helping in at le... |
I am having trouble understanding the following statement.
I have understood why in a sensorless/conformant problem, if there exists a solution (a sequence of actions) for a belief state $b$, then it is also a solution for any $b'$ that is a subset $b$.
Next claim is what is confusing me.
Then in a standard graph searc... |
Given a list $C=[c_1,c_2,\dots,c_k]$ of positive integers, representing the values of $k$ varieties of coins, and a positive integer $n$, let $f(n,C)$ be the number of handfuls of coins with total value $n$. The order within the handful does not matter, and there is an infinite supply of each variety of coin.
What is... |
I was given this question and not sure how to solve this. This is a DP minimization problem ?
Problem :
There are N stations in a certain region, numbered 1 through N.
It takes di,j minutes to travel from Station i to Station j (1 \leq i, j \leq N)$.
Note that di,j=dj,i may not hold.
You are now at Station 1. From here... |
I've been looking over sorting algorithms for linked list and here's what I came up with.
As we know, for element access arrays will work better than linked list. Also, there is the benefit of elements being stored in consecutive memory locations: due to spatial locality of cache, arrays give better performance.
Thus f... |
How to solve this problem?
A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. A minimum vertex cover is a vertex cover with minimal cardinality.
Consider a set of all minimum vertex covers of a given bipartite graph. Your task is to divide all... |
This is a recreational problem, not sure if it is asked due to my limited knowledge in discrete math.
Suppose we have a connected graph (which can be seen as a "map"). We start at an initial vertex, and there is a destination vertex which we do not know, until we reach that vertex. The task is to find out the destinati... |
How can I calculate the number of cache lines per set or the cache size with the given information?
m (number of physical address bits): 32
C (cache size): unknown
B (Block size in bytes): 32
E (number of lines per set): unknown
S (number of cache sets): 32
t (tag bits): 22
s (set index bits): 5
b (block offset bits):... |
I have such a product example:
{
"color": ["red", "blue"],
"material": ["metal", "textile", "plastic"],
"options": ["handle", "wire", "bt"],
"textile": ["silk", "cotton"]
}
I need to know what algorithm can help me to produce all options possible for such product, f.e.:
{
"color": "red",
"material": "metal... |
Determine the asymptotic running time of the sorting algorithm maxSort.
Algorithm maxSort(A)
Input: An integer array A
Output: Array A sorted in non-decreasing order
1. for j <- n-1 down to 1 do
2. m <- 0
3. for i = 1 to j do
4. if A[i] > A[m] then m <- i
5. exchange A[m], A[j]
Can you say anythin... |
Since i don't have a CS background in my career,
Built up an openmpi compute platform which succesfully computes from a variable number of available nodes. call this whole, a mpi cluster having N^2 4-Core-CPU + 16-OpenCL-1.1-compute-cores with a reasonable compute power each node.
I have no experience in parallel opti... |
Let $L$ be a regular language over alphabet $\Sigma$. $L$ is the result of merging $2$ languages letter by letter that is for $a_1a_2...a_n\in L_1, b_1b_2...b_n\in L_2, L=a_1b_1a_2b_2...a_nb_n$. $\epsilon \in L \iff\epsilon \in L_1,L_2$. Does this mean that $L_1$ is necessarily regular?
At first I tried to prove that... |
Bachmair and Ganzinger 1991, 'Rewrite-Based Equational Theorem Proving With Selection and Simplification', specifies the criterion for using an equation as, by some appropriate ordering, u>v (after substitution, and assuming the terms can be ordered). Equivalently, !(u<=v), after substitution.
However, Schulz 2006, 'Al... |
int seq(int n)
{
if(n == 0 || n == 1)
return n;
return(seq(floor(n/2)) + seq(ceil(n/2));
}
Find the computational complexity of the above program.
I have tried doing it in the following way:
$$\begin{align*}
T(0) &= 1 \\
T(1) &= 1 \\
T(2) &= 2T(1) = 2 \\
T(3) &= T(1) + T(2) = 3 \\
T(4) &= 2T(2) = 4 \\
T... |
Given some finite set $S := \{x_1,x_2,\ldots,x_k\} \subset \mathbb R^n$ we can define a distance matrix $D = (d(i,j))_{ij}$ with $$d(i,j) = \Vert{x_i - x_j}\Vert$$
where $\Vert \cdot \Vert$ is the euclidean norm.
Is there an algorithm to determine the minimal $m$ just from $D$ such that there are $\{y_1,y_2,\ldots,y_k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.