instruction stringlengths 35 29.1k |
|---|
Why is $\log n = O(n)$?
I faced this before and I remember I understood it at that time. But now I cannot know the logic and could not find understandable explanation. Can anyone explain it?
|
Assume we have an oracle that tells, given a linear bounded automaton, if there exists an input on which it halts.
Can we then solve the real halting problem (i.e. decide if a given Turing machine halts on a given input)?
|
This is a general question in first order logic.
Assume I have alphabet $\Sigma$ that contains one-argument function (among other symbols).
I want a new alphabet, $\Sigma'$, which is the same as the original, except that the function $f$ will be replaced by a new binary relation $R_f$.
I ran into difficulties when I ... |
I came across the following question:
Let $L_1$ be a regular language and $L_2$ be a context-free language. Let $L_1^c$ and $L_2^c$ be their complements respectively. What can be said about $(L_1^c \cup L_2^c)^c$? Is it context-free?
I tried to solve it in two different ways:
$L_1^c$ is also regular because regular ... |
$L = \{w\in\{a,b\}^*\mid w = uav \text{ and } |u| = |v|\}$
I know to use the pump lemma, but I don’t know how to use it correctly.
|
I have the really strong feeling it is indeed NOT context-free, since the language $1^{n^k}$ for $k\ge 2$ is not context free (proven by the pumping lemma) and, in a sense, "the order of magnitude" of the number of 1s will always supercede the order of the number of 0s, but I really can't find an exhaustive proof for t... |
We have data types like int and long etc. which can store just a few bytes of integers.
But when we are implementing cryptographic algorithms like RSA or Elliptic Curves, we know that the key values are usually 1024 bits long.
How is this implemented in C and C++?
I had gone through /crypto/rsa.c in the Linux kernel wh... |
An automaton determines its next state from the current state and the next input symbol. A pushdown automaton adds a stack which you can push/pop/read from. But then there are probably a lot of intermediate things to a completely generic system where each transition is based on the current transition and any informatio... |
As we know that the entries of the TLB get copied into the cache memory once another process is chosen to be run by the scheduler. But what if the cache memory is full and there is no space left for the entries to be copied?
|
I've seen the proof that $EQ_{CFG}$ is not recognizable but its complement is, my problem is that in the proof that it's complement is recognizable, it says that we test every string in $\sum^*$ and checks if it's generated by one of the $CFG$s but not the other. My question is that why don't we use this method to solv... |
I'm reading Algorithm Design and Applications, by Michael T. Goodrich and Roberto Tamassia, published by Wiley. They teach the concept of primitive operations and how to count then in a given algorithm. Everything was clear to me until the moment they showed a recursive function (a simple recursive way to calculate the... |
Let $\Sigma=\{c,f^1,R_1^2,...,R_k^2\}$ where $c$ is constant, $f$ is one argument function, and $R_i$ are binary relations.
Let $\Sigma_2=\{c',g^2,R_1'^1,...,R_k'^1\}$ where $c'$ is constant, $g$ is two argument function, and $R_i'$ are unary relations.
Show an algorithm that given a formula $\varphi$ above $\Sigma$,... |
This the following graph where I want to find the perfect matching and a maximum matching
I converted this to an bipartite graph, and found that the perfect matching exists and also found an maximum matching, but I am unable to justify that it is indeed maximum. How can you justify that a given matching is indeed maxi... |
I have an undirected graph $G$. It has some symmetries in the sense that I know it's automorphism group $\text{Aut}(G)$. I am searching for a specific subgraph defined by some constraints $\phi$ and optimization criterion $f$, i.e. I am solving a problem in the form:
$\max_{G'\subseteq G \land \phi(G')} f(G').$ The sub... |
I decided to create an algorithm to find the colors that is used to color a bipartite graph, the algorithm proceeds as follows:
Rename the vertices in a some order $v_1,v_2,\ldots,v_n$.
Do a single pass through all vertices of the graph, starting from $v_1$.
To each $v_i$ assign the smallest available color not used... |
I am very interested to know how to draw the planar embedding of a graph.
For this graph:
I cannot find the planar embedding because it is a Peterson graph, which is not planar;
but for the following graph:
I am unable to draw the planar embedding.
Isn't the graph itself the planar embedding?
|
def delete(root: Node, key: str) -> bool:
"Eagerly delete the key from the trie rooted at `root`.
Return whether the trie rooted at `root` is now empty.
"""
def _delete(node: Node, key: str, d: int) -> bool:
"""Clear the node corresponding to key[d], and delete the child key[d+1]
if... |
I came across Lemma 19 in Certifying Equality With Limited Interaction, which states the following for jointly distributed random variables $Z$, $W$, where $Z$ takes values in $\{0,1\}^n$, and some arbitrary event $\mathcal{E}$:
$$
H[ Z \mid W ] \ge n - d\ \Longrightarrow\ H[ Z \mid W, \mathcal{E}] \ge n - \frac{d+1}{\... |
In Dijkstra's original paper, he talks about two problems related to graphs. The second one is the problem of finding the shortest path between two nodes, which is what is most commonly meant by Dijkstra's algorithm. However, he also poses another problem, namely that of constructing the tree of minimum total length be... |
I have been searching the web for a mathematical model of a register machine and have fallen short. The closest I have found is found here:
But I am looking for more detail than what is provided there, such as similar to the Turing Machine definition using tuples:
What resource describes the mathematical definition o... |
This might be a slightly strange or irrelevant question. My apologies if it is. I'll try to formulate it the best I can.
First, here is an hypothesis: diagonalization is syatematically used to prove that a set is a proper subset of another set by constructing an object that exists in the latter but not in the former.
F... |
Consider the following algorithm that determines if a given number n is composite or not
on input <n>
for i = 2..n
check if i divides n
if it does accept
reject
a) The loop runs n times so why this algorithm is not polynomial time in the size of input?.
b) How can a nondeterministic TM decide this problem(composite nu... |
I was reading SICP and it talks about Data-directed programming.
To me is sounds like generating a vtable or a dispatch table explicitly, and then looking up to it explicitly too. The programmer responsible for the data and operation implementation is responsible to add the proper entries to that table and the advantag... |
Let $\phi$ be a 3-CNF expression with the properties
Every variable can be used at most 3 times
No Variable can be used twice in a term
Show that you can always choose the truth-value of the variables such that $\phi$ is true.
My attempt was to express this problem as a bipartite graph and then use Hall's theorem.
... |
I apologise if my following reasoning is flawed, but I cannot find the "bug" in it.
Consider two finite subsets of $\mathbb{N}$, namely $A$ and $B$. The set of all functions $f:A\rightarrow B$ is clearly finite.
Are the functions in this set computable? I can imagine constructing a huge list of all possible functions $... |
Let $G$ be a $k$-partite directed acyclic graph where the edges are only between two adjacent sets of vertices.
I'm trying to partition the graph to the minimal number of connected sets.
Sets $A_0, A_1, ..., A_k$ are connected if you can reach from some vertex in $A_0$ to some vertex in $A_k$.
Assume the following $k$-... |
Given an arbitrary directed graph $G$ (which may not necessarily be connected) find a minimum set of edges $S\subseteq E$ such that every disjoint component of $G(V,E\cap S')$ is strongly connected.
A "minimum set" refers to the set with the minimum number of edges. The best algorithm I could come up with is exponentia... |
Let $\Sigma = \{a, b\}$. For every language $L \subseteq \Sigma^*$ we denote
$\widetilde{L} := \{xy \mid xxy\in L\}$. Prove that if $L$ is regular, then so is $\widetilde{L}$.
I tried playing around with the automaton for $L$ and extending it in ways, but I always keep adding unwanted words to the new language and ther... |
Hello I have a task where I´m stucking at.
I have to convert a Grammar to NFA. I have these information:
G=(V,T,P,S) V={S}, T{0} and
S -> 0S
S -> 0
I can´t do anything with this information for me it´s not clear.
If someone can help it would be very nice.
|
I have following information.
0 1
-> *q0 q0 q1
q1 q1 q2
q2 q2 q0
I have to convert this in to a regular grammar.
I wrote this:
q0 = q2,0 + ε
q1 = q0,0 + q1,0
q2 = q2,0 + q1,1 + q1,1
|
Ok, so I'm having bit of an issue understanding nearest neighbour search with delaunay triangulation.
In particular, how do I re-triangulate my delaunay triangulations once I introduced holes?
But I should probabl provide a bit of context:
(source: university script, not sure I should/am allowed to link to it, so pleas... |
happy to be here.
I need some guidance. I am writing a project on data drift. I have trained an instance segmentation model on the Cityscapes Dataset, to detect pedestrians. The model I trained was on daylight images, and I have exported the same. But now I want to build the drift monitoring solution to pick up data dr... |
I am currently studying the textbook Speech and Language Processing, 3rd edition (draft), by Jurafsky and Martin. Chapter 2.1.1 Basic Regular Expression Patterns says the following:
The regular expression $\text{/[1234567890]/}$ specifies any single digit. While such classes of characters as digits or letters are impo... |
I need a way to solve linear and non-linear inequalities over the natural numbers. So equations like this should be solveable:
$\forall n, p, q \in \mathbb{N}. q \cdot (1 + n^p) \leq q$
From what I gather SMT solver should are a good choice for this. I'm not an expert on the area of SMT solvers so I would like guidance... |
Consider an undirected, unweighted graph =(,). I want to compute the clustering coefficient of each node. In the publicly available lecture from stanford, the following formula for computing the clustering coefficient $e_v$ for a node $v$ is given as:
$$e_v = \frac {\#\text{edges among neighboring nodes}} {\#\text {no... |
I am trying to prepare for my Linear programing exam and i stumbled upon an exercice that i can't wrap my head around. It goes like this.
Seven days before the final match a tennis player is trying to optimize his training sessions. He has 4 different training options - Serving, Volley, Right-hand hits, Back-hand hits.... |
I would like to implement Boltzmann machine with two hidden and two visible units. The four possible hidden units configuration are $(0,0), (0,1), (1,0), (1,1)$, and their probability distribution is $20\%, 35\%, 35\%, 10\%$, respectively. I would like to train Boltzmann machine so that it learns this distribution. The... |
When process A has run long enough and the scheduler decides to run process B, will all the pages of process A be moved to the disk or they remain in the main memory?
|
I was trying to find the context-free grammar of
`$L= \{a^n b^m c^p d^q |m+n=p+q, n,m,p,q \geq0 \}$ but I'm stuck.
This is what I did so far:
$$ S \to X S Y | \lambda$$
$$X \to a|b$$
$$Y \to c|d
$$
but I figured out that it doesn't respect the order.
My Question is different from this one because here $n, m, p or q$ c... |
I know that k-mean/median is to find a set $F$ that minimize
$$\sum_{i\in C}\min_{j \in F} d(i,j)$$
Where $C$ is set of clients and $F$ set of facilities. (For k-mean you just square the distance).
The thing I am confused about is what is k-center about? Is it similar to k-mean/median?
|
I'm looking for guidance on how to reduce the following problem to a known problem or a suggestion for solving it altogether. Optimal / heuristic solutions or any other suggestions are greatly appreciated!
Consider:
Drop off points {t_1, t_2, ...} ∈ T
Every drop off point has a number of required items {d_1, d_2, d_3}... |
Graph500 is a competition for supercomputers that uses a different benchmark "Traversed Edges Per Second", which is supposed to measure some notion of the communication bandwidth ability of the computer.
However, I don't understand how this benchmark works since there doesn't seem to be a basic explanation on the site.... |
In the context of my PhD on the simulation of the labor market with a multi-agent model, I encoutered a problem that doesn't seem to be really treated in the litterature, according to my searches on different networks on the subject. This problem is the "Max-Min Fair Allocation of Divisible Heterogenous Goods".
The pro... |
Note: I am searching for an algorithm that can do what I need or something similar to it, so that I can try to adapt it to my needs. My idea here was to ask for a reference (e.g. "This can be solved using an algorithm called xyz") but obviously I would also appreciate it if someone took the time to create one on-the-fl... |
Given the following function
$$
f(x,y) = (x \cdot y + 999)\; \text{div} \; 1000
$$
where $x \in \{0, 1, 2, \dots, 2^{63}-1\}$, $y \in \{1, 2, 3, \dots, 500\}$, and the div operator is defined to round down, i.e. $a\;\text{div}\;b \;\colon= \lfloor a / b \rfloor$, is there a way to rewrite the expression such that the d... |
I'm trying to implement multiple precision arithmetic operations modulo P, with P < 2^256.
More specifically, P = 2^256 - 2^32 - 977.
I want to support the following operations: +, -, *, /, pow (each mod P)
As P is close to 2^256, numbers are represented with 8 u32 or 4 u64.
a + b mod P can be done like this (in pseudo... |
I was looking at paging in OS.
It seems like there are two concepts with the same name but with different features, and I wanted to be clear about those, Paging and page cache.
Before I thought paging as
(A page, memory page, or virtual page) a fixed-length contiguous block of virtual memory, described by a single ent... |
While making a circuit connection between Micro Processor and Memory Chips, the Address Lines A0 and A1 got interchanged. Means A0 of address bus got connected wrongly with A1 of Memory chip and A1 of address bus got wrongly connected with A0. Same error has been committed for both RAM and ROM chips. What would happen ... |
Let $\Sigma = \{a, b, c\}$ and $L = \{wa^{1 + k + 2n}b^nw^{rev}\mid n, k \in \mathbb{N}_0, w \in \Sigma^*\}$. It is clear that $L$ is context free, but the question is the following:
Let $L'$ be the language of all words $z \in L$, where between the $i$-th and the $(i+1)$-th occurence of the substring $abc$, $z$ has at... |
If $f(n) = 3n^2$, then can I say that $f(n)$ has an asymptotic upper bound $f(n)=O(n^5)$?
While that bound is not tight, it is still true, right?
|
As said, I had to prove that the greedy algorithm:
Initialize $C = ∅$
Look for an un-covered vertex and add one of its edges to $C$
Repeat 2 while there's uncovered vertices
Is a 2-approximation algorithm.
My take was:
Let's say that $OPT$ (the optimal solution) takes $k$ edges, we should prove that $ALG$ takes at ... |
say that we have {2,3,5,4,6} as input that we want to sort in ascending order. Then, we know that we can use any of the sorting algorithms: bubble, insertion, selection, quick, merge, heap or counting.
How can we determine the resultant running time for each of the above algorithms given {2,3,5,4,6} as an input?
|
I originally posted this question here
Lets assume we have a highly connected directed acyclic graph (DAG, more edges then nodes). Since it is a DAG, we can retrieve a topological order of nodes to traverse the graph with different algorithms. Lets assume we want to traverse it in a dynamic programming approach to ret... |
Consider, we are only allowed to use loops ($while$), addition ($+$), substraction ($-$) and checking if a value is $> 0$. How can one find out, if a certain variable $x$ equals a value $y$? E.g. how can I find out if $x=4$ by only using the aforementioned methods? For $x=0$ I came up with the following:
y = 1
while x... |
If we the language $A$, which is defined like this:
$$A = \{\langle G,s,t \rangle \} \mid \text{ There is a maximum path in graph $G$ that begin in $s$} \} $$
I want to build a Turing Machine that decides $A$ to prove that $A\in NL$.
How can we build the machine?
I try this:
Begin from $s$ and choose a neighbour $u$ o... |
I am studying conversion from left recursive grammar to right recursive grammar. The given grammar is
$$E \to E + T \mid T $$
It's equivalent right recursive grammar will be
$$\begin{align}E &\to TA\\
A &\to +TA \mid \epsilon\\
\end{align}$$
I understood this, that it is derived from changing the grammar $A \to Aa \mid... |
i am taking a basic Linear programming class this semester and we've recently started solving integer linear problems. I have a question regarding how to solve one of these exercises.
$$
z = max\: 5x_{1} - 7x_{2} - 10x_{3} + 3x_{4} - 5x_{5}
$$
$$
s.t. \: x_{1} + 3x_{2} - 5x_{3} + x_{4} + 4x_{5} \leq 0
$$
$$
-2x_{1} - 6... |
I am reading the paper[1] at: https://arxiv.org/abs/1905.07147
The paper says in Overview section 3:
The figure shows a constructed function Bar, which is written in
Solidity and contained in a smart contract. (The comments should be
ignored for now.) There are three assertions in this function, on
lines 14, 19, and 2... |
I have drawn the DFA for language L1 containing 11 as substring and language L2 containing 010 as substring. But I don't know how to concatenate these two to get the final answer. Please help!
|
I was reading the description of Anime4K (a video upscaler software) and I found a statement triggering my attention:
[upscaling is done] without any meaningful decrease in entropy (lost information
is lost).
If someone sits down and redraw a cartoon, they may be perfectly capable of using their experience to undo th... |
It is well known that the $p$-stable distribution can be used to generate locality sensitive hash code for $\ell_p$-norm distance measure where $p \le 2$. However, it seems that the situation for $p>2$ is not clear. Does there exist a locality sensitive hashing for $\ell_p$-norm distance where $p>2$? If not, what does ... |
I had been curious as to which page replacement algorithm is used in OSes like Windows and Linux. I could find that most information on the internet pointed at LRU(Least Recently Used) Algorithm.
But I was reading Modern Operating Systems by A. Tenenbaum and H. BOS, and it's stated that-
"LRU is an excellent algorithm,... |
Given a cost function like this $f(n)=\frac{1}{n^c}$ where $c \ge 1$, can we say that $f(n)=o(n)$ and $f(n)=O(n^2)$ are all correct upper bounds, but $f(n)=\Omega(n!)$ and $f(n)=\Omega(2^{n/1000})$ are not correct?
The problem with $f(n)=\frac{1}{n^c}$ is that it decreases as $n$ increases... so for large value of $n$,... |
Let $f$ be any function from $\{0, 1\}^{n}$ to $\{-1, 1\}$. For a given $f$, let us define another function $g_f$ as
\begin{equation}
g_f(x) = \sum_{x \in \{0, 1\}^{n}} f(x).
\end{equation}
Let us be given black box access to an unknown $f$ (you can assume the function to be chosen uniformly at random from the set of a... |
I am trying to formulate a multi-tape Turing Machine which converts one's name in the form of "(Firstname with the first letter in caps)(space)(Lastname with the first letter in caps)" to "(First letter of Lastname in caps). (space)(Firstname with the first letter in caps)".
For example, "Jayajit Banerjee" will be conv... |
We'll consider the RAM as a sequence of cells that can contain data. Some cells already contain some data, some are empty. The empty cells form the so-called memory clusters. Thus, a memory cluster is a sequence of some consecutive empty memory cells.
You have exactly $n$ memory clusters, the $i$-th cluster consists o... |
I have drawn the DFA for language L1 containing strings starting with 01 and language L2 containing strings ending in 11. For the final DFA, I have concatenated both DFA's. The finals DFA does not accept 011.
Kindly help!
|
With the following grammar:
$$S \to SxS \mid a$$
Is L(G) inherently ambiguous? What is the proof?
I know how to prove the grammar is ambiguous but I don't know how to prove if the grammar is inherently ambiguous. Can someone help me?
|
Problem: implement a Deterministic finite automaton which accepts 01 ∪ (2∪10*2)*
∪ <- is union symbol
I have a lot of problem trying to implement that DFA, the union symbol always confuse me
Can someone help me
|
I am sorry if these are such stupid noob questions. I am just getting into CS.
I read a passage in a book that says:
Time complexity is written T(n). It gives the number of operations the algorithm performs when processing an input of size n.
We also refer to an algorithm’s T(n) as its running cost. If our code follow... |
I'm trying to figure out how is the recurrence of $maxheapify()$ is $T(n)=T(2n/3)+O(1)$
If size of max heap is $n$, then calling $maxheapify(A, 1)$ will (at worst case) go through only one element in each level (in the downwards direction) up to level $h$ (where $h = \log n$)
So, the recurrence should be $T(n) = T(n/2)... |
We can read on the internet: BFS finds the shortest path to the destination.
But how ? Check this example:
for this example we can get 40 10 20 30 60 50 70
What is going on here ?
In my opinion the shortest way to 50 is 40 - 20 - 50 so this algorithm is not good for shortest path.
Could someone explain how this algori... |
I am looking for the computational complexity of the following problem.
Divide a given set of constraints into a minimum number of satisfiable clusters such that the constraints within the same cluster are satisfiable together.
Constraints can be in any type, such as Boolean logic or CSP and you can assume that there i... |
I'm trying to prove this expression 2^(2n+2) ≠ θ(2^2n)?
Firstly 0 <= c1.2^(2n) <= 2^(2n+2) for this n=1 c1=1 is a solution set.
For n = ∞, 0 <= ∞.c1 <= ∞ c1=1 is provide it. So omega notation part is okay.
Second part is Big O notation so it should be 2^(2n+2) <= c2.2^2n.
For n=1 it's 8 <= 4c2, c2 can be 3.
For n=∞, it... |
Decisional 4-XOR Problem: Assume $M>>n$ (e.g. $M=50n$ ). Let $A_1,A_2,A_3,A_4$
be sets consisting of $M$-bit elements. Each set has order exactly $2^n$. Decide whether or not there exists $a_i \in A_i$ such that $$a_1 \oplus a_2\oplus a_3\oplus a_4=0$$
The standart methods solves the search version of the problem in $... |
Wolfram Alpha is able to solve a few basic functional equations. For example, it knows how to solve equations like this. My question is: how does it do this? I am planning on creating a program to find solutions to functional equations (doesn't have to be anything too fancy -- start with just testing for polynomial sol... |
I have an edge-weighted tree, and for each leaf of the tree, there's a corresponding point on the 2D plane. For each pair of points $u$ and $v$, let $d_{uv}$ be the distance of the corresponding leaves on the tree (i.e. sum of edge weights of the path connecting the leaves), and then $u$, $v$ must satisfy at least one ... |
Suppose i want to check if my position is enclosed in a closed loop by following the connection of waypoints that surround it:
Now if i travel from node 0 to node 1. I'm at node 1 and i need to find the next connection of which as you can see i have multiple choices this time.
I can rule out where i came from quite ea... |
So I am studying for my Algorithm theory exam and this is the problem i could not solve:
Given numbers $x_1, x_2, ..., x_n$ which are the sizes of $n$ files and disk capacity $D$. Determine if you can seperate these files into $3$ disks so that, in every disk sum of doesn't exceed $D$. Justify that this problem belong... |
When proving a problem in NP, e.g. k-clique problem defined as k-clique:= {<G,k>| G has a clique of size at least k }, from what I understand is that all we assume for the certificate "c" to be is some string that is of polynomial length of the size of the input.
My question is when designing the verifier, does this ve... |
I am trying to implement a radial/angular sweep algorithm that finds all segments (segments are disjoint) that are visible from one particular point in $O(n \lg n)$. So I am trying to order vertices by their angle with point P that we are checking visibility from. But I am uncertain with which point to start first with... |
I tried to prove this by starting at RHS:
$$ϵ+a(a+b)^*b = ϵ+a(a^*b^*)^*b$$
But I dont know how to convert $(a^*b^*)^*$ to something else that will be helpful.
Any ideas?
|
I'm trying to develop an algorithm in Ruby to allocate one university to each student of a list. As opposed to Gale-Shapley algorithm, universities do no choose nor rank students; only students make a 6-wish ordered list.
There are 336 students
There are 151 cities, each with an available number of places between 1 & ... |
I am interested in a variant of the Feedback Vertex Set (FVS) problem.
For an undirected graph $G$ and $k\in \mathbb{N}$ we need to decide if there is a subset $S \subseteq V(G)$ of size at most $k$ s.t every connected component in $G-S$ is a cycle or a tree.
I am trying to solve this problem and find an FPT algorithm ... |
Consider a special kind of graph where the nodes can be partitioned into $n$ layers. There are edges only between successive layers and no edges between the nodes of any given layer. So for example, the nodes in layer-1 are connected only to the nodes in layer-2, the nodes in layer-2 are connected only to the ones in l... |
I was reading about proof assistants, formal verification etc, also I have a lambda calculus implementation. My question is: Is it possible to prove that my implementation is correct?
In fact I have two implementations, having a single proof for both would be nice but I have no idea how to attack the problem. What I kn... |
Can you help me with what steps to follow to find the Fourier transform of t/(t^2+1)^2. I know it will be solved on the lines of time-frequency duality but cannot seem to get the exact steps for it. Any help will be appreciated.
|
Statement:
If G has no simple path on x vertices ,then the treewidth of G is upper bounded by x.
Hint: Begin by computing a DFS tree, and prove an upper bound on its height.
I am supposed to prove the above statement. I tried but without success. I would be happy If you can help me to solve, thanks in advance.
|
Does higher cpi give better performance?
Lets say there is a code and we can run it by 3 methods.
1 cpi for single cycle
99 cpi for multi cycle
70 cpi for pipeline
Multi cycle has the highest cpi for this code. So is multi cycle method the best for this code?
|
I don't know how to prove the following:
Let $a$ be randomly chosen out of $\{ 1,..., p-1\}$ and $b$ randomly chosen out of $\{ 0,..., p-1\}$.
Let $m$ be a natural number smaller than a prime number $p$. Let $ h_{a,b}:$ $\{ 0,..., p-1\} \to \{0, ..., m-1 \}$ which is defined as $ h_{a,b} = (ax + b \mod p) \mod m$. Pro... |
I'm looking for the name of the problem stated below or, if available, even the algorithm to solve it. This is a hypothetical idea of mine, I don't actually have the necessary data to implement it. But I like the algorithm challenge behind it and would like to know more about it. I just can't find the name of the probl... |
If P=PSPACE then by padding argument EXPTIME=EXPSPACE.But what about class L(Logarithmic space)?What will it be equal to?I can't think it as equal to DLOGTIME.There are problems that can be solved in constant space which are contained in L.But many of them can't be solved in logarithmic time like linear search. So do t... |
I saw this problem:
$\langle G,w,k_1,k_2 \rangle \in L$ iff Graph $G$ has a spanning tree whose sum of edge wights are less than $k_2$ and greater than $k_1$. The problem says that we can prove this problem is NP-complete with reduction from Subset-Sum problem. First i cant see how is that possible. Second i know that... |
I am building a program that analyses a students mistakes and that mistake is linked to a topic. Then the program gets the information that a certain person has made x mistakes on some topic. I want an algorithm that can sort out the topic that the student made the most mistakes in and give them a weighting. Then I wan... |
We have the following pairs of strings.
$$\begin{bmatrix} aa\\b \end{bmatrix} \begin{bmatrix} ba\\baa \end{bmatrix} \begin{bmatrix} aba\\a \end{bmatrix}$$
The problem is now, to find a concatenation of those pairs, such that the resulting string of the upper row equals the string of the lower row. E.g. if $$\begin{bmat... |
Given is an algorithm that finds the transitive shell of a graph:
Transitive Shell(G)
for v in V
BFS(G,s)
for w in V with d(w) < infinity
E* = E* U (s,w)
I've been knacking at this problem for a while, and I can't come up with a solution. Also no results for this on Google either. Any help is appreciated
|
Could someone tell me how many stopping points are needed for the traveling salesman to be impractical to be solved by current computing?
|
Given a weighted bipartite graph with nodes of type A and B, I want to output an (approximately) ordered list of type B nodes as defined by the following heuristic:
For each node of type B, sum over all the edge weights for edges to node B.
Select the node from type B which has the highest value and append it to the o... |
The following question (in two parts) comes from a homework sheet of the fall 2019 semester cs170 course taught at UC Berkely taught by professors Vazerani and Tal.
Design an algorithm that takes in a stream $z_{1}, . . . , z_{M}$ of
$M$ integers in $\mathbb{Z_{n}}$ and at any time $t$ can output a
uniformly random el... |
There are several researches studying translating 0-1 integer programming into CNF form. For example, this paper and this C++ library. As the lecture notes here goes, translating 0-1 integer programming problem into CNF form might introduce $O(n\log^2 n)$ extra variables. However, it seems that the time complexity of s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.