instruction stringlengths 35 29.1k |
|---|
It is said that Church Numbers are encoded as following
c0 = λX. λs:X->X. λz:X. z;
c1 = λX. λs:X->X. λz:X. s z;
c2 = λX. λs:X->X. λz:X. s (s z);
c3 = λX. λs:X->X. λz:X. s (s (s z));
The church numbers are terms, right? but the terms are given by the following syntax.
t ::= terms... |
I haven't done much algorithm writing till now. I have a specific scenario and I am wondering which approach shall I take.
Scenario:
Let us suppose that
we have 4 guys (A,B,C,D)
We want to assign them a certain task whose duration varies from 40 mins - 1 hr 15 mins.
The task duration varies depending on the number ... |
Consider a 4-regular, finite, non-directed, integer-weighed graph $G$. Let each node carry an integer value indicating its distance from zero on a hypothetical axis $X$. Take a given node $N$ for which we know its distance from zero (either negative or positive) and the weights on the edges incident to it. Note, that f... |
I'm reading a book at the moment about logic gates and Boolean simplification. There is a part which I can't seem to follow.
I can easily work out that $A \vee (\neg A \wedge B) \equiv A \vee B$ using a truth table as it's easy to see.
However, I can't seem to turn $A \vee (\neg A \wedge B)$ into $A \vee B$ using step... |
I'm reading papers regarding microblog credibility perception of non-text cues.
Tweeting is believing? Understanding microblog credibility perceptions
by Morris et al., 2012
Microblog Credibility Perceptions: Comparing the United States and China
by Yang et al., 2013
However, Yang et al.[2013] refer to some cues, suc... |
I just stumbled upon this question here Why is the clique problem NP-complete?
and I am confused by the given answer.
The question about about whether $k$-clique is NP-hard for a fixed $k$ and the answer is no. However, we know that clique in general is NP-hard. Also we know that $0 \leq k \leq n$ must hold (for a gr... |
Are there any known upper/lower bounds on the size of a witness of some np-complete/hard problem, or more precisely the relation between the problem size and the witness size.
For example, I'm interested in subset sum, set cover, SAT, hamiltonian cycles. If there is something known for other problems, I'd also be inte... |
From a database theory point of view, what term can be used to refer to a key that does not violate the rules of the engine within which it is implemented, but fails to conform to any sort of normalisation? For instance, if a timestamp was used as a primary key. Primary keys are supposed to ensure that no two rows refe... |
In reference to this problem (equivalently, findind a maximal clique in an undirected graph), I believe greedy approach should work (i.e. removal of people who have maximal qualms with others.). Though I cannot prove that this would always work or won't but I intuitively felt that it should, but eventually some example... |
When I take a look at the proofs for pumping lemma, I have a feeling that I am often missing the intuition behind the condition |xy| ≤ p.
What exactly is the reason behind this condition? All the literature I have taken a look at are either silent (no proof, no discussion, only a statement) about this point, or state t... |
I have that language $S=\{a^n b^m c^m\mid n,m \geq 0\}$.
How can I prove with the pumping lemma that it isn't regular? Can I use the concatenation closure and say that it's the language $L_1 = \{a^n\mid n\geq0\}$ and $L_2 =\{b^m c^m\mid m \geq0\}$ prove that $L_2$ isnt regular so $L_1 L_2 = S$ is not regular too?
|
I designed an algorithm like this but I do not know how to perform its analysis to determine how it runs $($$O(n)$, $O(n^2)$, $O(log(n)$, $etc$$)$
m = some constant
for i = 1 to n
{
for j = 1 to m step 2
{
// do some stuff here
}
m = m - 2
}
Can you please provide a clue to solve my issue? This... |
Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes:
/* P1 */
while (true) {
wants1 = true;
while (wants2 == true);
/* Critical Section */
wants1 = false;
}
/* Remainder section */
/* P2 */
while (true) {
... |
I'm struggling to apply the theorems of natural deduction to these two examples.
$$((p \to q) \land (p \to \neg q)) \to \neg p$$
$$((p \to q) \land (p \to r)) \to (p \to (q \land r))$$
Can anyone help? That is, soundness and/or completeness.
|
So, I have two problems:
Minesweeper: given an undirected graph where some vertices have a whole number associated with them, check if there is a way to mark some of the non-numbered vertices such that the number in each numbered vertex is equal to the amount of its marked neighbours.
Dominating set: given an undirect... |
My reasoning is as follows.
Every boolean formula can be expressed as a sum-of-products.
Every sum-of-produts is a list of minterms.
For each minterm, there is 1 combination of inputs that satisfy the formula.
So if I have the sum-of-products representation of a boolean formula I can tell if it satisfiable.
But that ... |
It is quite direct to prove that $\lfloor{\sqrt{n}\rfloor} = O(\sqrt{n})$. But how can I prove that $\lfloor{\sqrt{n}\rfloor} = \Omega(\sqrt{n})$?
|
I am aware the convex hull algorithm known as Graham Scan can be computed by sorting the derived vectors from points given in a 2D plane. One then iterates through a series of Cross Product calculations to find the determinant of a pair of vectors derived from the sequence of given points. This determine whether to mov... |
Let $S(i,x_1,\ldots, x_n)$ be a primitive recursive predicate.
\begin{equation}
f(i_1,i_2,x_1,\ldots, x_n) =
\begin{cases}
1 &\text{ when for all i, }\; i_1 \le i \le i_2,\; S(i,x_1, \ldots, x_n)=1\\
0 &\text{ otherwise}
\end{cases}
\end{equation}
Show that $f(i_1,i_2,x_1,\ldots, x_n)$ is also primitive recurs... |
Given two large directed graphs (may have loops and lonely nodes) A and B. They are structurally similar.
If we give a node in Graph A, how to find the corresponding one in Graph B?
Finally, we need to find all the node mappings.
Of course, there can be more than one possible mapping. We need to find the similarity (ra... |
I think I can run Dijkstra's algorithm using any data structure. I do not see any implementation details of Dijkstra's algorithm.
Is a priority queue a possible data structure? Will running Dijkstra's algorithm using a priority queue reduce or increase the complexity? Will I overshoot the problem?
|
As I understand, evaluating something like the following in normal order evaluation is inefficient due to duplicate work:
double x = (x,x)
main = double some_hard_computation
I remember someone telling me
That there are two ways to avoid this: strictness analysis (to recognise that double is strict in its one arg... |
BFS and DFS can be achieved in O(|V| + |E|). I understand the proof but it seems a bit lengthy.
Can I argue O(|V| + |E|) in a very simply way? e.g. checking each edge at most once?
Also what does O(|V| + |E|) imply?
I know Dijstrka algorithm and many other algorithm is somewhat like BFS. Does it imply automatically... |
Background:
I have a dependency graph, i.e. a directed graph where the nodes are tasks and the edges are dependency relations. Moreover, nodes are assigned a weight since they take different amount of time to complete.
I have developed an algorithm that rearranges the graph by merging some nodes together that can be c... |
I was reading about the $\mathcal{O}(\frac{1}{\log n})$ approximation algorithm for the Unique Coverage Problem from these notes.
The gist of the algorithm is as follows:
Partition the elements into $\log n$ classes according to their degrees, i.e., the number of sets that cover the element. So class $i$ contains all... |
Given the values of $n, k, m$, you have to check if there are $m$ distinct numbers in the range from 1 to $k$ have the sum $n$ or not ?
$n$ represents the required sum
$k$ represents numbers range(1,2,3,... to k).
$m$ is the number of elements in the range from 1 to $k$ that has the sum $n$.
Example: n = 12, k = 8, m =... |
Question: Given an array of positive integers and a target total of X, find if there exists a contiguous subarray with sum = X
E.g: If array is [1, 3, 5, 18] and X = 8 Output: True, if X = 10, output is FALSE.
Approach I can think of is to expand sub-array window, until you hit an index such that sum of sub-array ==... |
In the amortized analysis of Splaying in Dynamic trees, let us consider a splay tree $T$ with $n$ keys and $v$ be a node of $T$. We define $size(v)$ as the number of nodes in the subtree rooted at $v$. The size of an internal node is one more than the sum of sizes of its two children. So, the root $T$ has a maximum ... |
In order for the BIOS code to matter, it must be evaluated by the processor. However, the processor itself needs to do work to actually get access to the BIOS code, since the CPU only performs instructions that are given, something must give the instructions to the CPU (since I can't imagine a way for instructions to j... |
I know 15s complement subtraction may not be much taught/popular one, but I just want to give it a try. Just trying to clear my basic digital logic/number systems concepts.
Here is what I am doing:
Normal decimal subtraction
$(339)_{10}-(401)_{10}=(-62)_{10}$
1's complement subtraction
$(101010011)_2-(110010001)_2=(10... |
I am facing a hard time understanding Blocking Flow problem. This is what I have understood till now : We have a graph and in blocking flow problem we find all shortest paths from source to destination and saturate atleast one edge in all of the shortest paths respectively [1] and we delete that path. In examples I am ... |
I am reading article https://arxiv.org/pdf/cs/0511055v1.pdf (about defeasible deontic logic) and it mentions on page 10 the operator T that constructs extension (set of immediate consequences) from the theory D (set of statements). Such extensions form s.c. Kleene sequence and the fixed point exists for the operator T ... |
Is there an example of a language that is neither recognizable nor co-recognizable?
A relevant (easy) theorem is that a language is decidable iff it is recognizable and co-recognizable.
An example of an undecidable language is the set "acceptance problem," i.e. the set of strings (Turing Machine = M, string = s) such t... |
Lexical Analyzer mostly deletes comments and white-spaces. One example where I think Lexical Analyzer might not be discarding white-spaces is in Python language, as indentation has a important role in python. But I can't think of practical example where comments are/should be kept by Lexical Analyzer? Is there any such... |
How do I prove that diameter of undirected Ring Topology is n/2?
|
How can I build a regular expression that, using only the concatenate, union and star operations, over the alphabet {0,1}, describes the language "Every three consecutive characters contain at least two 1, and the input has length at least 3"? For instance 110011, 0101 and 11 should be refused. I was thinking on using ... |
I am currently studying the theory behind Well-Quasi-Orders. However I am having some issues in understanding how an infinite anti-chain can be produced to disprove the claim that a partial order $P$ is a w.q.o.
In particular I am wondering whether it is logically sound to present as proof not the infinite anti-c... |
I'm trying to teach myself about quantum computing, and I have a decent-ish understanding of linear algebra.
I got through the NOT gate, which wasn't too bad, but then I got to the Hadamard gate. And I got stuck. Mainly because while I "understand" the manipulations, I don't understand what they really do or why you'd... |
Given is an undirected and connected graph. The vertices are persons and the edges between them model their relation. Iff X and Y have an edge (X, Y) the know each other directly. Because the graph is connected each person knows each other at least indirectly. If X knows Z indirectly there must be a person Y so that X ... |
So, I'm trying to do a computer architecture assignment and there's a question about dcaches. Here's the question:
Given a 16 word dcache initially filled with word address 0, 1, 2, …15
memory data (referenced by the datapath in that order). Below is the next
sequence of data memory address references given as wor... |
As I was watching a video about single qubit quantum gates, I came across the following gate:
$$\begin{bmatrix}e^{i\sigma}&0\\0&e^{i\theta}\end{bmatrix}$$ The video didn't mention the name of the gate. It gave only the matrix and the following information:
$|0\rangle \rightarrow e^{i\sigma}|0\rangle$
$|1\rangle \right... |
For the following code sample:
int f(int n) {
if (n <= 0) {
return 1;
}
return f(n - 1) + f(n - 1)
}
I understand that the time complexity is $O(2^N)$. However, what I don't understand is how the space complexity is $O(N)$. The argument I have heard for this is that although we have $O(2^N)$ nodes ... |
Question: Suppose you are a given a csv with N lines of the form StudentID, score. Multiple lines can have same student-ID. Find the student with maximum average score
I can't think of any way to make it faster than O(N*logN).
Maintain a hash-table that keeps track of STudentID = Key and Value being an object wit... |
I am familiar with operational semantics (both small-step and big-step) for defining programming languages. I'm interested in learning denotational semantics as well, but I'm not sure if it will be worth the effort. Will I just be learning the same material from a different point of view, or are there insights I can on... |
I'm trying to solve the Mountain Car task on OpenAI Gym (reach the top in 110 steps or less, having a maximum of 200 steps per episode) using linear Q-learning (the algorithm in figure 11.16, except using maxQ at s' instead of the actual a', as required by Q-learning; I've solved it with other methods easily, the quest... |
Say that there's a prime number P,
And we can easily build an unary regular expression [E0]for every number that is divisible by P:
E0::= (aaaa...a)*,with p "a",
The question is, how do we build the opposite unary regular expression [E1], for every number that isn't divisible by P?
Do I need to build the E1 by listi... |
the partition problem (or number partitioning1) is the task of
deciding whether a given multiset S of positive integers can be
partitioned into two subsets S1 and S2 such that the sum of the
numbers in S1 equals the sum of the numbers in S2.
There is a greedy algorithm for this problem:
One approach to the pro... |
Interval Scheduling problems present several intervals that may overlap and the usual goal is to find the greater set of non overlapping intervals.
Variations of the problem on wikipedia and such add groups/machines/resources. Groups are sets of intervals, the final result may only have one element of the each group. M... |
Is there a decision problem with a time complexity of Ө(n²)?
In other words, I'm looking for a decision problem for which the best known solution has been proven to have a lower bound of N².
I thought about searching for the biggest number in matrix but the problem is that matrix is an input of O(n²) so the solution is... |
There are numerous possibilities to implement a software mutex using only shared memory (e.g. Dekker's algorithm).
Recently I've read the following from a paper "Wait-free Synchronization" by M. Herlihy:
there exists no two-process consensus protocol using multireader/multiwriter atomic registers.
And then the theore... |
If I understand correctly, $\mathsf{NC}^0$ reductions are taken as the formalization of the concept of "local" reduction, i.e., a reduction that acts locally on substructures of the instances of the problem to be reduced: they map fixed-size "gadgets" of the source problem to fixed-size structures of the target problem... |
I have had comparative algorithm exercise to do about algorithm propoerties such as completeness, time complexity, memory complexity... I discovered Iterative deepening depth-first search algorithm.
On Wikipedia, it is said that it visits the nodes in the search tree in the same order as depth-first search, but the cum... |
I've learned today that algorithm analysis differs based on computational model. It is something I've never thought about or heard of.
An example given to me, that illustrated it further, by User @chi was:
E.g. consider the task: given $(i,x_1 ,…,x_n )$
return
$x_i$
. In RAM this can be solved in $O(1)$
s... |
Assume a functional language and a specialization operation (pulling out sub-expressions):
let f x y = (h 23 x) + (g 42 y)
becomes
(* h and g specialized, results might be mutually recursive *)
let rec h_23 = ... g_42 ...
and g_42 = ... h_23 ...
in
let f = (h_23 x) + (g_42 y)
for reasons, that do not matter, a synta... |
I have multiples arrays. I'd like to enumerate all sets containing exactly one item from each array in a (pseudo-)random order, without explicitly building the array of all sets.
Any solution, even with poor pseudo-randomization, is welcome.
EDIT: Example for clarity:
Say I have arrays
A = { a1, a2 }, B = { b1, b2 },... |
This is a theoretical question about how gossip protocols work; I am not asking about any specific implementation or piece of software.
I've read the wikipedia page https://en.wikipedia.org/wiki/Gossip_protocol on gossip protocols, and the idea seems like an excellent way to avoid having a master node in a cluster (say... |
This question is homework based (not using actual problem though)!
Say you have a function described as:
$$f(n) \in O(2n^2) \, .$$
Can you then go on the treat this as:
$$f(n) = 2n^2$$
and performs mathematics on it and keep its asymptotic meaning?
In the above case could I conjecture that $f(n) \in O(2n^2)$ implies... |
Given a triangulation (without Steiner points) of a simple polygon $P$, one can consider the dual of this triangulation, which is defined as follows. We create a vertex for every triangle in our triangulation, and we connect two vertices if the corresponding triangles share an edge. The dual graph is known to be a tree... |
I have a scalar 3D field $f(x, y, z)$ with $x,y,z$ on a regular grid. I would like to know the location of the maxima, minima, saddle points and their relation as a function of a smoothing scale.
For that, I'm convolving my field $f$ with a filtering function that is a Gaussian with a variance $\sigma$. I vary $\sigma$... |
I am investigating metalogical-frameworks like Isabelle/Pure (very few information), http://twelf.org/wiki/Main_Page, http://abella-prover.org/ for encoding of new logics. And natural question arises - how far those frameworks are from universal logic? I am especially interested their capabilities to encode defeasible ... |
I know the range of the $n$ digit numbers in $r$'s complement system is given as
$r^{n-1}-1$ to 0 to $-r^{n-1}$.
So for 3 bit 2's complement, its:
$(2^2-1)$ to $0$ to $-(2^2)$
that is
$3$ to $0$ to $-4$
that is
$(011)_{\text{2's comp}}$ to $(0)_{\text{2's comp}}$ to $(100)_{\text{2's comp}}$
And for 3 digi... |
Let's say that I wanted to build a key to value associative map where the only requirement was that lookup times were fast.
Once built, the associative map would not allow inserts, deletes, or modifications, so is a static data structure.
What would the best algorithm be for making and using such a thing?
I'm intereste... |
Let be $b$ the branching factor of the tree.
Let be $d$ the depth of the shallowest solution.
Let be $l$ the limit given to depth-limited search algorithm
Why is depth-limited search algorithm memory complexity $\mathcal O(b)$ times something (which is actually $\mathcal O(bl)$) whereas BFS is $\mathcal O(b)$ power som... |
Is there a processor architecture that falls outside the CISC and RISC categories?
I'm vaguely familiar with RISC and CISC; my research thus far indicates that either a processor is RISC or CISC, with CISC comprising a large number of architecture types. From the wikipedia article about CISC:
The term (CISC) was retro... |
Been working on my homework and I've been stuck on a question for over a week now. Not really asking for a solution but if someone could point me towards the right direction that would be great, as I have literally no idea of how to go about this. A previous question asked us to show that for any DFA that accepts A, we... |
I heard in a video that it can be proven that quantum circuits not involving entanglement can be efficiently simulated on a classical computer; i.e., that there is no point to building quantum circuits not involving entanglement. I have heard this referenced elsewhere in google searches, but nowhere can I find this pro... |
I'm fairly new to heaps and am trying to wrap my head around why min and max heaps are represented as trees when a sorted array appears to both provide min / max properties by default.
And a follow up: what is the advantage of dealing with the complexity of inserting into a heap given an algorithm like quick sort handl... |
I am wondering what happens if you remove an object in the middle of a treemap.
If the treemap would look something like this:
So what would happen if you remove the number 30? Because 27 and 34 will disconnect from the tree.
|
How to decide whether the following statement is correct?
O(E log E) and O(E log V) are equivalent regardless whether graph is dense or
sparse
|
So I'm trying to split on an attribute "Color" that has possible values (Blue,Green,Red,Orange,Pink).
I'm splitting on entropy values, and the best split can either be Multi-Way 5, Multi-Way 4, Multi-Way 3, or Binary. For example:
5: (Blue, Green,Red,Orange,Pink)
4: (Blue, Green), (Red), (Orange), (Pink)
(Green,P... |
As part of a college class, I'm asked to improve the performance of a basic DPLL sat solver. I'm already provided a basic, slow working version (essentially the DPLL algorithm; furthermore, to select the next variable, it just loops an array and gets the next unused one). I have been reading papers on ways to improve ... |
I am unclear as to why the conditions for optimality for A* search are different for graph search and tree search. When discussing conditions for optimality for A* search in Russell and Norvig's Artificial Intelligence: A Modern Approach they say:
The first condition we require for optimality is that $h(n)$ be an admi... |
I am trying to understand the problem statement and the approximation algorithm for the Unique Coverage Problem from these notes. I have refined the question based on the comments provided. Thanks to D.W for pointing out Exact Cover problem.
Given
a universe $U = \{ e_1, e_2, \dots, e_n\}$ of n elements a... |
A Dead-lock in an Operating System is
Desirable process
Undesirable process
Definite waiting process
All of the above
My attempt:
As "If a process is unable to change its state indefinitely because the resources requested by it are being used by another waiting process, then the system is said to be in a deadlock."
... |
I came across an odd problem when writing an interpreter that (should) hooks to external programs/functions: Functions in 'C' and 'C++' can't hook variadic functions, e.g. I can't make a function that calls 'printf' with the exact same arguments that it got, and instead has to call an alternate version that take a vari... |
A friend and I are asking some questions on Big O Notation.
We have an operation that requires a sequential scan on insertion of an element O(n).
The insertion itself of an element is O(1).
We are inserting a whole set of n items.
We both agree the time for insertion is O(n+1) or simply O(n) reduced. But, we have tw... |
I am completely new to Analysis of Algorithms and I have to draw a Directed Acyclic Graph from the makefile below. (I know what a DAG is).
My question is simple: should I do it just by watching the makefile or is there an algorithm I can use? All I want is to be oriented so I have a way to start.
An additional question... |
Is there a possibility to compute the result of an integer equality comparison by only using arithmetic or bitwise operations? Negative values use the two-complement representation.
I am looking for a generic algorithm, which results in two possible values for equality and inequality but not using comparison operation... |
I know that given a 2-Coloring instance we can easily convert it into a 2-Sat instance in polynomial time . Is the reverse possible? i.e given a 2-sat instance can we convert it into an 2-Coloring instance in poly time?
|
The master theorem is used with recurrences of the form T(n) = aT(n/b) + f(n) where a >=1 and b > 1, in which case the value of b can be easily seen from the recurrence, however I have a recurrence of the form
T(n) = T((n/4)+3) + f(n)
How do I get the value of b in this case?
This question Particularly Tricky Recurren... |
The following code should have a run time of $O(N)$,
int min = INTEGER.MAX_VALUE;
int max = INTEGER.MIN_VALUE;
for (int x : array) {
if (x < min) min = x;
if (x > min) max = x;
}
but what about the following code?
int min = INTEGER.MAX_VALUE;
int max = INTEGER.MIN_VALUE;
for (int x : array) {
if (x < min... |
I am currently working on a problem that is asking me to write the grammar productions for the try-catch-finally and throw C# statements. It states that "you can assume that there are nonterminals "Type", "Expression", and "Statement", as well as a terminal "Ident". I do not understand how this is possible using so few... |
I keep hearing about how one must learn category theory to truly understand programming language theory. So far, I've learned a good deal of PL without ever stepping foot into the realm of categories. However, I figured it was time to take the leap to see what I had been missing.
Unfortunately, none of the sources I ca... |
I am simulating a system where the clients' unavailability is one big issue to the systems behavior.
I gathered the real system logs to analyze the unavailability of the clients in the deployment environments and I computed the values for Mean Time Between Failure (MTBF) and Mean Time To Repair (MTTR).
Now I want to si... |
Recently I started my studies in type theory/type systems and Lambda Calculus.
I have already read about Simple Typed Lambda Calculus in Church and Curry style. The last one is also known as Type Assignment system (TA).
I'm thinking about the relations between TA and Hindley-Milner (HM), the system in languages like ML... |
I need to implement data strucure such as array, but with the following interface:
GetMin() - Returns the minimum from the array
IncRight(index) - Increases all values from specified index to the end of the array by 2
DecRight(index) - Decreases all values from specified index to the end of the array by 2
Assuming th... |
I have 2 search algorithms and I have derived the following tight bound representations:
$$ nlog(n)+mlog(n) $$
$$ m∗n $$
Now i want to find a function $f(n)$ so that when $m$ is an element of tight bound $f(n)$, both algorithms have equal asymptotic run time.
Now I'm not sure if its just as simple as setting the two eq... |
Given sequence (length $N$) of brackets like $($ and $)$. The task is to implement data structure which supports following operations:
Check whether the sequence is correctly bracketed
Rotate bracket at position $i$
I dont want a solution, but some feedback if I am on a good way.
There is no time complexity constrain... |
the first 4 steps of these are my own work - however the following steps are from my book, and I don't understand what it's saying, and I have not found any resources. Could someone clarify this?
Show C = {w|w has an equal number of 0s and 1s} is not regular. Show by contradiction.
1) Assume C is regular, and thus the ... |
Often, in a lot of texts concerning approximation algorithms I see the following notation (for example, here in page 19 of the PDF or the first page of the introduction):
... and a cost function on vertices $c:V\to \mathbf{Q}^+$ ...
Is this just the positive rationals? Or is this something else?
|
Assume that I have a picture of multiple objects (lets say more than 6). The world coordinate of these objects are known. The intrinsic parameters of the camera are also known. How can I find the position and the pose of the camera?
I know some of you will give me an answer like "For each object with image coordinate x... |
I'm looking for a way to find the shortest paths from a source to all destinations in isomorphic undirected graphs with different edge weights.
The only thing I can think of is using Dijkstra on each graph separately, but I was wondering if there is a way to take advantage of the isomorphism for a faster algorithm.
|
I am trying to solve the TSP (Travelling Salesman Problem), but not in a traditional way. I am following these steps.
1) First I change the TSP to a true / false problem.
The definition of this problem is now: "Is there a route by all the cities with a total distance less or equals than k?" Let's assume I have an alg... |
I have recently learned about using powerset construction for conversion of NFA to DFA - however this only seems to be feasible when the number of states we are working with are 3 or less, as $2^k$ seems to grow unmanageable very quickly.
I have a problem with 6 states, meaning that if I were to use powerset constructi... |
Problem
I stumbled over the following job scheduling problem.
There are two resources, for simplicity I call them ...
CPU_RAM (MAX_CPU_RAM specifies what is available in total)
GPU_RAM (MAX_GPU_RAM specifies what is available in total)
Each job has ...
CPU_RAM requirements
GPU_RAM requirements
a duration, that is... |
K-framework strives to give one (instead of two - operational and denotational) semantics for industrial programming languages. The same unification is done by structural operational semantic as well. Are those two frameworks related somehow? Such relation could be very frutiful, because K-framework has excellent tools... |
My think is pretty easy that $10^{\log n} = n$, which is growing slower than $3n^2$.
However, many tutorial shows that $3n^2$ ranks before $10^{\log n}$.
I'm really confused.
|
I am trying to solve the following exercise from this book:
Show that CLIQUE PROBLEM, parameterized by the solution size $k$, is
Fixed-parameter tractable (FTP) on $r$-regular graphs for every
fixed integer $r$.
Here, the CLIQUE PROBLEM is given a instance $(G, k)$, decide whether $G$ has a clique of size $k$ or ... |
I am trying to show whether this language is regular or not:
$$L = \{0^m1^n \mid m \neq n\}$$
Since I cannot create or think of an automaton that recognizes $L$, I am suspecting that $L$ is not regular. From the book I am using, it seems I can use the pumping lemma, I have done this:
Let $p$ be the pumping lemma const... |
I think some of the log properties are flying over my head but I'm trying to understand how the depth of mergesort is...
$1 + \log_2 n$
I understand that to get the depth, you would have to divide $n$ by $2^x$ but I don't how this leads to the above.
It's probably some simple log principal but I'm not sure.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.