instruction stringlengths 35 29.1k |
|---|
I'm looking for one of two closely related algorithms. In both, you have a list of elements, of which you have to choose one by some scoring method. In the first variation, the list is infinite and you can't go trough it all, but you can choose any item. In the second, you must choose to accept or reject an item perman... |
There are $N$ weights, $w_i$. and signal starting from $a_0$.
I would like to moving weighted sum of signals, such as:
$$
s_1 = w_1a_1 + w_2a_2 + ... + w_Na_N\\
s_2 = w_1a_2 + w_2a_3 + ... + w_Na_{N+1}\\
s_3 = w_1a_3 + w_2a_4 + ... + w_Na_{N+2}\\
$$
and so on.
If we are to calculate the sums from $s_1$ to $s_M$, an bru... |
I have an assignment
There are n > 2 finite processors, two registers for each processor.
Register s_i is not readable by the processor p_i but any other processor can read it.
Register r_i is readable and writable by the processor p_i and any other processor can read it.
I have to solve the problem to let p_i discov... |
Let
$$ L_{300}=\{\langle M,w\rangle \mid M\text{ prints more than }300\text{ non-blanks on input }w\}.$$
Is $L_{300}$ decidable?
My intuition is it is decidable because given $M$ and $w$, we need to check for a bounded number of steps which would be a function of the number of states in the finite automata of $M$, inp... |
Given is an undirected weighted graph with N nodes, with each node having a property/Value.
Aim is to find the bestpath which maximizes the sum of the nodes property which can be visited given a constraint on the maximum distance/weight than can be traversed over the entire graph i.e. the sum of edge weights of best pa... |
I fail to understand a algorithm, basically the matrix multiplication portion.
I can explain the unknown terms. At line no: 4 j will be 1,2,3,....,15. When ever new object is observed a value corresponding to this object assigned in j. There are total 15 objects. So when object number 1 observed it is assigned to j. ... |
I want to create an algorithm to build a hex matrix with given:
- max n rows
- max m collumns
- min t rown
- min q collumns
containing the specific words from a list: "example", "test", "algorithm".
For example. To build a hex matrix with:
- max n = 5 rows
- max m = 6 collumns
- min t = 5 rows
- min t = 4 col... |
Can anyone explain why the runtime of this is in O(N^3)?
Additionally, what would the run-time be in Big-OH if the else statement was removed.
for(int i = 0; i < n; ++i)
{
for (int j = 0; j < i; ++j)
{
sum = sum * sum;
}
for (int k = 0; k < i * i; ++k)
{
... |
So given an array of [1,5,9,4], find all pairs of numbers that can sum/subtract/divide/multiply to another number in the array(that number is not part of the pair), and return the total count of pairs satisfying this condition. (If a pair has 2 math operators that fit to the same number or if a pair can combine to 2 di... |
I am working on proving the time complexity for the following problem, but believe I am stuck:
$$T(n) = 2T(n/3 + 1) + n$$
I have checked out this link here on time complexity on cs.stackexchange
However, I still cannot seem to find the answer. Using this proof from a Dartmouth course:
$a = 2, b = 3, c = 1$
In this cas... |
I don't know where else to ask this question, I hope this is a good place.
I'm just curious to know if its possible to make a lambda calculus generator; essentially, a loop that will, given infinite time, produce every possible lambda calculus function. (like in the form of a string).
Since lambda calculus is so simple... |
I need to solve a maze. I can move an object around in a 2D maze by giving it 1 acceleration in any 8 of its 8 directions.
The object starts at rest at 0 velocity.
By only adding an acceleration at each step, I need it to be able to solve the maze and finish at the end position with a final velocity of 0.
This maze is ... |
let S be the set of all programs that take a natural number as input and return another natural as output. let M be the set of all programs that take a natural number as input and return true or false. In both cases for a program to be in S or M it must halt.
Consider programs P in S, I will say the integer n is "in" P... |
When reading the description of Raft algorithm from Wikipedia, I noticed there is a special word index.
For web developer, index usually refers to database index.
When it comes to Raft algorithm, what does index mean? Is it similar with database index? e.g. B+ tree.
What is raft index used for?
Wikipedia: Raft
Log ... |
I have been given an array whose elements lie between [1,70] and the size of array [1,10^5].
I have to find the total number of subsets whose all elements multiply to give a perfect square number.
Since, count of subsets can be very large, I have to give the
ans mod (10^9 + 7).
How should go on to solve this problem ?... |
Question 1: Is it known that $\mathrm{QP}=\cup_{k}\mathrm{TIME}(2^{\mathrm{log}^k(n)})$ has any complete problem?
Question 2: Can this be used to simplify the computational complexity theory at all?
|
For AVL-Tree there exists the following Rotations for Balancing:
Left Rotation
Right Rotation
Left-Right Rotation
Right-Left Rotation
My Question is about the Naming for the Double-Rotations. Sometimes a Left-Right Rotation is defined as a Left-Rotation followed by a Right-Rotation. This is for me the logical case. S... |
Given an array $|A|=n$ of integers, and $m,k \in \mathbb{N}$, I want to find $m$ elements $a_{i_1},...,a_{i_m}$ of $A$ such that $\sum a_{ij} \geq k$ (repitions allowd), or determine that no such solution exists.
Clearly, a trivial solution is to take the maximal element $a_{max} = \max_{i} A_i$, multiply it by $m$,... |
I am studying Theory of Automata. I was studying conversion of Epsilon-NFA to NFA. I had to take null closures of states two times, before and after the specific input.
Could someone explain, what is the reason behind this?
|
Garey proved that the Rectilinear Steiner Tree problem is (strongly) NP-hard. I wonder if it is still true when we retrict the points to have integral coordinates and lie on a square of side lenght n^O(1) where n denotes the number of points.
|
given an array $A$ of $n$ numbers in range $1$ to $n\log n$, what is the time complexity of the best method to sort them?
The answer is $O(n)$ but I don't understand this. of course counting sort itself is irrelevant, perhaps radix sort with base changing is the way to go, but I'm not sure of to change the base of $n\l... |
I am getting started to understand the probelm of Satisfiability and i am reading (Computers and Intractability: A Guide to the Theory of NP-Completeness).
I do understand the difference between a Deterministic and Non-Deterministic Algorithm, however i don't understand why SAT requires a Non-Determinsitic Algorithm ? ... |
Let $(V, E)$ be a simple connected undirected graph, $f: V \to \{-1, +1\}$, and $g: E \to \{-1, +1\}$. The function $g$ is completely defined by $f$, while $f$ is something we get to choose. The only thing we know about $g$ is that negating $f(v)$ causes $g(e)$ to negate whenever the edge $e$ is adjacent to vertex $v$,... |
Has "top" ($\top$) been removed from or relegated to a much more minor role in denotational semantics? If so, when and why?
I see older papers and books talking about both "top" and "bottom" ("bot", $\bot$), but it seems like newer work only refers to bot. I vaguely recall seeing a reference somewhere that said that to... |
If not (because I assume not) is there some kind of reference or book that provides some theoretical foundation to these concepts? I've been learning about data structures and abstract data types for a while now but all these concepts seem very hazy and I would like some sort of rigorous grounding to stand on.
I hear t... |
Not sure if I should ask this on CS or physics SE, but here goes.
I’m reading on quantum computing, and one thing that keeps confusing me is the following basic fact about QM:
Say we have a qbit A, and a qbit B, then two possible quantum states for $A$ are:
$$|+\rangle=\frac {|0\rangle + |1\rangle}{\sqrt 2}$$
$$\frac {... |
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page repla... |
Let $S$ be the set of all programs that take integers as input and return integers as output and halt on all inputs. Does there exist a pair of program in $S$, call them $P_1$ and $P_2$, such that there exists no program $P_3$ in $S$ for which the following hold for every integer $y$:
$P_3(x)=y$ for some $x$ iff $P_1(x... |
A reversible circuit, if I understand it correctly, is a circuit where every gate in the circuit is invertible, i.e. can simply be “turned in the opposite direction”, so that the entire circuit can in a sense just be “turned in reverse” without changing the circuit architecture.
An invertible function is not defined in... |
Can a distributed algorithm be serial?
For example if I have 3 distinct agents in a network would an algorithm that looks like this be considered a distributed algorithm?
Process ABC
If (you are agentA) then
Do stuff
Else if (you are agent B) then
Wait until agent A has finish... |
I am currently reading SmartCheck: Static Analysis of Ethereum Smart Contracts (Tikhomirov et al., WETSEB'18; PDF). In section 3.1 it talks briefly about synonym propagation.
What is synonym propagation?
I searched in the Dragon Book, but I did not manage to find it.
|
In case $L$ is context free language. $L_1 \setminus L_2 = \{x\in \Sigma ^* : \exists y\in L_2$ s.t $xy\in L_1 \}$ when $L_2$ is regular, is a context free language, thus using $L_1 = L$ ,$L_2 = \Sigma ^*$ one conclude that prefix$(L)$ is context free. However I wish to build a grammar for prefix$(L)$. My attempt so fa... |
Take the Set Cover problem as an example. When we ask if there is a set of size k that covers all the elements, the problem is NP-complete. Now if we ask, for a given set $S$ of size $k$, if there exists another set that covers strictly more elements than $S$ does. Is this problem still NP-complete?
To be clearer, let'... |
I'm reproducing a question I posted on MSE (yet with no answer both there and by myself).
Given a (finite) directed graph $G = (V, E)$. For each vertex $v \in V$ and a natural number $n$, let $W_v(n)$ be the number of walks in $G$ of length exactly $n$ originating at $v$. That is,
$$W_v(0) = 1 \quad\text{and}\quad W_v(... |
I'm looking for a name of a group of all commands which are break the linear structure of the program.
In C PL, they are: goto,return,break,continue. C++ also contains throw.
Perl has last,next,return.
Is there a common name for those groups of commands? Where can I read about those kind of commands?
|
microsoft.com has the ip address 23.96.52.53
Since the first number is $23$, this is class A.
Does this mean microsoft owns all the addresses from 23.0.0.0 to 23.255.255.255 ?
|
I have read somewhere about an alternative SSA representation that doesn't use phi nodes but instead uses parameterized basic blocks.
Something like this in an SSA with phi:
block_a:
value_a = ...
jump block_c
block_b:
value_b = ...
jump block_c
block_c:
value_c = phi (block_a: value_a), (block_b: v... |
I designed an algorithm, and the Time Analysis provided next time complexity:
$\mathcal{O}(2^p \cdot (\frac{t}{2}/2^p) \cdot \frac{n}{4})$
what must be simplified to:
$\mathcal{O}(2^p \cdot \frac{n^2}{16})$ = $\mathcal{O}(2^p \cdot n^2)$
That constant factor is quite relevant in this case, and the only reason I'm cons... |
Given two arrays of integers, A and B, with same size (or two bit vectors A and B with some bits enabled)
What would be the faster way to create a list C containing the elements from B not in A, (or the indexes of the bit vector B not enabled in A)?
|
Here is the context (Structure and Interpretation of Computer Programs, section 1.1.8, under heading "Local names"):
A formal parameter of a procedure has a very special role in the procedure definition, in that it doesn't matter what name the formal parameter has. Such a name is called a bound variable, and we say th... |
Is it possible to parse all kinds of structured data and give them a semantic meaning? For example, C++ is a really complicated language and I could never imagine a parser would be possible for it.
What makes a certain grammar parse-able and contain semantics? How do I decide a written information is parse-able?
|
What is the hardness of the following problem?
Input: An undirected graph $G(V, E)$ and a natural number $k$
Output: YES if $G$ has an equidistant vertex set of size $k$, otherwise NO
$\DeclareMathOperator{\dist}{dist}$An equidistant vertex set is a set of vertices $V'\subseteq V$ such that for every two pairs of ver... |
I am trying to relate the following integer square root theorem
$\forall x: \mathbb{N}, \exists y : \mathbb{N}((y^2 \leq x) \land (x < (y+1)^2))$
and its proof to its role as a specification of the Integer Square Root isqrt ($\lfloor \sqrt{x} \rfloor$) function in a Haskell program.
Below is a inductive proof of the ... |
I have read that checking if tuple belongs to join of two tables is NP-complete.
I had computional-complexity activities during my studies, I remember basics, however I have forgotten details. Nevertheless I don't understand why it is NP-complete, it seems to me that I can solve it in polynomial time.
Let's consider ... |
I was reading single pass in memory indexing and had few doubts.
Why is the time complexity of SPIMI O(T) where T are the token.
We know that before writing blocks to Disk, we have to sort dictionary terms. So, why don't we consider log(T) factor of it?
Also, if there is some data in memory then while performing sorti... |
Let's say I have a context free language. It can be recognised by a pushdown automaton. Chances are it can't be parsed with a regular expression, as regular expressions are not as powerful as pushdown automata.
Now, let's put an additional constraint on the language: the maximum recursion amount must be finite.
Because... |
Consider a network with $N$ nodes $1,...,n$. Every node is connected to every node via a weighted edge, where the weight represents distance.
You start your travel at a given node, say $1$, and end your travel at a given node, say $12$. Your travel has $T$ time steps. At time step $t=1$ you must visit one of nodes $\{1... |
What does she mean by finding the 6 qubit quantum state $|010001\rangle$ from a sphere of dimension $2^6$.
Here is the link: https://www.youtube.com/watch?v=IrbJYsep45E
at time 8:47.
|
Let $R$ be a regular set over the alphabet $\{0, 1\}$. Give a machine construction to prove that the set obtained by deleting one 1 from each even length block of 1’s is also regular, and using closure
properties for the class of regular sets.
Current Approach:
For the first part, using a machine construction, I w... |
So, in the book I'm studying from it says :
The statement “f(n) is O(g(n))” means that the growth rate of f(n) is no more than the growth rate of g(n).
What I understood from this statement is that since 9n is O(n), the growth rate of the functions 9n and n have the same growth rate, which does not make sense. I know... |
I wondering how the browser's JS runtime implements these methods. I looked on the web and could not find any documentation.
How does something like the V8 runtime actually work to implement these methods into machine code?
At runtime what does the call stack look like?
Function
function multiply(a, b) {
return... |
The relation between disparity and depth is derived based on the assumption that the two cameras are parallel.
Image rectification does not make this assumption valid.
But I see in many university computer vision lectures, with two rectified images, the depth map is directly calculated.
I cannot figure out why.
|
I'm having difficulty understanding the big-O analysis of the selection sort algorithm. Here is my pseudocode (with line numbers):
procedure SELECTION (A(n), limit)
1. for j <- 0 to limit - 1 do
2. min_index <- j
3. for k <- j + 1 to limit do
4. if A(k) < A(min_index)
5. min_index ... |
I need help with proving the following language is not regular:
$$
L = \{ a^n b^k \mid n > k \} \cup \{ a^n b^k \mid n \neq k-1 \}
$$
My usual methods using pumping lemma are not getting me anywhere.
|
Suppose we have a CNF formula $F$ and a permutation $\sigma$ of its literals such that for any literal $x, \sigma(\neg x)=\neg \sigma(x)$ and $F \vDash \sigma(F)$.
Does it hold that $F \equiv \sigma(F)$?
It is the case when $\sigma$ is a syntactic or even a semantic symmetry of $F$ but I don't know if it hold for any ... |
Prove that for any symbol $a$ and regular expression $r$ it is true that:
$$\partial a(r^* ) = \partial .a(r)(r^* )$$
My attempt:
Induction on regular expression $r$
Base cases:
1) $\emptyset $
$\partial a(\emptyset^* ) = \partial a(\varepsilon) = \emptyset$
$\partial a(\emptyset) (\emptyset^* ) = \emptyset \empty... |
Beginner in DFA related studies, was trying to figure out how to create a DFA with {a,b,c}, that can recognize a * b * c *.
Appreciate the help.
|
The rod-cutting problem described in Section 15.1 of CLRS, 3rd edition is the following.
Given a rod of length $n$ inches and a table of prices $p_i$ for $i = 1, 2, \ldots, n$, determine the maximum revenue $r_n$ obtainable by cutting up the rod and selling the pieces.
This can be solved by dynamic programming with ... |
I asked this question on Math Stackexchange but it didn't get much attention, so I am asking it here.
Edmond's Blossom algorithm (Wikipedia), or simply the blossom algorithm, is a popular graph algorithm to construct a maximum matching in a graph (matching is a set of edges without any common vertex; maximum matching i... |
Following the success of the previous question:
Karp hardness of an equidistant vertex set
I continue to propse yet another computational problem. This time, we modify the notion of an equidistant vertex set to obtain the notion of a simply equidistant vertex set. A vertex set $V'\subseteq V$ is called simply equidista... |
The problem is from the ACM Collegiate Programming Contest: 5924 - Parallelogram Counting
Problem Description
The International Consortium for Parallelogram Counting (ICPC) wants to move into the digital age
and automate their parallelogram counting. They want to count the number of parallelograms formed
by universitie... |
I am wondering how to represent signed number, vector, matrix on binary tape of Turing machine to consume the smallest possible amount of memory.
For signed number it is obvious: encode sign as a single bit and sum it with the length of number representation $\lceil\log_2(\mathrm{abs}\,(n)+1))\rceil$.
But how is it pos... |
I just saw this short documentary about atomic clocks. The person working for the Atom clock company gets asked what would happen is all the atom clocks would be turned off and he replayed that cell phone services and the internet would stop working. I have read that an accurate time is important but do not now why.
W... |
I have a binary variable $x_{ijt}^k$ that is $1$ iff job $i$ is assigned to machine $j$ at time $t$ using processor $k$. I would like to express the following constraints:
If job $i$ is assigned to machine $j$ at time $t$ using processor $k$ then job $i$ cannot be assigned to machine $j'\neq j$.
If job $i$ is assigne... |
I'm trying to connect cylinders with a sphere in 3D smoothly.
The sphere is given by a single 3d point-diameter data and the cylinders
are given by point-diameter data as well for the start of the cylinder
and the end of the cylinder for each cylinder respectively.
I would like to describe the cylinder by a spline,
... |
I'm having trouble understanding exactly how the graph for Pn (where n = number of pancakes) is defined recursively for n>= 4. I can see obviously that, in the case of n=4, there will be 4 rough copies of the graph where n=3 with additions of 4 in certain places (where, and how is this defined?). But these copies aren'... |
This is a thread about mathematically calculating time complexity of nonlinear functions. I know that those questions were asked a lot, but it didn't make me understand fully the subject.
Also I understand that it's impossible to calculate every function, but usually we can (otherwise we have not been asked to do so o... |
I am going through the Monte Carlo methods, and it's going fine until now. However, I am actually studying the On-Policy First Visit Monte Carlo control for epsilon soft policies, which allows us to estimate the optimal policy in Reinforcement Learning.
I am having troubles understanding the step in blue of the algor... |
I was reading the paper titled "Primal-dual RNC approximation algorithms" by Rajagopalan and Vazirani. I have a problem of understanding the Lemma 4.1.1.
They present a dual fitting based algorithm for weighted set cover. First let me set up the required concept to clarify where I am having trouble. Suppose we have $n... |
It seems to me that problems whose dedicability remains open for a long time, if resolved, tend to end up being undecidable. A prominent example would be (e.g.) Hilbert's tenth problem, whose decidability was open 21+ years (†) until proven decidable. Is there a similiar example of a problem whose decidability was open... |
We typically measure algorithm efficiency by space efficiency and then time efficiency e.g. this algorithm takes O(n) time and O(n) space.
However, I feel this does not capture the full story.
Say we have a process that looks like this. Assume memory allocation is O(1) time complexity for simplicity.
process(n):
mem ... |
Let $A$ be a problem that I want to show it is coNP-complete.
I know I could just show its complement $\bar{A}$ is NP-complete
or that $\bar{A}$ is in NP and for some coNP-complete problem $Q$, show that $Q$ can be Karp-reduced to $A$.
But I wonder if the following steps are sufficient to show that A is coNP-complete... |
The divisor and dividend are of length n and m bits respectively.
According to Wikipedia article,
https://en.wikipedia.org/wiki/Output-sensitive_algorithm
division by substraction is an output sensitive algorithm and has the time complexity of Θ(Q). Can the time complexity be calculated in terms of length of input bits... |
I was studying the grid problem where a robot is at the top left position and wants to go to the bottom right position and you need to return the number of unique paths it can take to get there with the constraint that it can only move down or to the right.
It looks like the standard way to solve this is with the top-d... |
I have a course named "Evolutionary Algorithm". But, our teacher is always mentioning the word "Optimization" in his lectures.
I am confused. Is he actually teaching Optimization? If yes, why is the name of the course not "Optimization"?
What is the difference between the study of Evolutionary algorithm and Optimizatio... |
While reading Computer Architechture book by M.Mano. I came across Arithmetics Microoperations sections which has two microoperations which confuses me a lot,
R3 <- R1 - R2 ( Minus Microoperation )
R3 <- R1 + complemented(R2) + 1 ( Subtract Microoperation ).
Can someone tell me the difference?
|
I'm reading about Quicksort algorithm, specifically using the Hoare partitioning scheme.
Wikipedia page says, that when choosing a pivot element one can use both hi and lo indexes. However, when implementing the same code in Python, my code fails in a very specific circumstances. My python code is a translation of the... |
I'm fairly new to studying data structures and algorithms.
I've implemented a non-recursive BFS on a 2d "maze array" which seems to work well. It finds the position of 2 in an array of 1s (walls) and 0s (spaces), marking visited positions with 3.
However, I notice that there are duplicate values in the Queue. I underst... |
I'm currently trying to implement this paper. Based on a bayesian network, the paper stays unclear about how to ultimately use it's content ("straightforward inference"). But after a lot of researches (I have no background in that field), I think I can apply Viterbi algorithm to get the expected result. I will give he... |
I am trying to understand this program and the respective forest. This is from the book Logic,Programming and Prolog by Ulf Nilsson.
Question:
In the main tree, why from ←off_gound(a) can you derive ⧠ ?
In the main tree, why was chosed on(b,a) first instead of on(c,b)?
Could someone please explain this?
Thank you ... |
Consider I have the following recurrence
$$T(n) = 10T(n/3) + \Theta(n^2\log^5 n)\,.$$
Now, by the master theorem, if we evaluate $n^{\log_{b}{a}}$, we get $n^{\log_{b}{a}} = n^{\log_{3}{10}} = n^{2.095}$. Now, can anyone please explain me, which of the three cases apply? If you plot these functions you can see that $n^... |
Is the problem to construct a $\mathcal{O}\mbox{*}(1.4^n)$ (or better) time algorithm for subset sum still open? I wanted to check the problem before finishing a paper.
The most recent reference I found to this open problem is on next paper:
'SETH-Based Lower Bounds for Subset Sum and Bicriteria Path, Amir
Abboud e... |
Given an Nondeterministic Finite State Automaton with $n$ states over an unary alphabet, is there some algorithm to check if the automata is universal in time polynomial in the number of states?
I would not expect this would work over an alphabet of size two or more, since it is PSPACE-complete to check whether a regul... |
Assuming only computable functions, and in line with set theory, defining a "proper class" as a collection that is itself not allowed to be a member of a set. A "collection" is then defined as either a set or else a proper class, in cases where we do not wish to distinguish.
If a set is defined by its membership functi... |
Given a Monte-Carlo algorithm (called A) that given a binary array with b 'on' bits (one-bits) returns a, where in a probability of 1/2:
$\frac b 3 \leq a \leq 3b$
How can I use A to build an algorithm that does the same, but with probability $poly(\frac 1 n)$ of success (success means $\frac b 3 \leq a \leq 3b$
), us... |
Following the success of the undirected version:
Karp hardness of an equidistant vertex set
Inspired by the success of this long ago question:
NP-hardness of problem with indices and subsets
We move on asking for the hardness of the directed version of an equidistant set.
Input: A directed graph $G(V, A)$ and a natura... |
Today I was taught that since the height of a heap cannot exceed $\log n$, it is $O(\log n)$; height in my class was defined as the maximum number of steps in a simple path from a leaf to the root. That is fine, but I think we should further specify it as $\Theta(\log n)$ since it, at that same time, must be greater th... |
given an AVL tree with $size$ value to any vertex $v$ in the tree (which is the size of the tree rooted in $v$), is it possible to tell for a given value in the tree, what its order in the sorted group in $log (n)$ time complexity?
|
Toda showed long ago that $\mathrm{PH\subseteq BP.\oplus P\subseteq BPP^{\oplus P}}$. That somehow describes the power of Parity Non-deterministic Computation.
If we swap the base and the exponent of the relativized class $\mathrm{BPP^{\oplus P}}$ to obtain yet another relativized one, namely $\mathrm{\oplus P^{BPP}}$.... |
Between an adjacent pair of nonzero IEEE single precision real numbers, how many IEEE double precision numbers are there?
I was also wondering if this question has something to do with the hidden bit.
Can anyone help me?
|
Given the question below:
Consider that, on the procedure below, the variable X is defined globally and the parameters of the vr function are passed by value
procedure vr(u,v) {
u = 2*u;
x = u+v;
u = u - 1;
}
Define the value of x in the end of the following:
x = 4;
y = 2;
vr(x,y);
print(x);
I always knew ... |
In Wolpert's "No free lunch theorems for optimization", he uses the following formalism for an optimization algorithm:
Let $X$ be a finite space of which an element has to be chosen, and let $Y$ be a finite space. Let $f:X\to Y$ be a cost function, where a higher value in $Y$ denotes a higher cost. An optimization algo... |
We have that $\mathrm{NP\neq coNP\iff NP\neq NP\cap coNP}$.
So by assuming that $\mathrm{NP\neq coNP}$, can we prove the existence of intermediate problem between $\mathrm{NP}$-complete and $\mathrm{NP\cap coNP}$?
|
Consider the example of solving for $x$ where $Ax=b$. This is not in general function, there can be more than one solution. So if you make such a solver in a functional style...does this count as a side effect?
def solve(A:Matrix[Float],b:Matrix[Float]):Matrix[Float] = ...
Obviously the solution will be dependent ... |
I have a little problem which requires determining if a system of linear inequalities in 3D is infeasible. The constraints (or oriented planes) are added one by one, so there is an opportunity to stop as soon as the system becomes infeasible. Basically this:
class LPSolver {
// add constraint ax + by + cz + d < 0 (... |
The randomization solution is from majority-element, and the corresponding complexity given confused me very much.
The complete procedure of calculating iterations give is :
$$
\begin{split}
EV(iter_{prob}) & \le EV(iter_{modif}) \\
& \le \lim_{n\to\infty} \sum_{i=1}^n i \times\frac{1}{2^i} \\
& =2
\end{split}
$$
I w... |
What are some problems that are in $\mathrm{P}$ but the best known algorithm has a high-degree polynomial ($\ge 3$) time complexity?
|
I understand that in terms of minterms,
F (Boolean Function) = Sum of Products and thus will yield true when either of the products is true.
But I am unable to develop any intuition for maxterms,
F(Boolean Function) = Product of Sums (of maxterms).
Is F = Product of sums just a different way of representing F = S... |
A related question:
How to prove that a bounded pushdown automaton is regular?
Well I proved that $a_k$ for each $k$ is the set of all the regular language. Thus $\bigcup_1 ^{\infty} a_k = \bigcup_1 ^{\infty}\{$ the set of all regular languages} = $\{$ The set of all regular languages $\}$.
However before noticing that... |
I'm trying to write a non-ambiguous context-free grammar that can generate the set of natural numbers, including the 0. My current solution is the following grammar:
$\mathcal{G}: S \rightarrow 0\ |\ ...\ |\ 9\ |\ 1S\ |\ ...\ |\ 9S$
From what I understand, there is not an algorithm to determine whether my guess is corr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.