instruction stringlengths 35 11.4k |
|---|
I want to approximate a Gaussian function as shown below
$$
e^{\frac{-\|x-c\|^2}{2\sigma^2}} \approx \sum_{i=1}^{N}\alpha(c,c_i)e^{\frac{-\|x-c_i\|^2}{2\sigma^2}} \forall x
$$
Here c, $\sigma$ and $c_i$ are known. Are there functions $\alpha(c,c_i)$ which gives a good approximation? The limitation I am facing is that I... |
Let's say $\sum_{n \ge 1} a_{n}x^n$ is generating function for regular language $L$. $a_{n}$ is number of words with length $n$.
Find an example of generating function which isn't correspond for any regular language.
My attempt : I use the fact for any regular language there is exists $n_{0}$ $\lambda_{i}$ and $p_{i}$... |
I have been asked to find a grammar that will generate the language $a^{n(n+1)/2}$, where $n\ge1$ as an exercise. Any idea on how to set up such grammar? Any help would be appreciated.
|
I'm simulating a procedure that assigns tasks to servers and want to estimate the average waiting time until a task is served (finds a free server).
This procedure runs periodically, thus every task that is rejected in a run can try in the next runs until it finds a free server.
The inter-arrival times of tasks follow ... |
Cryptographic security is usually proven against P/Poly adversaries as this encapsulates the possibility for someone to do heavy precomputation to be used later, eg. rainbow tables.
However actually finding this advice string is assumed very impractical for large instances, rendering the process generally infeasible.
S... |
I'm trying to prove that the language $L=\{a^nb^mc^k | k ≥ max (m,n) \}$ is not CF. I consider the word $\alpha = a^pb^pc^p = uvxyz$ and i break the proof to the following cases :
1) if $vxy = a^l, b^l$ or $a^kb^l$ for some $k,l \le p$ i pump the word up, so
$a^l+s, b^l+s, s > 0 : l+s<p => \alpha \notin L$
2) if $vxy$... |
I need to write a regular expression for all words over $\{a,b,c\}$ not containing $aaa$, $bbb$ or $ccc$. Will appreciate any help. Note: this is not homework.
|
In common ANN, nodes are based on a activation function, like a sigmoid or tanh or ReLU. Updates of synaptic weight are based on the derivative of this function.
When node are represented with spiking neurons, what does activation function become ? how updates of synaptic weight are done ?
|
From Wolfram:
A polynomial time algorithm is however known for planar graphs (Hopcroft and Tarjan 1973, Hopcroft and Wong 1974) and when the maximum vertex degree is bounded by a constant (Luks 1982; Skiena 1990, p. 181).
What are the running times of such algorithms, in terms of size of the graphs? What algorithms ... |
A boolean-valued monotonic function is defined in the set of positive integers, $\mathcal Z$.
$$f(n) = \begin{cases} 0, &n_{min}\le n < n\ast\\1, &n\ast\le n\le n_{max} \end{cases} ; n \in \mathcal Z $$
The goal is to search for $n\ast$. The bounds $n_{min}$ and $n_{max}$ are known apriori.
A salient property of $n\ast... |
I need to swap two integers using only integer addition and multiplication gates.
I can't subtract them. I'm dealing with a sorting network, so I need to compare and swap. The compare and swap operation swaps only if the integers being compared are in wrong order. I've to implement this operation using just integer add... |
$T(n) = 1+ \sum_{j=0}^{n-1} T(j)$
I've proved $2^n$ be the solution of this equation using induction. But is there any other way to find the solution? I just proved not solved.
|
How do we prove the correctness of this pseudo code by induction?
fastfib(integer n)
if n < 0 return 0;
else if n = 0 return 0;
else if n = 1 return 1;
else a ← 1; b ← 0;
for i from 2 to n do
t ← a; a ← a + b; b ← t;
return a;
end
|
I am trying to find the following:$$ \text{For a given TM M with initial empty tape is it possible to decide whether there} $$
$$\text{exists a constant K such that the head of M remains within the first K slots?} $$
I thought this was possible if you know $K$, since you could add the current configuration to a separa... |
I have a treap like the first image and I want to reach the second image to restore min heap order property. I can't understand which kinds of rotations have been done.
Image 1
Image 2
|
Input: Given sets $S_i \subseteq \{1,2,3,4,\cdots,n\}$ for $1 \leq i \leq n$.
Output: sets intersection with restriction (pick first set $S_1$. If $a \in S_1$ such that $a$ is the least element then do $S_1\cap S_a$. Next go to least element (say $b$) in $S_1\cap S_a$ and do $S_1\cap S_a \cap S_b$)
Finally I want to fi... |
Suppose we have a 2-layer neural network completely connected with $d^{(0)}$ input units, $d^{(1)}$ hidden units and $d^{(2)}$ output units. We consider the error function given by $J(w) = \frac{1}{2}\sum_{k=1}^{d^{(2)}}(t_k-c_k)^2$, where the vector $t = (t_1,\dots,t_{d^{(2)}})$ represents the labels and $z = (z_1,\do... |
Referring to Tim Roughgarden's Lecture Note - 2 (page 11) on CS261 at Stanford following statement and the para seem quite confusing.
Claim: d(f) never decreases during the execution of the Edmonds-Karp algorithm.
https://www.youtube.com/watch?v=uM06jHdIC70
Can anybody shed some lights on it?
Suppose the Edmonds-Karp... |
I understand that we can approximate solutions to Integer Quadratic Programming optimization problems containing just a positive semi definite matrix, as outlined here (i.e. the Q matrix):
https://learning-modules.mit.edu/service/materials/groups/116310/files/c33fb8f4-417a-46b2-9772-7c44b8912290/link?errorRedirect=/mat... |
Design a data structure for holding numbers in two sets:
Init - initiate the DS with two empty sets. O(1)
Insert(a,S) - insert number a to set S (S could be X or Y). O(log(n)). (n is the total number of numbers in the DS)
Find - find a number a in the DS such that the number of numbers in X that are smaller than a equa... |
I want to prove that no PSPACE-complete problem is in NL using the space hierarchy theorem. What I want to say is this :
From the time hierarchy theorem I know that for every $t(n)$ there exists a language that is decidable in $O(t(n))$ space but not in $o(t(n))$ space. Then I want to assume that there exists $A \in PS... |
I have several questions that do no make sense for me.
First Question:
A stack can be implemented with an array A[0..N-1] and a variable pos. The push and pop operations are defined by the following code.
push (x)
A[pos] <- x
pos <- pos – 1
end push
pop ( )
pos <- pos + 1
return A[pos]
end pop
Which of the... |
You are given functions $f$ and $g$ such that $f(n)=O(g(n))$. Show that $f(n)\log_2(f(n)^c)=O(g(n)\log_2(g(n)))$. (Here $c$ is some positive constant.) You should assume that $f$ and $g$ are nondecreasing and always bigger than 1.
My solution: There exists $c_1$ such that $f \leq c_1 g$. Note that all $\log$ function... |
I am dealing with a standard MIPS architecture. If I have a branch instruction, for instance, beq, I know the results of the comparison in execute. However, the branching logic is actually in memory stage. Hence, doesn't that mean that I am technically losing 3 cycles(if the branch is taken) since the correct instructi... |
I know that bit-wise operations are so fast on modern processors, because they can operate on 32 or 64 bits on parallel, so bit-wise operations take only one clock cycle. However addition is a complex operation that consists of at least one and possibly up to a dozen bit-wise operations, so I naturally thought it will ... |
Let's say I have a function that consists solely of floating-point operations where the last operation rounds the computed value to a predefined number of digits. And I feed this function with a range of floats.
How do I conclude - just by looking at the decimals of the operand(s), and the structure of the code / seque... |
What does the following symbols or expression mean?
|
The standard algorithm to generate hashes of files which are downloaded is MD5. For example, when ISO files of Linux distributions are offered most of the time they also give the MD5 sum so that you can check if an error happened while downloading the file.
I'm aware of the fact that MD5 should not be used for password... |
I'm reading several papers about different broadcast algorithms. Most of them are designed for crash stop model but they also consider contamination scenarios.
For example for a Causal Atomic Broadcast when a faulty process
fails to delivers messages in order and then starts broadcasting other
messages based on i... |
I know that there is an inherent limit to how much you can compress data using lossless compression.
Basically, the only thing lossless compression can do is reduce dependencies between symbols, remove repetitions, and so on, so that the result looks more like completely random data rather than what we usually see.
Fr... |
I'm creating a semantic analyzer with type inference. For the basics I've got a type variable and a type construct with name and a list of types.
I want to support overloading and I know that Haskell uses something called type-classes. So if I understand correctly, when I call an overloaded function 'foo', I give multi... |
Given a undirected graph $G=(V,E)$,find a shortest circuit(it ends at the same point it starts) which through every edges at least once.As we all know,we can easily solve it with Edmond's algorithm which has a complexity of $O(|V|^3)$
If we assume that the weight of each edge is 1,and $|V|=O(|E|)$,is there a fast way t... |
I'm trying to understand the definition of program analysis on Wikipedia:
Program analysis is the process of automatically analyzing the behavior of computer programs regarding a property such as correctness, robustness, safety and liveness.
What is the meaning of "automatic" here?
Are parsers static analysis tools, ... |
I have come across algorithms that can create a BST if any two of the 3 traversals are given (there would be three different algorithms for the 3 combinations)
This is an example
I was wondering, is it guaranteed that a tree generated would be unique? Or rather, can multiple trees be generated satisfying the two traver... |
I'm having some issues constructing a transition diagram of a deterministic Turing machine for $L = \{0^i1^j2^j3^k \ | \ i = j + k\}$
The point where I get stuck is how I should make sure that $i = j + k$
My thoughts:
My thought was to initially do something similar to do something including an addition turing machine... |
Say beauty pageants are judged based on 3 criteria: 1) Appearance 2) Personality 3) Talent. A contestant $C$ will beat another contestant $C'$ if she gets higher scores in ALL THREE of the criteria.
There are $n$ girls competing. Contestant $C_i$ is "Model Material" if $C_i$ is not beat by any other contestant $C_j$. ... |
I need to write a sorting algorithm which will sort an array $A[1..n]$, $1 \le i \le n$ such that $A[i] \in \{1,2,..,n^5 \}$, all numbers are positive integers in $\Theta (n)$ time.
The solution must use some combination of radix/counting/bucket sort and possibly select algorithm, it can't use any advanced concepts o... |
I think I understand pumping lemma for regular and context free languages, but there is this one, which I have no idea if it is regular or context free or not context free.
$L = \{vwwx : v,w,x \in \{0,1\}^* \wedge w\neq \epsilon\}$ - I think it may be regular, because I think that this is language, which accepts set of... |
First, some context: I'm reading this blog post by Andrej Bauer.
So, I stumbled in these terms: "observational equivalence" and "contextual equivalence".
I know almost nothing about operational semantics ... I know it gives meaning for terms by it's reduction to normal form, if I'm not wrong.
Extensional equality says ... |
I have recently been involved in a discussion with someone who doesn't accept that lossless compression is possible, even in principle. This person considers himself to be technically literate, and an expert in his field of audio engineering.
I and several others have patiently tried to explain how lossless compression... |
I got riddled by the following problem: Wikipedia states (without citation)
Cryptography, for example, relies on certain problems being difficult. A constructive and efficient solution[Note 1] to an NP-complete problem such as 3-SAT would break most existing cryptosystems including:
[...]
Exactly how efficient a solu... |
Consider the following optimization problem:
Given $n\leq 10^3$ vectors $v_i\in\mathbb{R}^2$, all of which are small, i.e., $\|v_i\| \leq 1$, find a subset $S$ of them that minimizes
$ \| w + \sum_{i\in S} v_i \|^2$, where $w$ is a fixed known vector.
I know that this can be reduced to an unconstrained 0-1 quadrat... |
I am debugging an FFT. My FFT uses complex numbers in polar form, $(r,\theta)$.
I am trying to establish that it works, with a unit test. My real values are all correct, after a polynomial multiplication...
However, I pad out my polynomials to a power of two with complex zeros, and when the multiplication is compl... |
I'm not sure if cs.stackexchange.com is correct place to ask this question but it looks like most relevant.
On the job interview I was asked a question: lets say we have a very large file, containing a lot of lines with strings. And lets say that one line is a "document". We are building service which takes some string... |
I'm learning about the Savitch's theorem, and while the construction proof is straightforward, I still don't understand one part about it.
The proof I'm talking about is the same as is currently on Wikipedia. It starts by describing a function - let's call it CAN_YIELD(start, end, limit) for now.
It is then said that ... |
Consider a three word machine instruction
ADD A[R0], @B
The first operand (destination) “A[R0]” uses indexed addressing mode with R0 as the index register. The second operand (source) “@B” uses indirect addressing mode. A and B are memory addresses residing at the second and third words, respectively. The first word of... |
It is pretty hard for me to understand, how binary representation of number may be context free. This language $L=\{bin(n)bin(n+1)^R : n \geq 0\}$ is context free.
Here, at 1.b, is a PDA which describes this language, so it is context free. I've tried to construct a context free grammar for this one, but I have no idea... |
An article called The Derivative of a Regular Type is its Type of One-Hole Contexts shows that the "zipper" of a type—its one hole contexts—follow the differentiation rules in type algebra.
We have:
\begin{align}
\partial_x x &\mapsto 1 \\
\partial_x 0 &\mapsto 0 \\
\partial_x 1 &\mapsto 0 \\
\partial_x (S + T) &\mapst... |
I’m trying to figure out if what I’m doing would classify as Information Retrieval. According to this Thread:
Information retrieval is based on a query - you specify what information you need and it is returned in human understandable form.
I’ve a script that reads unstructured text (titles of books) and extracts nam... |
This is a follow-up question to the Why shuffling by picking random position in all array instead of a part is not correct. I understand if I pick random numbers from all the range for 4 numbers every time the distribution won't be uniform. That's why improved Fisher–Yates shuffle algorithm picks numbers from the small... |
I was recently given an assignment at university asking me to discuss the universal computational capability of Conway's Game of Life.
I'm not required to actually build up a Universal Turing machine in Life, but rather I'm supposed to provide a step-by-step explanation of universality of GoL (as well as the meaning of... |
I was revising Computer Science and I got these two doubts to which I've found contradictory answers on Google:
In a serial communication which bit is sent first?
When using a parity bit with ASCII is it set on the LSB or MSB?
Logically thinking I thought the answers should be 1- MSB first and 2 - set on LSB. Am I ri... |
Given:
graph with colored edges;
list of $\alpha$ colors;
list of $\epsilon$ colors;
clique size $k$.
Problem:
Do all edges colored in one of $\alpha$ colors are members of cliques with size $k$?
Isn't there an edge of some of $\epsilon$ color that is not contained in clique of size $k$?
Example:
Given some graph t... |
Here is the problem. We have N jars. Each jar can have any number of beans. These beans have to be distributed among C children. The resulting distribution should serve two goals Now
the number of beans that each child gets must be the same (+/- 1 when total number of beans is not a multiple of C)
each child to get a... |
In the scope of my scheduling research, the question has been raised on whether distance-preserving permutations can be constructed easily.
Suppose that our domain is the set of natural numbers up until $n$, that is: $D=\{1,2,...,n\}$ where $n\geq 1$.
A permutation $\pi$ is a distance-preserving permutation in my conte... |
The subset query problem is defined as:
Given a list D of size N where the entries are subsets of a universe with m elements, create a datastructure that detects for every query-set Q if there exists a set P in D so that Qis a subset of P
I was wondering what are the best known algorithms to solve this problem. I could... |
There are nice examples for context free grammars which cannot be expressed with regular language, for example the palindrome and a similar contrived example here, but they are very intuitively applicable for formal languages, e.g. checking for balanced nested parentheses and such.
Can you conceive an example that is ... |
the question goes as follows:
In a B-tree (d,2d) of height h, what is the minimal and maximal number of inner-nodes (excluding leaves)?
My idea:
Minimal: The root is 1, it has a minimum of 2 children, therefore we have 1 + 2, and then for any level below each node will have the minimum nodes allowed which is d. We get ... |
The LZ77 compression algorithm uses a sliding window technique, where the window consists of a look-ahead puffer and a search-buffer. What I am wondering is how the algorithm handles the case if the match of the word in the search-buffer is the entire word in the look-ahead buffer? According to the desriptions I find, ... |
Consider a while loop of the form :
$\texttt{while (C) {S}}$
with $\texttt{C}$ the condition and $\texttt{S}$ the body of the loop.
Let $\texttt{I}$ and $\texttt{V}$ respectively be an invariant and a variant of this loop. The rule for total correctness of while loops is given in my textbook by:
If $\texttt{I} \Righ... |
Given a number of sets, what is the best algorithm to calculate the smallest set S such that S is not disjoint with any of the given sets?
|
I asked this question on cstheory.se before, where someone pointed out that it is equivalent to asking whether P=NP implies NL=P (thus I edited the question accordingly).
However, my supervisor claims that actually, connectivity being NP-complete implies that NL=P=NP. I can't see why this would be the case; the only a... |
Djikstra's algorithm assigns some number to non-removed vertex each time it finds a path from removed vertex to it. Number of assignments is $\mathcal{O}(|V|^2)$. However, complexity of assignment is not $\mathcal{O}(1)$, it is $\mathcal{O}(\log s)$, where $s$ is weight of the path from initial vertex to current.
And t... |
I'm trying to teach myself a bit about machine learning, so one of the first things I did was implement a KNN classifier in ruby. My goal was to classify text product reviews into 8 classes:
books-positive
books-negative
kitchen-positive
kitchen-negative
dvd-positive
dvd-positive
electronics-positive
electronics-nega... |
Prove that $BPP^{BPP} = BPP$.
Obviously $BPP\subseteq BPP^{BPP}$. So we're left with proving $BPP^{BPP} \subseteq BPP$. Let's consider $L\in BPP^{BPP}$. Then, there's a PTM $M$ to decide $L$ for some $BPP(\alpha, \beta)$ which uses an oracle for some language $O\in BPP$. $O$ also has a $PTM\in BPP$, let's denote it $... |
I was wondering if there is any theoretical results characterizing under what condition does greedy algorithm actually finds the optimal solution.
Here is a motivating example. Suppose you are trying to find
$$\min_{x \in \mathbb{Z}^2} f(x)$$
where $f$ is convex, and the minimizer happens to be on an integer point $(a,... |
In my AI lecture notes (also many other AI lectures) it's written that uniform cost search is optimal (that is, uniform search always outputs the optimal path), but what if the cost is negative, won't the search algorithm possibly trapped in infinite loops? If solution is using a closed set to track explored nodes, we ... |
I need come up with an algorithm for detecting a cycle in an undirected graph where the algorithm is in $RL$. That is, the algorithm detects a cycle with a probability greater-equal to $\frac{1}{2}$ but it doesn't return true for a graph with no cycle (no false-positive).
In class, we've learned that $USTCONN$ (the pro... |
As I found out here: http://www.eclipse.org/jdt/core/howto/generate%20parser/generateParser.html , the Java Version of 2005 (might be Java 6, I'm not sure) is a LALR(1) grammar. However, I couldn't find out if the Java 8 grammar still is a LALR one. I found some Java 8 grammar on GitHub (https://github.com/antlr/gramma... |
I tried to make a program printing out the contents of the file text.txt,
but for some reason it only prints out the even letters.
What have I done wrong?
|
Let $A\in NP\cap co-NP$. Then, $NP^A = NP$.
At first, I thought: Easy, let $L\in NP^A$ s.t. $A\in NP\cap co-NP$. Let $M_L$, an $NDTM$ to decide $L$ and $M_A$, an $NDTM$ to decide $A$. Then, we could create a new $NDTM$, $M$ which acts the same as $M_L$, but instead of calling the oracle, it simulates $M_A$ on the ora... |
Language $L$ is in $\mathrm{P}$ if and only if there exists some Turing Machine $M$ such that for every word in $L$, $M$ either accepts or rejects it in polynomial time. Right?
But what if all we know about our language is that there exists TM $M'$ such that for every word in $L$, $M$ accepts it in polynomial time, bu... |
I have some questions about the ideas proposed in this video.
The speaker shows an array that holds values and pointers, and he also shows a separate "free" linked list, that is updated whenever an item is added/removed.
Why are these used? Doesn't using an array / limiting yourself to a set of free nodes defeat the pu... |
I tried to solve this question,
We have this Language, L(g)={AA|A={0+1}*}
The output(Productions) must be similar as these = {(11 11), (0 0), (1101 1101), etc..} The left side equal to right side..
VT={1,0}
The problem I used a lot of methods to solve this, like pumping lemma.
This question isn't easy, I hope someone c... |
Initial Problem:
Given an interval $[A, B]$ and a set of intervals $S = \{[S_{11},
S_{12}], [S_{21}, S_{22}], [S_{31}, S_{32}], \ldots, [S_{N1}, S_{N2}]\}$
with $S_{11}\leq S_{21}\leq \cdots \leq S_{N1}$ output True if and only if
$[A, B]$ is completely contained in the union of all intervals in $S$,
and False o... |
I'm looking for a formal definition of "graph levels" on a DAG. This example should illustrate what I mean by this.
The node 0 has no edges directed towards it, therefore this has level 0. Next is is 3 and 4 which will have level 1 and so on.
Level 0 : node 0
Level 1 : node 3, node 4
Level 2 : node 1, node 2
Level 3 :... |
I've just started learning C. Can anyone tell me whether my code is correct or not, if not what's the correct version? This is code for counting number of leaf nodes. Is this efficient one if this is correct?
void Count_leaf( Tree* head)
{ static leaf = 0;
if(head.left==NULL && head.right==NULL)
... |
I am looking for the terminology/concepts which express the nontechnical notion of the "layer" structuring of programs, the languages in which they are written, and a formal type theory.
For instance, we might have types defined for a single module, written in a language with a certain type system which may be a subset... |
In an answer of this Reddit discussion somebody defines referential transparency (RT) as "a context $K[ ]$ is RT if, for all $M$ and $N$ s.t. $M = N$, then $K[M] = K[N]$". Based on this definition, Lambda Calculus (LC) (and any other language with binding constructs) is non-RT.
For example, let $\Omega = (\lambda w.ww)... |
Suppose those random variables are represented as scalar time series with nonlinear relationship (thus applying linear correlation or covariance would be futile) that may change over time, then is there a machine learning algorithm that would approximate or "learn" such relationship?
|
I'm studying value representation in modern languages. The idea is that since in many situations the size of objects can be unknown, one can introduce a box representation of it. This box representation is just a block stored at the heap with a tag to identify it.
My questions is as follows: who deals with the size of... |
I understand that rate monotonic scheduling assigns a priority to a process based on the periodicity of the tasks it generates and the process with the shortest inter-task period has the highest priority but i am confused as to why in this particular scenario p1 will miss its first deadline?
PS Sorry but english isn't... |
Graph
Is
1) A D F E G C B and;
2) A D F E G B C is one of deep-first transverse?
The code below is written in java and method1 and method2 is two different implementation.
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Stack;
/**
* Created by raymond on 12/05/2017.
*/
class Node {
publi... |
I'm looking for an appropriate technique to search for clusters. My underlying data is 70,000 respondents to about 2500 multiple choice questions. Most respondents have not answered most questions. I have no expectations as to how many clusters I might expect or how clustered this data might be but am interested to exp... |
Here N represents the number of elements in the multi-tree.
Please state the algorithm that you have used to do so. It would be great if you can implement this in Java/C++ too and post the code as well.
Also I used union-find to initialize the tree. You can consider or not consider this algorithm. I just need the algor... |
What happens if you run Kosaraju’s algorithm for finding strongly connected components of directed graphs on a DAG?
|
Given a connected, undirected, weighted graph $G$, the condition
The maximum-weight edge in any cycle of $G$ is unique.
is not necessary for $G$ to have a unique minimum spanning tree (MST).
However, is this condition sufficient for $G$ to have a unique MST?
|
I'm working on a kNN classifier to classify whether a text is written by a man or a woman on the basis of the most frequent words. However, a kNN doesn't show which features were the most important in the classification. I got the suggestion to fit a logistic regression on my training data and labels to see which words... |
// assume 'n' is given.
What is the time complexity of this code ?
java.util.LinkedList<Integer> k = new java.util.LinkedList<Integer>();
for(int i = 0;i<n;i++)
for(int j = 0;j<n;j++)
k.add(k.size()/2,j);
|
Punishment is reducing a behaviour due to bad outcome e.g. A cow stops touching an electric fence because it gets a shock.
Negative reinforcement is increasing a behaviour that reduces a bad outcome. e.g. Put on a seat belt to stop the car bleating.
In this context, how are neural nets trained by Reinforcement Learnin... |
I am creating a software that computes the cosine similarity between 2 strings.
I am using Spark as I have to use Java. I created a Bag of words model and computed the cosine similarity successfully.
Feeding the same sentences to the software and substituting the bag of words model with a TF-IDF the similarity between ... |
If processors can only execute one thing at a time, how come I can play music continuously and still be able to run other tasks?
I understand the interrupt system, but isn't it needed that CPU continuously process audio for it to not sound jittery/laggy?
I am asking about the underlying implementation, is this question... |
In two way non-deterministic finite state automata there is the concept of reject state.
Since an input is accepted if any one of the parallel branches in the Non Deterministic FSA reaches an accept state and the rest of the branches are then immaterial.
On a given Input even if one of the branches reaches the 'reje... |
"In a 2-way set associative cache of 4 blocks containing 4 words each, which one of these addresses will return a hit when being read? The blocks to be retained in the cache are decided by LRU."
4 word / block means that the offset = 2 bits.
2-way means 4 blocks / 2 = 2 sets. The index then needs 1 bit.
And thus the ta... |
Assuming I have a very simple branching:
switch on var:
1 => branch1
2 => branch2
default => branch3
And I wish to implement a program that will forever take "branch2" when entering this sequence of instructions once branch2 is taken.
This is quite easy to do by adding an additional variable and setting it when... |
This time complexity comes from $N$-queen problem. There are many threads talking about the time complexity to be $O(n!)$ but I cannot figure out how we get it. Here is the progress I have so far:
$$
\begin{align}
T(n) & = n T(n-1) + n^2\\
& = n(n-1)T(n-2) + n(n-1)^2 + n^2\\
& \vdots\\
& = n! + n! + n(n-1) \dots 2^2 + ... |
Is it when you need faster performance, to iterate over a container, or when you don't need an index variable?
From my understanding it should be when you need to iterate over a container.
Am I understanding this properly?
|
Input: undirected graph $G$, starting node $j$ for Justin Bieber (JB), and starting nodes for 4 fans $f_1, f_2, f_3, f_4$.
This problem has turns: for every turn, JB can either stay at his current node or move 1 node adjacent. Fans are working together and follow the same rules, but can share the same node. The fans a... |
For a machine learning method X (Deep Neural Nets variant), which performs classification tasks.
In the output layer, for every label method, X also emits the uncertainty U associated with the respective prediction.
So, in case the testing dataset is very different then the predictions made by X should have a high U. (... |
In my textbook on compiler design [1], it describes interference between two variables (the property that they cannot be in the same register at once) as follows:
Definition 9.2: A variable $x$ interferes with a variable $y$ if $x \neq y$ and there is an instruction $i$ such that $x \in kill[i], y \in out[i]$ and ins... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.