instruction stringlengths 35 29.1k |
|---|
Let $n \in \mathbb{N}$ and $G := \{1,2,...,n\}$. Now let $P_2(G)$ be a power set of $G$ but only with sets of cardinality $2$, e.g. if $n = 3$ then $P_2(G) = \{ \{1, 2\}, \{1, 3\}, \{2, 3\} \}$.
Now I'd like to order these sets in a list so adjacent sets are disjoint. This only works for $n > 4$.
Furthermore given a pa... |
My question comes from solving this LeetCode question, in which we are given a string of characters with size N, and one of the solutions is to use a hashmap (dictionary in Python) to count the characters, with the character being the key, and the count being the value.
For instance, "abbcddd" results in a hashmap {'a'... |
I found this task in an old exam and couldn't get my head around it:
We define the class of languages $\mathsf{QP}$ as follows: $$\mathsf{QP} = \bigcup_{k \in \mathbb N} \mathsf{DTIME}(2^{\log(n)^k})$$
Show that there is no $L \in \mathsf{QP}$ such that $K \leq_p L$ for all $K \in \mathsf{QP}$
Some details on notatio... |
Are there any decision problems that have deterministic polynomial time algorithms and proven non-linear lower bounds?
|
Consider the $(\ge k)\mathit{-SAT}$ problem, where you are given a CNF (conjunctive normal form) formula $F$ such that each clause has at least $k$ literals, and the goal is to determine whether $F$ is satisfiable. A literal can occur at most once in a clause.
Prove that the $(\ge n)\mathit{-SAT}$ problem is in $\math... |
Let $G = (V, E)$ be a weighted, undirected graph, with $f: E \to \mathbb{R}$ its weight function. Given a path $P = (e_1, \dots, e_k)$, we call $\operatorname{bwd}(P) = \min_{1 \le i \le k} f(e_i)$ the "path-bandwidth" of $P$. Let $\mathcal{P}_G(v, w)$ be the set of paths between two vertices $v, w \in V(G)$. Given two... |
Despite the huge number of theoretical articles about k-WL, I can't find any implementation online beside some provably failed attempts:
https://trac.sagemath.org/ticket/25802
Is my Google-Fu very bad or is there just no available implementation?
|
Question: Is language $L \in \mathbf{P}$ also $\mathbf{P}$-complete with respect to polynomial-time reduction?
My thoughts: Given a language $L \in \mathbf{P}$, we want to show that for any other language $L' \in \mathbf{P}: L' \leq_p L$. To do this, given any input $w' \in \Sigma^*$, we can check in polynomial time if... |
lemma ejercicio_36o:
"(p ∨ q) ∧ (p ∨ r) ⟹ p ∨ (q ∧ r)"
apply (frule conjunct1)
apply (frule conjunct2)
apply (erule disjE)
apply (erule disjI1)
apply (erule disjE)
apply (erule disjI1)
apply (rule disjI2)
apply (erule conjI)
apply assumption
done
I mana... |
I have a program which finds the touching pairs of a given value in a binary image. For example, consider the below image:
[
[1, 0, 0, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 1, 1, 0, 1],
[1, 1, 0, 0, 0]
]
When the algorithm is run with a value of 0, it finds the following pairs:
[(1, 2), (22, 23), (23,... |
In Sec 2.1 of Principles of Model Checking, by Christel Baier and Joost-Pieter Katoen, the authors talk about what constitutes a deterministic transition system (T.S.), and mention two kinds - action-deterministic and state-deterministic. Regarding the latter, they say that a T.S. is state-deterministic if "for any sta... |
I've been looking online and through a couple youtube videos but I cannot understand how exactly conditional entropy is being applied here. From what I'm understanding is that p(Y=1 | X=1) is 0 because of (1,1) on this table being 0 at that point, but then p(y=2 | X=1) = 1, which is where I'm getting lost because I th... |
I play around with Monte Carlo tree search and tic-tac-toe. For now I have followed the Wikipedia article. There is one place, where I am stuck, the selection phase. The given procedure is the following:
Selection: Start from the root and choose child nodes based on their number of $w$, number of playouts $n$ and the ... |
I tried to solve by explicitly writing strings of length $2$, $3$ and $4$ (other than $1011$ and $1101$), but it creates a lengthy regular expression. Can someone suggests underlying pattern that helps in writing concise regular expression ?
|
Let's say I want to make a Stack class in JavaScript. The class will have a push() and a pop() method. I have two options for the underlying data structure I can use: Linked Lists or Arrays.
Using a Linked List I will have O(1) average and worst time complexities.
Using an Array I will have O(1) average and O(n) worst ... |
Definition: A formal logic system is decidable – if there is an algorithm that can determine if any given sentence is a theorem (or not).
Based on this definition, I am not sure how to move to prove that, "any first-order logics with equality and a relation/functional symbol of arity more than 1." Example also can help... |
Suppose we have a tree data structure with root $r$ with two operations:
Add($x, y$) - adds the node $y$ as a child to the node $x$
Zip($x$)- this makes the node $x$ and all of $x$'s ancenstors direct children of the root. So if we had a tree like $r \rightarrow 1 \rightarrow 2 \rightarrow 3 \rightarrow 4$ then Zip($3$... |
In the Balanced Partition problem, there are $2m$ nonnegative integers with sum $2s$. The goal is to decide whether they can be partitioned into two subsets of $m$ integers and sum $s$.
The problem is obviously in NP. I am trying to prove that it is NP-complete.
So far, I have found the following reduction from the sta... |
Intersection of any finite regular language with anything( CFL or not CFL) will be finite but what about intersection of infinite regular language with CFL or not CFL. Does the resultant will be finite or not ?
|
I've come across this problem that uses hashing to compute dot products (for non-negative vectors).
Suppose we are in $d$-dimensional space and $M$ will be our target for our hash. That is we have a universal hash family $\mathcal{H}$ from which a hash function $h : [d] \rightarrow [M]$ is chosen.
Then given a vector $... |
I am trying to find a proof of A ∩ B where A is a CSL and B is a CFL.
Also I know that CFL is a strict subset of CSL. Does that mean that their intersection will give CFL. I am stuck
|
I was confused how to label this for (int interval = n/2; interval > 0; interval /= 2) with counting operation and estimating this operation
so that I can get that exact Running time of this shell short algorithm
for (int interval = n/2; interval > 0; interval /= 2)
{
for (int i = interval; i < n; i +=... |
Is there a formulae for this summation?
I wonder this could be not a constant or to say that i * i?
$\sum\limits_{k=i}^\mathbb{N}{i}$
|
Notes
I apologize if the question is not formed well, I tried my best.
"Only" means anything else is discarded.
A stupid man’s report of what a clever man says can never be accurate, because he unconsciously translates what he hears into something he can understand. (You are the clever man here, so please try to be si... |
I was curious if someone knew the answer/reference for the following. So it is well-known that if $S\in \{0,1\}^n$, then
$$
\frac{1}{2^n}\sum_{x\in \{0,1\}^n} (-1)^{\langle S, x\rangle}=1
$$
if and only if $S=0^n$ and is $0$ otherwise. Suppose I replace the exponent from a degree-1 term to a degree-2 or degree-k term, ... |
Let us look at the two questions that are NP-complete for a classical computer:
Given an arbitrary Boolean expression, find an assignment of variables that evaluates the expression to $0$ (SAT).
Given an arbitrary Boolean expression, count the number of assignments that evaluates the expression to $0$ (#SAT).
We know... |
I came across this context-free grammar for the language L = {xy||x|=|y|, x≠y}, but I can't seem to see how it can generate all lengths for x and y. Could someone illustrate this? For example, how would you derive the string "abba" or "aaabbaaa"?
|
I have two lists l1 and l2 of possibly unequal sizes (say, m and n). I wrote an algorithm to find out all ways l1 and l2 can be merged while preserving their order.
l1 = ["NYC", "LA"]
l2 = ["A", "B"]
output:
[['NYC', 'LA', 'A', 'B'],
['NYC', 'A', 'LA', 'B'],
['NYC', 'A', 'B', 'LA'],
['A', 'NYC', 'LA', 'B'],
['A', ... |
On the Wikipedia page for AVL trees, the time/space complexity for common operations is stated both for average case (in Big Theta) and worst case (in Big O) scenarios. I understand both Big O and Big Theta in general but am having trouble understanding why they are used in such a way here. A source is linked but it do... |
The half-sample mode is a mode estimator that homes in on the highest density region of a set of samples in search of the mode. It is one of the better mode estimators, though it fails for J-shaped and U-shaped distributions.
I coded an algorithm for the half-sample mode that may be O(N^2 log N) or possibly O(N log N l... |
Below is a question on synchronization mechanism which was asked in an interview in Indian Statistical Institute, M.Tech CS. I got hold of it from here.
There is a forest where there are tigers and elephants. There are two processes named tiger and elephant. Design a concurrency processing using semaphore, such that t... |
I have a dataset with 9912 images, what is the best way to train them based on the pixels and features of the images to be able to predict a continuous target ranging from 1 to 100? The goal is to predict the “Pawpularity” of pet photos. The Pawpularity Score is derived from each pet profile's page view statistics.
In ... |
Assume we have n items with each having a different length and m wrappers each has a different length. The cost of every wrapper is proportional to its length. An item can be covered with one or more wrappers but the wrappers can not be divided. What is the algorithm to wrap the item in the cheapest possible way (least... |
"Fundamental of Database Systems", 3rd ed. by Elmasri and Navathe, page 136 says:
"We can physically order the records of a file on disk based on the values of one of their fields [...]"
How could this "physical ordering" possibly enforced, especially with regard to fragmentation? Most databases use system calls to sto... |
I have a small personal CAS project around linear algebra which involves, among other things, manipulating tensors. When I talk about tensors, I mean them according to the physical / mathematical definition, so this is of little importance for the rest of the question, but I would like to make it clear that what I want... |
this is my first post here so bare with me :).
What i'm looking for is an algorithm that can find the maximum sum of values in a square grid under the restriction, that you can only pick 1 value from each column and row.
so for example:
$$
\begin{matrix}
3 & 2 & 5 \\
4 & 1 & 4 \\
3 & 1 & 2 \\
\end{matrix}
$$
in the fir... |
I think it's a regular language but I can't find a DFA or a regular expression. Would anyone know how to help me?
|
When doing complexity analysis, they never account for the costs of memory allocation/deallocation on the heap. In particular, this is the case for the announced complexities of the operations on containers.
But allocation/deallocation does not come for free and unfortunately is implementation-dependent. Furthermore, o... |
From the text
A language $L$ is in the class $NP$ iff there exists a polynomial-time
Turing machine, denoted $V$, that gets an input string $x$ as well as
a read-only string called the witness $w$, such that for any input
string $x$,
if $x \in L$, then there exits a witness string $w$ such that $V^{w}(x)$ = "yes".
i... |
Given a undirected graph $G=(V,E)$ with $|V|=n$ and $|E|=2022n$ and some weight function $w\colon E\to \mathbb{R}$, and $0≤ w(e) ≤n$ for all $e∈E$,
Describe an algorithm that determines if the MST of $G$ only uses edges with an integer weight.
i got this question in exam 2 weeks ago and my solution didn't get any po... |
When determining the capacity of a discrete channel, we maximise mutual information, and in doing so find the optimal input distribution for that channel.
I know that the noisy-channel coding theorem does not give us a practical scheme to design a code that achieves a communication rate equal to the capacity of the cha... |
How do you simulate an ordinary turing machine using a right reset turing machine ?
(A right reset machine is in which you can move left and reset to right end position. Moreover the tape is unbounded on left but it is bounded on right)
|
I want to implement regexp search via translation to deterministic automata, as a toy project.
TLDR: how to combine the extended regular expressions with the weighted regular expressions, with the goal of translation to weighted deterministic automata? How to calculate a derivative of a weighted regexp complement?
Whil... |
My purpose is to write a academic paper related to shared computing more abstractly and I need to refer to these variables in both equation and its corresponding pseudocode.
In my pseudocode I have nested structs, where it makes it harder to represent them in simplified equations.
Assume I have following nested struct... |
I've faced this question in my homework, I tried to solve it but I couldn't.
We're given a DFA:
Every time I tried to define the language, I found a word that the DFA accepts but the language I defined doesn't. I'll be thankful if anyone can at least tell the language the DFA defines without giving any explanation o... |
I have gone through the questions related to store-and-forward and transmission delays but they didn't answer my question. My question is directly related to one of the excerpts in the book (Computer Networking: A Top-Down Approach). Book says:
Store-and-forward transmission means that the switch must receive the
enti... |
I am studying logic gates and I encountered this problem:
A set of three sensors in a factory detects whether the pollution level it is
outputting from an incinerator exceeds the safety limit. In which case the
incinerator is shut down. An alarm A goes off if at least two the three sensors
s1, s2 and s3 detect a pollut... |
First some context:
A Boolean Network of $n$ components is a function $f$ from the set $\{0,1\}^n$ (set of vectors of $n$ components whose values are 0 or 1) to itself.
The dynamical behavior of a Boolean Network $f$ is given by the iteration of the function itself, i.e. for all $x(t)\in \{0,1\}^n$, $x(t+1) = f(x(t))... |
Is there any finite automata ((N/D)FA, NPDA, DPDA, or any variation of a Turring Machine) that can accept the following language:
$\{s \text { is a string over } \{a,b\} \text { such that the number of $a$'s is a perfect square}\}$
Why or why not?
I know it shouldn't belong to a DFA because there are no possible cycle... |
Suppose that I have a stream of data packets in the form of unsigned 64 bit integers.
And I want to make sure that I am not processing the same packet content more than once.
A way of doing this would be using a hash map or dictionary, with the packets content as the key. And before processing a packet, I would need to... |
Suppose given $2n$ points in the plane and we want to partition points into two clusters $C_1$ , $C_2$ such that each cluster contains exactly $n$ points and we want to minimize the sum of the diameters of two clusters. The diameter of a cluster is the maximum distance between any two points in that cluster.
I have a g... |
I asked a question at this link, where I suggested a greedy algorithm for this problem:
Suppose given $2n$ points in the plane and we want partition points into two clusters $C_1$ , $C_2$ such that each cluster contains exactly $n$ points and we want to minimize the sum of diameter of two clusters. The diameter of a c... |
I am wondering about the claim from the book "Probability and computing" that the number of products required to multiply monomial coefficients is $\Theta(d^2)$, where $d$ is the number of monomials that forms the polynomial
$$P(x) = (x-a_1)(x-a_2)\cdots(x-a_d).$$
I think this answer is wrong and it takes $\Theta(2^d)... |
For example, is $(X \vee 1)$ a valid formula in conjunctive normal form (CNF)?
If yes, then I would have to consider such formulas when trying to prove a statement about all CNF formulas.
|
Given a positive integer $n$ I would like to compute $f(n)$, the maximum possible length of a binary sequence such that any substring of it (subsequence with consecutive elements), of length $n$, never repeats.
For example, with $n = 1$, I have a maximum length of $2$, obtained with $(0, 1)$ or $(1, 0)$.
For $n=2$ I th... |
Could anyone give me a counterexample so as to understand the proof? Thanks in advance
|
I'm reading Computer Organization and Design Sixth edition by Patterson and they define clock speed as this:
Almost all computers are constructed using a clock that determines when events take place in the hardware. These discrete time intervals are called clock cycles (or ticks, clock ticks, clock periods, clocks, cy... |
I've faced this question in my homework, it's a bonus question so it's harder than I could do now with my current knowledge, so if anyone could help I'll be thankful.
We're given $\Sigma=\{0,1\}^3$. We think of the 'letters' of the language as column vectors, so every $w\in\Sigma ^*$ is a matrix $M_w$ that consists of ... |
Trying to wrap my head around lambda calculus but am really clueless right now.
First of all, I'm really confused WHAT it's actually supposed to be. I've found these definitions:
Lambda calculus (also written as λ-calculus) is a formal system in mathematical logic for expressing computation based on function abstracti... |
The total number of ways a positive number $n$ can be partitioned is called the partition number $p(n)$. The best algorithm I found on the internet is a dynamic programming implementation of Euler's pentagonal formula. Is there any proof that there cannot be any better algorithm? Is there any better algorithm already?
|
I get why that would be true for EXP but cannot extend the argument to NEXP.
|
Given the language $D = \{x^n y^n y^m \mid n,m \geq 0\}$, I have applied the pumping lemma with $k>0$, $n=k$ and $m=0$ and found a word $z = x^{k+q} y^k$ with $q>0$ that does not belong to $D$.
However, it is not sufficient to argue that the number of $x$'s and $y$'s is not equal and thus the word does not belong to $D... |
I am trying to solve a problem in Sipser's Introduction to the Theory of Computation book, which reads:
4.22 A useless state in a pushdown automaton is never entered on any input string. Consider the problem of determining whether a pushdown automaton has any useless states. Formulate this problem as a language and sh... |
According to Alan Turing, there are 2 types of problems i.e. NP Complete and non-NP Complete, then
why do we promote Ubiquitous Computing and introducing sensors and embedded systems into our daily lives to solve problems? Would it be correct to claim that Ubiquitous Computing is a misnomer or Turing's theory of NP-com... |
In the following lines I will present my question, whose content is divided in two parts: Preparation and Actual .
(1) — Preparation
Regarding the formal definition of the (one tape) general Turing Machine, I was able to rephrase the definition from the corresponding Wikipedia article
( https://en.wikipedia.org/wiki/T... |
I am trying to find the indices of all the equal elements in a matrix $\left ( n\times m \right )$. For each pair of matching cell, I will perform a specific function on them. For example:
$ \begin{bmatrix}
2 & 1 & 3\\
4 & 1 & 5\\
2 & 3 & 2
\end{bmatrix}$
The cell (1, 1) whose value is 2 matches with cells (3, 1) and... |
In the book Computational Geometry, Algorithms and Applications there is an exercise asking:
In the proof of the query time of the kd-tree we found the following recurrence:
$$
Q(n)= \begin{cases}O(1), & \text { if } n=1, \\ 2+2 Q(n / 4), & \text { if } n>1 .\end{cases}
$$
Prove that this recurrence solves to $Q(n)=O(... |
What I want to achive ist the following: I have a 2D plane and on this plane I will have a potentially large amount of rectangles (these are specified with 2 coordinates spanning it)
Whats the most efficient way to determine if a point is in one of the rectangles
From some previous research I found that quad trees are ... |
Context
I work as a frontend developer, our main stack is Graphql & React that's relevant for this question.
The data I'm requesting can be quite complex and very often combined with several resolvers.
This is what I tried
At first, I tried to work with such raw data, but UI was suffering in complexity.
My solution to... |
I just need help solving this problem. I know I'm supposed to be using the Master's Theorem but I don't know where to start
|
Problem 3.5 from book: "Algorithms for interviews".
There are 51 states (+ Washington DC), each with different amount of votes. Find the number of votes of each state here
Suppose there are two candidates in the presidential election. How would you programmatically determine if a tie is a possibility. The problem is in... |
Consider the following algorithm:
res := 0
for i := 1 to n do
j := i
while j mod 2 = 0 do
j := j / 2
res := res + j
What's its time complexity in terms of the $\Theta$ notation?
What I have so far:
The complexity is $\Omega(n)$ and $O(n\log n)$, but I'm having trouble finding a tight bound (accord... |
I was browsing the architecture of a simple CPU but there is one thing a cannot understand. Why is there data from the ALU going to the program counter and what is that data for?
|
Using automata-lib 5.0.0 (Python library), I need help creating a Python program that simulates a PDA that only accepts the following language:
L = {a^m b^n | 0 ≤ m != n}
If you could provide any diagrams, or flowcharts to help me understand, they would be greatly appreciated.
|
Suppose we have a node x in BST, and let max and min be the largest and smallest keys in the subtree rooted at x respectively. Prove that for any node n outside this subtree, the key of n is either greater than max or smaller than min.
How should I approach this problem? I get that there are basiclly 3 cases for x,
x ... |
If all words have the same frequency, is the generated Huffman tree a balanced binary tree? At the same time, is the generated Huffman tree a complete binary tree?
|
Consider a weighted graph $G=(V,E)$ of vertex set $V = \{v_1, ..., v_n\}$ and weighted edge set $E = \{\langle v_i, v_j, w(i,j)\rangle \mid i, j \in 1, ..., n\}$, where $w$ is the function that assign the weight of a certain edge. This function $w$ is symmetric.
Suppose I want to partition the graph into multiple compo... |
I read this discussion before.
However i’m still confused. I used to think a language decided by a NTM if for every input $w$ in $\Sigma^*$, all of the branches in computation tree leads to a halting configuration, and $w \in L$ iff there exists an accepting path in its computation tree.
But because me and the student ... |
I have the following question:
Consider relation R(A, B, C, D, E, F, H) with the following functional dependencies:
A --> D, AE --> H, DF --> BC, E --> C, H --> E
Consider three relational schema R1(A, D), R2(E, C), and R3(A, B, E, F, H). They form a decomposition for R.
(a) Do the original functional dependencies ... |
The $n$th slice of a set $A \subseteq \Sigma^{*}$ is defined as:
$$A_n = \{x \in \Sigma^{*}\mid\langle n,x\rangle \in A\}$$
The definition of parameterization is as follows -
$C$ parameterizes $D$ (also called $C$ is universal for $D$) if,
$$\exists A \in C \quad\text{s.t}\quad D = \{A_n|n\in \mathbb{N}\}$$
However, I ... |
Prove the following theorem
Let A and B be two languages on an alphabet Σ. If A ≤p B and B ∈ P, then A ∈ P.
Could anyone be able to prove it?
|
I'm new to this page and I used the search function, but did not find the exact question. I'm asking here because my classmates and I have been wondering about this, but did not find an answer.
I have learned about Huffman coding and arithmetic coding in a CS course and I believed that given word occurences of $2^{-k}$... |
Near the end of subsection 5.4.9 Disks and Drums in 5.4. External Sorting, a process is sketched in a paragraph headed Will Keysorting help?:
Schematically, the process has the following form:
stage
input
data sequence
length
i)
Original file
$(K_1,I_1)(K_2,I_2)\dots(K_N,I_N)$
long
ii)
Key file
$(K_1,1)(K_... |
I am trying to understand the actual reasoning behind creating a new dynamic array of double the size of the original array once it gets full as opposed to any reasonably random number (not too small that buffer is getting filled up too often neither it being too large that half the indices are empty).
Apparently, it h... |
Hello everyone I am having trouble solving this exercise question. I don't get it what do they mean by providing the value of input x ? It would be highly appreciated if anyone helps to clarify the question at least.
Suppose it is claimed that a program computes HALT(x, x). Give a counterexample that shows the claim t... |
Say that we have two deterministic space complexity classes $SPACE(n^k)$ and $SPACE(f(n))$ where $f(n) = n^{k-1}$ when $n$ is odd and $f(n) = n^{k+1}$ when $n$ is even. Obviously, if $f(n)$ were always $n^{k+1}$, we would able to say $SPACE(n^k) \subseteq SPACE(f(n))$ by the Space Hierarchy Theorem, and I believe that ... |
Suppose given $n=2k$ numbers. We want partition numbers into two group $G_1,G_2$. Let $d_1$ be the largest value of absolute difference between each pair of numbers in $G_1$ and also $d_2$ be the same as $d_1$ but in respect to numbers in $G_2$.
Our goal is each group contains exactly $k$ numbers and minimizing $d_1+d... |
Modern CPUs (for a very wider range of "modern") use separate data- and instruction-caches. So at the core they (probably) have separate busses for data and instructions. Does that make the "core of the core" a havard architecture?
Are modern CPU a mix of Havard and von Neumann?
|
Given a grid of integer values, $G = \{g_{i,j}\mid i<m,j<n\}$ I would like to compute a grid $H = \{\{x_{i,j},y_{i,j}\}\mid i<m,j<n\}$, in which each cell contains the coordinates of the cell in $G$ closest to ${i,j}$ and equal in value, i.e. find $x,y$ such that $g_{x_{i,j},y_{i,j}} = g_{i,j}$ and $(x-i)^2 + (y-j)^2$ ... |
I have a combinatorial optimization problem that I try to solve using simulated annealing.
It is about finding the optimal configuration of N points on a grid. I have the operation swap (swap one point with another one) and move (move one point to a new coordinate on the grid).
I already implemented the simulated annea... |
I want termination proof of divide and conquer approach to find max of array,I want equational proof in form of lemma.Below is my attempt.I have got accepted everything in dafny ,it is only pointing the termination proof as false.Below is the code-
method maxofarray(a:seq<int>) returns (max1:int)
requires |a|>=0
ensur... |
Is the language $L = \{\langle M\rangle|L(M)=\{\langle M\rangle\}\}$ recursive?
I've been trying for hours to find a way to prove or disprove that it is.
My first attempt was to show it wasn't recursive using Rice's theorem but I'm not sure if one can create a Turing machine that only accepts it's own encoding? How wou... |
I'm reading Sipser's "introduction to the theory of computation" book. Even though in many places the phrase "computational problem" appears there is no definition of it. How is it defined?
Some other questions I thought about when trying the understand the nature of a "computational problem":
Are there mathematical pr... |
Suppose that the edge weights in a graph are uniformly distributed over the halfopen interval [0, 1).
The question is, how can one sort the edge weights in linear expected time?
I know the definition of expected time for inputs of size n is $\max_{I \in I_n} \sum_{R} P(R)T(I,R),$ where $I_n$ is the set of all input... |
I am working on a problem in geometry and I encounter the following problem.
Suppose given $n=2k$ points $P$ in the plane. And we want partition points into two group
Is there an algorithm that decides whether we can $P$ into two groups the size of each group be exactly $k$ and diameter of each group be at most given... |
Given CPU with:
L1 cache: 4-ways, block size = 32 bytes , cache size = 64KB , LRU (Cache replacement policy).
L2 cache: 2-ways, block size = 32 bytes , cache size = 512KB , LRU (Cache replacement policy).
Array: int32_t A[2048][128]; so element size is 4 bytes.
for(int k=0, k<50, k++)
for(int i=0; i<2048; i+=Di)
... |
Given finite sets $A,B,C$ of finite strings, does there exist some $x,y \in A$ and some $z$ such that $x.z \in B$ and $y.z \in C$ hold (where $x.z$ denotes the concatenation of $x$ and $z$)?
That is, do $B$ and $C$ contain a pair of sequences with a common suffix such that the respective remaining prefixes are both con... |
Bag of words model rank words in a particular document in such a way that
If it is occurring into that particular document multiple times and it's frequency is low for other documents then it's weight is high. And It seems perfect.
Where will it lack? Can someone please give me insight upon dis?
|
Consider a sequence of vertex and edge additions and removals to an initially empty (undirected, simple) graph.
Is it possible to update the ordered list of vertex degrees in constant time (and space), for each addition or removal? How?
Is it easier to update only the maximal degree (lower time or space complexity)? Ho... |
Suppose we have an optimization problem where we want to find a binary matrix $A \in \{0, 1\}^{n \times m}$ that minimizes the score function defined as
$$S(A) = \sum^n_i \sum^m_j f_{ij}(a_{i-1j}, a_{ij}, a_{i+1j}, a_{ij-1}, a_{ij+1}) $$
where all $f_{ij}$ are known, real-valued and bound within $[-w, w]$, except for e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.