instruction stringlengths 35 29.1k |
|---|
The halting problem is NP hard, to my knowledge any NP problem can be reduced to a NP hard problem. Let us define a new computational complexity class called HP(Hypercomputational polynomal-time), The class of all problems solvable in polynomial time on this particular hyper computer. This would include the halting pro... |
I found an AVL tree implementation on the internet and experimented:
For a tree with node count of 2^20, the minimal and maximal tree heights are 16 and 24.
While these heights are lg(n)-ish, I am concerned about their difference.
Doesn't AVL guarantee maximal-minimal height difference to be 1?
The repository from whic... |
In lectures my professor proved that there is no Turing machine that for every x it calculates k(x).
On the other hand, I saw a claim online that for finite language L there is a Turing machine that calculate k(x) for every x in the finite language L.
But how does it work, why is this possible.
|
Is even distinguishing between NP complete and incomplete problems an NP-hard problem?
|
Background: I'm trying to program a generic method to add a node to a Directed Acyclic Graph. This method should allow the caller to specify the possible effects on the graph, specifically the edges.
So far, I have identified the following possible changes, but I'm not sure if this set is complete.
Add a new edge from... |
Currently, I am working on a research project where I will utilise reinforcement learning for the diversified top-$k$ clique search problem. To train the reinforcement learning algorithm, I need to generate graphs that have similar properties, such as average degree and overlapping cliques, to the ones used in the pape... |
Consider two decision problems A and B.
We know that A reduces to B in polynomial time --- if we could solve B, we have a procedure to solve A.
Now, let's say it is known that the worst case instances of A reduce to the average case instances of A.
Does it imply the same worst-to-average-case reduction for B?
If not, w... |
Use Nerode's theorem to prove that the following language $L$ is not regular:
$$ L=\{a^{k!} \mid 1\leq k\} $$
Here is my attempt:
Let $A$ be an infinte set of words s.t- $$ A=\{a^n \mid n\in \mathbb{N}\}$$
Then we shall consider 2 words from the set $a^{i!}$ and $a^j$ s.t-
$$ i!\leq n, i!\ne j$$
$$a^{i+1} \longright... |
Why is a Language L(M) {has at least 10 strings} recognizable and L(N) {has at most 10 strings} is not?
{⟨⟩:() has at least 10 strings}
{⟨N⟩:(N) has at most 10 strings}
My proof (I dont know if I'm wrong)
L(N) => I could think of a turing machine that takes as an input 10 strings of the language and accept them, if ... |
In these lecture notes (on page 5 under "Some Remarks") it is claimed that the Set Lower Bound Protocol (given there on page 4) can be modified to have perfect completeness. However, while I understand why the original protocol works I do not see how such a modification is possible. Could you please give me a hint?
|
I am looking for some algorithms(examples) whose time complexity is given by $O(n^k)$. It could be any problems that you have come across. Please reply. Thanks!
|
A solution to an instance of the Maximum Coverage problem with a budget of k subsets can be approximated with a greedy algorithm that, at each iteration, picks one of the subsets that adds the most additional coverage. This has been shown to lead to a worst case performance of $(1 - 1/e) \cdot \mathsf{OPT}$, where $\ma... |
I am currently studying lambda calculus, and would like to represent an array that accepts multiple dimensions. I still haven't figured out how to implement uni-dimensional arrays though.
I have found an interesting article on how to represent lists in lambda-calculus, but nothing for arrays. I have been unsuccessfully... |
High school teachers use this Website called Kahoot to post quizzes that are answered live by the students. Students sign in to the quiz and are invited to input a name for themselves, and as you might imagine, some students have used some rather unsavory names like Phil McCraken.
As a programmer, I thought I'd researc... |
This is a question from an exam I got wrong. Given an undirected graph $G$. Consider the decision problem of finding if there exists a vertex cover of size at most 30. Can we find a polynomial time algorithm for this problem? I answered that it is not possible because vertex cover is NP hard, but it turns out that ther... |
I know that Turing-completeness is the ability to simulate a Turing machine, and from what I've read, the reason why we should care about Turing-completeness is that it demonstrates that a machine can "run any program" or "compute the result of any algorithm." While I understand these descriptions, I'm wondering if th... |
I have this function which traverses each node of a left child-right sibling binary tree once and I want to solve the recurrence relation of the function.
First of all I think the relation looks like this:
T(n) = 1+m[4+T(n-m)] = 1+4m+mT(n-m)
Where m is the number of nodes on a level and n the total amount of nodes in t... |
If I want to show that H is RE-Complete is it enough to show it's undecidable? or should I prove something else alongeside?
$H$ is the halting problem: $H = \{<p,x>|p \textit{ halts on } x\}$\
|
Matrix Chain Problem can be viewed as the problem of finding the optimal summation order in a path-structured tensor network. How hard is the problem if we extend it to trees?
For instance, take the following sum, written in Einstein summation notation
$$A_i B^i_j C^j_k D^k$$
This corresponds to the tensor network belo... |
Why cant we approximate the number of satisfying assignments of a CNF formula $g$ by first counting the solutions to $\neg g$ (which is in DNF) using the FPRAS for $\#DNF$ and then estimating the $\#g$ to be $2^{n}-\#(\neg g)$?
PS: I say why we cant, because I don't see this approach tried anywhere and seems too trivia... |
Probably this is a basic question but I'm not sure how to finish this proof. I have a problem $X$ and I want to prove that it is possible to reduce $X$ to another problem $Y$. I know that $Y$ is NP-complete and that $Y$ can be reduced to $X$. Can I just conclude that $X$ is also NP-complete and thus $X$ can be reduced ... |
There are $M$ interconnected nodes in a peer-to-peer network. Initially,
each node numbers itself with any integer from $1$ to $N$, $N \leq M$.
Each node counts the most occurrences of neighboring nodes, including
itself, and modifies its number to that value. If all the numbers occur
equally, a non-self number is ran... |
I have to design a Turing machine which takes a input string $a^{*}$.
$a^{*} = \left \{0,1 \right \}^{+}$
Following this pattern where S is the input string:
$$
S_{n} = \left \{0, n=0 \right \} \\ \\ S_{n} = \left \{S_{n-1} \overline{S_{n-1}}, n>0 \right \} \\
$$
The overline meaning that part will be inverted
Exam... |
Following this question on MATLAB's Discord channel, I did a bit of search and found this interesting answer using circshift() function to detect zero-crossings. I used the answer to provide this answer:
x = linspace(-10, 10, 200);
f=@(x) exp(x) - x.^4 .* sin(x) - 100
zx = f(x) .* circshift(f(x), [-1]) <= 0; % Estima... |
The penultimate step of the Christofides algorithm in solving the TSP asks us to find an Eulerian tour of the subgraph formed by uniting the MST of the original graph and MPM of a subgraph. I understand the starting point for the Eulerian tour will make a difference to the Hamiltonian circuit found after deleting the d... |
It is well known that at height $i$ the number of nodes is bounded by $ \frac{n}{2^{i+1}} $, for example there are at most $n/2$ leafs.
Now, it makes sense only if we're taking $ \left\lceil \frac{n}{2}\right\rceil $, because for example, a binary tree with $7$ nodes has $4$ leafs at most.
My question is: why do we ta... |
A certain hash table uses external chaining, and is resized each time its load factor
exceeds 3. Also, if an addition does not cause the load factor to exceed 3, but does
cause some bucket to exceed 6 elements, the table is given a new hashing function
and the elements of the table are redistributed in accordance with ... |
The question is about approximation algorithms to NP-hard optimization problems.
For concreteness, let $M$ be a minimization problem with $n$ inputs, where all inputs and outputs are integers in the range $1,\ldots,V$, and $\log V$ is polynomial in $n$, so that the problem size is polynomial in $n$.
A FPTAS (Fully Poly... |
I've learnt theoretically Computer Architecture at uni.However I can't wrap my head around it in practice. I am using Simple Scalar tool to simulate a benchmark program with configurable computer design option parameters such as number of floating units ,pipeline width , integer ALU , memory ports. Having tried differ... |
Where bin(n) is the shortest binary representation of n.
First, we can see that we can rewrite it as $bin(n)bin(2(n+1)+1)^R$ which implies that the second word will always start from 1.
We can also see that the words in that language will be of form:
$w011w^R$ if the word ends with 0, because we need to just get to bi... |
In most articles that compare word embeddings they use cosine distance to determine if words are similar. Why?
I guess that euclidean distance should work too. So, my question is: it doesn't?
And why cosine distance doesn't fail?
|
Suppose I have a table with millions strings in it as keys.
What data structure can I use in order to efficiently support only queries like that?
select *
from table
where key contains (('cat' and 'dog') or 'apple')
example of strings that should be selected:
cat loves dog
cat and dog
apple trees
The collection is st... |
I was writing a program to count lines from an input text stream.
This is the program. It compiles perfectly but when I execute ./a.out to get the output my program doesn't seem to run.
I enter the text and then enter the command ^z (control z) and it shows the error mentioned. (zsh: suspended ./a.out)
I just want the... |
Suppose we have a grammar having a one step derivation like
S -> a
where 'S' is a variable and 'a' is a terminal.
Since this grammar does not pump terminals, can we say that the language generated is context free by using pumping lemma?
|
Are there any polynomial functions that are $O(e^x)$? Is this possible?
|
In the subset sum problem, the input is a list of positive integers $x_1,\ldots,x_n$ and an integer $T$, and the goal is to decide whether there is a subset of sum exactly $T$.
The problem can be solved by dynamic programming in time $O(n T)$: for every $i\in\{1,\ldots,n\}$ and $j\in\{1,\ldots,T\}$, we compute whether ... |
Section 6.2.1 of the book "Compilers: Principles, Techniques, and Tools" describes three-address code. Specifically,
Procedure calls and returns are implemented using the following instructions: $\text{param } x$ for parameters; call $p, n$ and $y = \text{call } p, n$ for procedure and function calls, respectively; and... |
Let's assume I have the following 3 clauses:
$\neg T$,$\neg Q$, ($\neg P \lor Q \lor S \lor T)$,$(\neg U, T, \neg S)$,$(\neg U, T, P)$
and I want to see if our KB entails $\neg U$ so I tried to apply the resolution algorithm like below:
$$
(\neg P \lor Q \lor S \lor T) \land \neg T \land \neg Q \land (\neg U \lor T \lo... |
Suppose we have a graph such that we want to apply a maximum flow algorithm(for example Edmonds Karp) on it.
And suppose we only know that graph's diameter is 70 so we want to calculate that's time comlexity .
As you know , Edmonds Karp time complexity is O(V.E^2).
We can conclude that we must know V and E of the graph... |
Consider the context-free language of balanced parentheses of three kinds:
$$L = \{w \in \{ (, ), [,], \{, \} \}^∗ \mid \text{all parentheses in }w \text{ are properly balanced}\} $$
What will be the complement of L? Will it be semi-decidable, Decidable, Context-free, or REG?
I am not sure how to approach this.
|
I am not sure whether this statement is true or not. Could there be an example of CFG generating a regular language and is ambiguous?
|
I may be misunderstanding this. But the halting problem ∈ RE-complete. P ⊂ RE EXP ⊂ RE. therefore EXP^RE = P^RE = RE(my logic might be(is probably)) wrong here, please edit it if it is to be right) Hopefully you get the idea.. Isn't the time hierarchy theorem supposed to hold relative to every oracle, but here it seems... |
I'm stuck on a homework assignment. There are $n$ axis aligned rectangles and we need to find a data structure of size $O(n \log^2 n)$ and query time $O(\log^3 n + k)$ that can give all rectangles completely contained in an axis-aligned query rectangle (where $k$ is the number of contained rectangles).
The course cover... |
Also are there any R complete problems? These would be the hardest decidable problems to my knowledge. Sorry if this isn't specific enough.
|
For a graph theory problem I need to solve hundreds of millions of CNF problems that typically have around 200 variables and 15,000 clauses no larger than 10.
By default I use glucose, which usually takes a fraction of one second. However, in about one case out of a million, glucose doesn't want to finish and I don't s... |
This imprecise question is about a simple example for the following problem.
I would like a Turing machine with few states that accepts only inputs which look complicated to the naked eye.
Of course the Kolmogorov complexity of the lexicographically smallest such input would be at most a constant more than the size o... |
The screenshot is from Georgia Tech's CS-6400. The instructor was talking about inheritance of Sub-Types and Super-Types.
My question is, why are Male and Female created as separate entities from the User entity here? Is it just for illustration purposes? Can we simply add a gender property to User, which values can b... |
Let SMTM be Turing Machine, but the commands recorded in which can change to others in some random way (for example, choose with a 50/50 probability the command to move to the right or move to the left), and SM-NTM be non-deterministic Turing Machine with same property (note that NTM non-deterministic in sense of choos... |
According to Wikipedia: An augmented tree can be built from a simple ordered tree, for example a binary search tree or self-balancing binary search tree, ordered by the 'low' values of the intervals. An extra annotation is then added to every node, recording the maximum upper value among all the intervals from this nod... |
I have the following problem:
Let $H=(W, F)$ a graph and $k \in \mathbb{N^*}$ be an instance for problem $\textbf{CMP}$ (i.e. the clique problem). Let $W'$ a set of new vertices, $|W'|=|H|=n$. We define the following graph, $G=(V, E)$: $V=W \cup W'$, $E=\{xy | x, y \in V, xy \not\in F$ and $|W' \cap \{x, y\}| \leq 1\}$... |
how you doing?
Im here to ask for you help. Im writing my bachelor paper as an implementation/review of the TPP algorithms out there. Almost every paper that I read references the Ramesh algorithm, that returns an exact solution for TPP problems, but I just can't find the algorithm, not even a high level description th... |
I have an algorithm that for $n$ iterations performs some insertions into a set and priority queue. I know that in the last iteration (the case where time complexity is always worst), the time complexity is $O(n \log n)$. I also have more in-depth time complexity analysis if needed but the thing is: The time complexity... |
Let's have a standard topological ordering algorithm (from CLRS):
Topological_ordering(G)
foreach vertex v in V do
v.color = white
for each vertex v in V do
if v.color = white then
Stack = DFS(G, v, Stack)
return Stack
// DFS
DFS (G, v, Stack)
v.color = gray
for ea... |
I'm reading CSAPP and couldn't wrap my head around this part:
Summary of what the section says:
Intel Core i7 support a 48-bit virtual address space and 52-bit physical address space.
Core i7 uses a four-level page table hierarchy.
Then the book shows a picture of the breakdown of a PTE:
Please note the 40-bit PPN.
... |
Edit Jan 31: important special case is when the sums form a nested structure, search for "Hasse diagram is a tree" below
Here's a practically relevant variation on matrix chain problem:
Find optimal way to compute a sum over all weighted paths in a graph, where the weight of each path is the matrix product of edge labe... |
I have a homework task to show that $\mathrm{TILING} = \{(T, 1^N) \mid \text{it is possible to cover } N \times N \text{ square with tiles from }T\}$, where $t\in T$ is $C^4$ for some color set $C$, is NP-complete.
It is not hard to show that $\mathrm{TILING}$ is in NP.
How can I show that it is NP-Hard? Can I reduce s... |
I'm currently trying to show that the language $L_2=\{0^n \text{ } | \text{ } n=2^k, k\geq 0\}$ is not regular by using the Pumping Lemma (at least I think it is not regular, because I couldn't find any regular expressions or DFA for it). I know all the steps that I need to go through, but I am having a very hard time ... |
For a formal problem statement, I quote from the text Introduction to Algorithms by Cormen et. al
Suppose we use a hash function $h$ to hash $n$ distinct keys into an array $T$ of length $m$. Assuming simple uniform hashing, what is the expected number of collisions? More precisely, what is the expected cardinality of... |
Suppose we are given n open intervals $(a_1, b_1), ..., (a_n, b_n)$, with interval $i$ being assigned a weight $w_i$ for all $i$. Define a "good subset" of intervals to be a subset of those $n$ intervals where each pair of intervals in the subset overlap (i.e. share a common value). Given an integer $k<n$, we would lik... |
I'm learning assembly programming and I can't seem to get my head around the register usage, as I'm using emu8086 which emulates old 8086 processors.
According to 8086 (16-bit architecture) the four General Purpose Registers are:
My confusion is: why does using DL and DH give different results, as they both are the lo... |
Suppose we are given $n$ open intervals $(a_1, b_1), \dots, (a_n, b_n)$, with interval $i$ being assigned a weight $w_i$ for all $i$. We are given an integer $k<n$, and we are allowed to choose $k$ arbitrary numbers. Suppose an interval is covered if it contains one of these $k$ numbers. With an $O(n\log n)$ algorithm,... |
So, I have an issue with the following problem (CS 161 Stanford 2013, Problem Set 2):
Suppose that you have found a collection of historical records indicating the relative order in
which various people lived and died. Each record tells you one of the following:
• Person A and person B were alive at the same time.
• Pe... |
Suppose that I have a 2D array $B[i,j], 1 \le i,j \le n,$ such that $B[i,j]=X$ or $B[i,j] = O$. I want to write a program to check if there is a path that exists from $B[1,1]$ to $B[n,n]$ that only consist of $O$'s. The path must only consist of the 4 directions: North, South, East, West and does not include the diagon... |
If you created two very large numbers represented by binary data (perhaps using sha512 with random input for each hash) could you determine what binary block is numerically larger by iterating over bytes from left (largest bit) to right (smallest bit)? If at any point the left has a 0 bit where the right has a 1, you’d... |
I just completed a Data structures and Algorithms course in my university. I know how data structures work and how different DS are used to solve specific and to improve efficiency. I have also started to work with databases to develop CRUD applications.
My question is: If I have to for example, use a tree data structu... |
I'm trying to understand how you compare the following for order of growth.
With the below working out with $f_4$ I don't get where the $x^5$
and $x^6$ come from at the end. With $f_4$ you have $n^{\log n}$ when
for example $\log 64$ doesn't equal 6? Can someone please explain where
$x^5$ and $x^6$ come from?
Working ... |
Why is option "(C) $n^{1.98}$ is $O(n^2)$" the question below correct? Is it because "Big $O$" is upper bound meaning worst case, therefore $n^{1.98}$ is not worst case $n^2$ ?
How is it still $O(n^2)$? Wouldn't it have to be equal to it, not $.02$ less?
Secondly, regarding (A), how do you work out if $2^{20} n$ is $O(... |
Suppose that matrix A is a symmetric positive definite matrix over the integers, i.e., $A \in Z^{n\times n}$, if B is a matrix over the real numbers, it is not difficult to find B such that $A = B \cdot B^T$. However, if B is restricted to be an integer and square matrix, in general, there is no solution. It is known t... |
I am asked to find a probabilistic algorithm to determine the size of the maximum matching of an arbitrary simple undirected graph $ G $.
My claim is that, it is equivalent to find a global min cut on $ G $ (where each edge had capacity 1). To find that, I can output all $n \choose 2$ min cuts, determine the longest an... |
I have a set of numbers and I want to find the sums of all possible pairs of elements. With the set $\{1, 2, 3\}$ for example, I would want $\{1+2, 1+3, 2+3\}$ as my answer. I could do that in n^2 time complexity by starting at the first element and adding all the other elements to it one-by-one and then moving to the ... |
"Introduction to algorithms" also known as CLRS, proves the correctness of the algorithm to compute the Strongly Connected Components in two ways, one of which is
Here is another way to look at how the second depth-first search operates. Consider the component graph $(G^T)^{SCC}$ of $G^T$. If we map each strongly conn... |
I was told that the runtime of OCAML or Scala is EXPTIME - which seems really bad! However, since people use type inference (deciding the type of a term or program or expression) in practice - it must be fine in programs humans write somehow.
I was looking for an official reference for such a facts - especially in the ... |
I am talking in reference to this question from this compiler test. I think it is actually true that a GOTO and REDUCE can't be present in the same set, but am having a hard time coming up with an example or counterexample.
Pls provide and example and explanation to make me understand.
https://gateoverflow.in/299820/Go... |
We are given that the following algorithm finds the vertices inside a negative cycle and we need to show an example for it such that it fails.
for each v in V
dist[v] = inf+
dist[s] = 0
for i=1 to |V| - 1
for each (u,v) in E
relax(u,v,w)
for each v in V
dist'[v] = dist[v]
for i=1 to |V|
for each (u,v) in E... |
Given points $x_1, \ldots, x_n$ in the Euclidean space and $K \in \mathbb N$, I'm interested in the following objective.
Partition the points into $K$ clusters $C_1, \ldots, C_K$ so that:
$$\max_{i \in [K]} \frac{1}{|C_i|}\sum_{j \in C_i} \|x_j - \mu(C_i))\|^2$$
is minimized, where $\mu(C_i) = \frac{1}{|C_i|} \sum_{j \... |
Looking for any idea for reduction from $SAT \leq 3-SAT$ where $SAT$ is known to have $d$ variables at most in each clause. I am looking for a reduction in which the resulting formula will not depend on the value of $d$. The classical reduction adds $O(d)$ new variables per clause, so this is not good to my case.
Do su... |
Suppose given $T= a_1\leq a_2\leq\dots\leq a_n $ that $a_i$ is real
number and given a number $k$. we want to find $k$ triples $x_i\leq y_i\leq z_i\in T$ such that
$$\sum_{i=1}^ k (y_i-x_i)^2$$ minimized, also each $a_i$ can belong to at most one triple.
How we can solve above problem in $O(nk)$? I think it's possib... |
Here is the full version of the problem I'm dealing with.
Let $G=(S,T;E)$ be a bipartite graph and let $X$ be one of the two classes of its bipartition (i.e., $X \in \{S,T\}$). For a subset $C \subseteq X$ we define: $$\sigma(C)=\min\{0, |N_G(C)|-|C|\},$$ where $N_G(C)$ is the neighbourhood of the subset $C$ in $G$) (... |
In digital signatures, the private key is used to encrypt a (hashed) message and the public key is used to decrypt it. This made me wonder since the receiver has the cipher text (digital signature) and can easily reach the original plain text— by decrypting the digital signature using the sender's public key— if there ... |
I've seen the classical proofs of CFLs are not closed under intersection or complement, but I haven't been able to wrap my head around this. Intuitively, I think that this would be not a CFL but I can't think of any counterexamples.
|
Given a full binary tree with 256 leaves and depth <= 64,
let H be the set of Huffman codes described by the tree (using 0 to go left, and 1 to go right, where the most significant bit represents the move from the root node
e.g. "100" means that starting from the root, we head right, then left, then left
transform ... |
What's the sum of heights of a random binary search tree?
By a random binary search tree, I mean the usual definition: you have $n$ keys to be inserted, and all Permutations are equally likely.
The sum of heights is the sum of the heights of each node. similar to Sum of heights in a complete binary tree (induction)
My ... |
The standard LP gap example for the held karp relaxation for TSP
min $ c^tx $
$x(\delta(S)) \geq 2 $
$x(\delta(v))=2 $
$x \geq 0$
Is to have two triangles and three long paths connecting the corresponding vertices yielding a 4/3 integrality gap example.
Does this not work for Euclidean TSP? I saw this paper here ... |
Let $R = \{\emptyset,a,\epsilon\}$ (the elements here are regular expressions) and let $+$ be the or operation, which can be applied over the regular expressions of $R$. Is $(R,+)$ some kind of an algebraic structure, such as a subgroup, a monoid, or a group?
I was told that it is monoid and that $(a+\epsilon)=a$, and ... |
CAN SOMEONE FIND A BETTER (MORE DESCRIPTIVE) NAME FOR THIS QUESTION, THANKS
I recently thought of this interesting Tree problem:
Given a tree with $N$ nodes, let $val_i$ = the "value" for each node. Process $Q$ queries of two types: the first consisting of a single node $i$. For this type of query, $val_j += dist(i, j)... |
Here's a simple question but I'm not sure there is a simple answer. This came up in an undergraduate algorithms class.
Consider the following divide-and-conquer algorithm $A$ (here, $x_1, \ldots, x_n$ are bits; assume $n$ is a power of 2 for convenience):
$A(x_1, ..., x_n)$:
if $n=1$ then return $x_1$
Else return $A(x... |
I remember learning in a class that type inference is decidable but usually takes a long time (e.g. type inference in OCaml is EXPTIME).
I was wondering, since Coq allows programs/values themselves to be in the Type somehow my guess would be that type inference is either:
Doubly EXPTIME
Undecidable
Does someone know ... |
Here's a problem that uses graph to find task assignment among a group of workers. Assume there are N number of tasks to be completed, with dependencies among the tasks. For example, task i depends on task j, which depends on k, etc. A directed graph can be used to model this, G = (V, E), where the Edge (a, b) implies ... |
I have a set of $n+\binom{n}{2}$ random variables $\{x_i\}^{i=n}_{i=1}\cup \{x_{ij}\}_{i\leq j}$ and their probability distribution is given as:
$$P(x_1,...,x_n,x_{12},...,x_{ij},...x_{nn}) = \prod_{i}P(x_i)\prod_{i\leq j}P(x_{ij}|x_i,x_j)$$
Now, this can be represented as a bipartite Bayesian Network with the followin... |
I have a server. It has e.g. one million documents. My website has a spreadsheet. Each page has space enough for e.g. 50 rows. As I scroll down, I will want to request the rows from the server, and I will cache the range I asked for in memory.
However, if I scroll up again (or place the scrollbar arbitrarily), I only w... |
I have an undirected graph $G=(V,E)$ and I want to find an ordering of $V$, $\pi=(v_1, v_2, ..., v_n)$, such that for each $1 \leq i \leq n$, $v_i$ is of minimum degree in the subgraph $G_i = [\{v_1, ..., v_{i-1}, v_i\}]_G$ in $O(n+m)$ time, where $n=|V|$ and $m=|E|$. I also have to prove that if $G$ is a tree, then a ... |
Given the address 00011001111011101111101011011111 and it save a value
0x1FA0CBB7. Calculate the memory size in KB
What i try: the address has 32 bits so the memory size is 2^32 = 4294967296 bytes but then i wonder so the value 0x1FA0CBB7 for what ? I'm not sure i'm doing right.
Can someone help me solve this problem... |
A problem : Given a string of number in base $10$ we want an algorithm to calculate the number of numbers, where we replace (only) a single digit to produce a number so that that number is divisible by $3$.
example of input and output:
If the input is "23", the algorithm should produce an output $7$ since all the numb... |
This is a really short question and a straightforward one for anyone who knows the subject well. But its also super specific, so I can't find the answer online.
I know a program counter is saved when a context switch occurs. I can't seem to make sense of how this could happen in software. In order for the CPU to run th... |
I have a problem and I'm not sure where I am going wrong with this, description
so as you can see it is given a 3 level paging system with 8 bit page index on every level, now I break down logical address as ( 8+8+8+12 ) first 24 bits being page no bits in logical address space, and 12 being page offset bits, with tha... |
We often hear about some algorithms' running time that is polynomial, and some algorithms' running time that is exponential.
But is there an algorithm whose time complexity is between polynomial time and exponential time?
|
"We cannot recognize a set of languages as the language themselves"
What is the meaning of the line and why we cannot do it and how is the encoding of TM is helping in that?
|
I have a set of parameters $\{\alpha_s\}$, and I have $u$ functions of the form $w_i(\{\alpha_s\}) = \prod\alpha_s^{c^{i}_s} $ for some known values of $c^{i}_s$. Similarly, I have $b$ functions of the form $w^{ij}_l(\{\alpha_s\}) =\prod\alpha_s^{c^{ijl}_s} $. Now I
the following optimisation problem to be solved:
$$\t... |
I'm having trouble understanding the simplification of the following regular expression
\begin{align}
R = ε | 1 | (ε | 1)(ε | 1)^*(ε | 1) = 1^*
\end{align}
In my lectures only the simplified solution was given but not the steps. I tried on my own but only came this far:
\begin{align}
R & = (ε | 1) | (ε | 1)(ε | 1)^*(ε ... |
I'm looking for some algorithms/patterns to solve a distributed systems problem.
Lets say I have created a trading platform buying stock (I haven't), and I have a distributed system of 50 nodes that are making these purchases for me. I also know that I have a budget of $50k, and it needs to be spent by the end of the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.