instruction stringlengths 35 29.1k |
|---|
We have implemented a spectral clustering algorithm according to the article Multiclass Spectral Clustering (Yu and Shi, Proc. IEEE ICCV '03, vol. 2, pp. 313–319, 2003; PDF).
We used the algorithm to test simple cases of clustering and it seems to work, however in some cases the algorithm doesn't use all the available ... |
Can the language $L = \{ vv : v \in \Sigma^* \}$ be expressed as the concatenation of two nontrivial languages? (A language is nontrivial if it differs from $\{\epsilon\}$.)
|
I have the following labyrinth where R is the robot(the parent node), red blocks are the obstacles where the R cannot move and GOAL is the node where we want the robot to go. Every node should be written in this form R(1,2,4), 1 is the row, 2 is the column and 4 is the distance from the current node to the goal node GO... |
The Hitting Set Problem (HS) is defined as follow. Let $(C,k$)
$C = \{ S_1, S_2, ..., S_m \}$ collection of subset of S i.e. $ S_i \subseteq S , \forall i$
$k \in \mathbb{N}$
We want to know if exists ${S}' \subset S$ where $|{S}'| < k$ such that $S_i \cap S' \neq \emptyset $, $i = 1,2,...,m.$
Prove that HS is Np-C... |
It seems intuitive that conditional Kolmogorov complexity is only zero when the bitstrings are the same, and otherwise is greater than 0. I.e. if $b_1 = b_2$, then $K(b_1|b_2) = 0$, otherwise $K(b_1|b_2) > 0$.
However, if that is the case, then we could break a long bitstring into many smaller, different bitstrings, a... |
Most of the learning material my knowledge of computers is based on revolves around early , byte addressable CISC-like machines , such as the SAP described in Paul Malvino's great "Digital computer Electronics" book. The concepts described fairly simple to handle to understand once you get the hang of it : the address ... |
I have been refreshing on greedy algorithms as an algorithm design technique. I have read many sources for an explanation of what a greedy algorithm is, because I would like to put together a general greedy algorithm.
When reading these sources, I have gathered all of the important concepts to try to come up with this ... |
Background: I would like to experiment with evolutionary algorithms to generate the "optimal" poem, according to a fitness function to be determined later. However, I cannot think of a good way of implementing 'crossing over' for the 'surviving' poems in each generation. Therefore, I gained some interest in the Cuckoo ... |
I have the following weighted graph with connected nodes. I've made some connections red just to be easier on the eye.
I am applying DFS on this graph and I am not sure if this is correct because on theory DFS takes the first node and that implementation is easy when the graph isn't weighted so we apply alphabetically... |
When designing an algorithm for a given problem, sometimes I find it hard to foresee or clarify to myself what the boundary/edge/corner cases are. Not being able to come up with a decent number of the possible boundary/edge/corner cases causes one to make implicit assumptions about the problem at hand, which yields ove... |
I don't understand the exact relation between between FPT and FPTAS. Specifically, given an optimization problem P with fptas A does that imply that for any parameter (a computable map from the input to the integers) there is an FPT algorithm? It's standard that given an FPTAS, there is an FPT algorithm parameterized b... |
I read that shortest path using DFS is not possible on a weighted graph. I pretty much understood the reason of why we can't apply on DFS for shortest path using this example:-
Here if we follow greedy approach then DFS can take path A-B-C and we will not get shortest path from A-C with traditional DFS algorithm.
I th... |
Quite possibly this problem is already solved and has it's own name, but I was unable to find any directions.
So, I have a portfolio with some items in it:
| Name | Price | Amount | Share |
|--------|-------|--------|-------|
| Item 1 | 200 | 1 | 25% |
| Item 2 | 100 | 2 | 25% |
| Item 3 | 50 | ... |
I generally use state removal method to convert DFA to regular expressions. But I want to try other methods like using algebraic methods and arden's rule.
How to solve a DFA with multiple final states using algebraic method?
I refered this link
https://cs.stackexchange.com/questions/2016/how-to-convert-finite-automata-... |
The question is from my complexity-theory course.
The question
If $L_1,L_2,L_3 \in \lbrace 0,1 \rbrace^*$, and different from $\lbrace 0,1 \rbrace^*$ and from the empty language, prove that if $L_1 \leq_p L_2 \cap L_3$, where $L_2 \in NP$ and $L_3 \in P$ then $L_1 \in NP$
My answer
Due to the fact that $P \subseteq NP... |
One of the nice things about genetic algorithms is that they can easily be used for a diverse array of problem domains, whereas PSO for example seems best-suited for candidates of real-valued vectors (although I am aware of the use of the latter in combinatorial problems). It has, however, occurred to me that, by using... |
Here is the description of a proof problem:
A complete binary tree of depth N is a binary tree in which every node on levels $0,1,2,...,N-1$ is a parent and has two children, and each node on level N is a leaf.
It's asking for proving binary tree of depth N has $2^{N+1} - 1$ nodes.
I am not really sure how to app... |
The question is from my complexity-theory course.
Explain the concept of polynomial reduction between problems and explain how, and under what circumstances, lower bound and upper bound problems can be determined.
My attempt:
a problem $A$ can be polynomial reduced to $B$ if given an instance $a:A$ an istance $b:B$ ca... |
I'm trying to practice some theory on graphs:
Namely, we have given connected undirected weighted graph with $N$ nodes and $M$ edges, let's say we want to find the shortest paths between node $1$ and node $N$. But, not only that we want to find all the paths with same shortest distance between $1$ and $N$.
Now I was w... |
Just what the title says.
Can we have a strictly monotonically increasing/decreasing sequence generated by a distributed system (without a single point of failure)?
My current thoughts are that this is a consensus problem, and is thus impossible to achieve in an asynchronous messaging system (like the Internet). Anothe... |
There is a certain family of typical branch & bound problems in which we have to put $n$ objects into $m$ indistinguishable bags.
Usually solutions are represented by $n$-size vectors in which $V[i]$ means that the $i$-th element is in the $V[i]$-th bag.
Is there a way to avoid generating equivalent solutions without p... |
Input
We are given a set of basis elements, $\ v_1$,$\ v_2$ ,...,$\ v_n$ of a $\mathbb Z^m$- module and a multiset of integers $\ B :=$ {$\ b_1, ..., b_m$}
Desired Output
Return true if there exists a linear combination $\ a_1v_1 + a_2v_2 + ... + a_nv_n$ such that the resulting vector uses the integers $\ b_1, ... ... |
I am learning DAGs and Equivalence Class of DAGs, I am reading the material by Prof. Campos Ibáñez here: https://www.cs.cmu.edu/afs/cs/project/jair/pub/volume18/acid03a-html/node2.html
However, I don't understand this:
"It should be noted that each structure in the DAG space is not always
different from the others... |
Are the undecidable languages closed under complement?
How can the answer be proved?
|
Sorting algorithms have a huge literature behind them, and the algorithm I'm planning has some similarities to the topic, but I couldn't even find the correct search terms to know whether a field exists which studies such algorithms.
Imagine the following problem: there is a serial communication channel of a very low t... |
I am studying the s-m-n theorem and the concept reminded me of currying.
From wikipedia article about s-m-n theorem:
the theorem says that for a given programming language and positive integers m and n, there exists a particular algorithm that accepts as input the source code of a program with m + n free variables, to... |
I've been reading the following paper to understand how I can develop a non deterministic algorithm for test cases generation https://www.researchgate.net/publication/293043297_A_two-stage_algorithm_for_combinatorial_testing
I understand that he is using a two stage solution, having a greedy algorithm as a solution for... |
The VPRI institut founded by Alan Kay has some papers on constraint-based layouts for GUIs based on constraint solving.
For instance:
Wallingford: Toward a Constraint Reactive Programming Language by Alan Borning (2016)
A Report on KScript and KSWorld by Yoshiki Ohshima, Bert Freudenberg, Aran Lunzer and Ted Kaehler ... |
Why don't imperative languages support parametric polymorphism as powerful as whats in Haskell and OCaml?
More specifically if I call a function foo(x) that internally calls bar(x) which internally calls baz(x), what prevents the type of parameter x from being inferred all the way down?
Is it possible to design an impe... |
If I've RFID Collision Arbitration System that is based on multi-frame dynamic frame ALOHA. How can compute the probability of the average tag resolution $L_n$? ,$P_s$ is probability for packet trasmission that no other packet arrives in the previus slot. $P[N(t+T,t)=0)]=e^G ; S=Ge^G$;S stand for Throughput.
$G=Tx... |
I'm following the tutorial over at https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/ and so far everything makes sense to me. I am now trying to reason about how these formulas extend to any number of hidden layers. Specifically, how to proceed when you have the partial derivative of total error ... |
I was reading an article on an alternative method of modulo reduction and i couldn't understand the following excerpt (Those in bold) :
"A single 32-bit division on a recent x64 processor has a throughput of one instruction every six cycles with a latency of 26 cycles. In contrast, a multiplication has a throughput of ... |
I have a graph related problem.
Let $G$ be an undirected weighted graph of $N$ nodes. I want to find $p$ independent (they have no edge linking them) sub-graphs of $m$ nodes in a way that the total weight is maximized.
For example, let $G$ be a graph of $16$ nodes, I want to find $4$ sub-graphs of $4$ nodes with $w_1, ... |
There is an easy and hard version of the problem I am asking about, so I will start with the easy to make for clearer reading.
Suppose that we are have a set of vertices $V =\{v_1,v_2,...,v_n\}$ and sets $S_1,S_2,...,S_m \subset V \times V$. Let
$s_{ijk} = 1$ if $\ (v_j,v_k) \in S_i $, 0 otherwise.
Given integers $\ k... |
Suppose there are an undirected graph $G = (V, E)$ and a function $f : V \rightarrow \mathbb{R}$, which associates a weight for each vertex in $G$. I was wondering if it is possible to find a tree $T = (V, E_T)$, where $E_T \subseteq E$ and $\sum_{i \in V} f(i) d_{i}^T$ is minimal. The root of all trees must be a prede... |
Given $n$ real numbers (where $n$ is even) find a pairing which minimizes the maximum sum of a pair.
I think the optimal pairing is obtained by sorting the original set, pairing the first element with the last one, and so on. But I get stuck trying to prove it.
I tried use the "difference reduction method", examining... |
First: I have programmed a few programs dealing with computer vision (not with libraries but from scratch):
Simple Character and Figure Recognition
Character and Figure Recognition with Neural networks
Facial recognition
so I am not asking for details on these.
The characteristic of all my programs is that once you... |
In their original paper, Storing a sparse table with O(1) worst case access time (Fredman, Kolmos and Szemeredi, Proc. FOCS '82, IEEE, 1982), the authors show that a perfect hash function must exist, provided that the table is the square of the number of elements in the key space.
The key part of the proof bounds the n... |
3-SAT with at most 3 occurences per variable is $\mathsf{NP}$-hard.
Now I'll try to solve it using these:
Theorem: SAT where all clauses have length 3 and variables occur 3 times, is satisfiable.
Double propagation. If there is a clause $(a\lor b)$ and no clause $(\overline a\lor\overline b)$: change all occurences of... |
I learned the following theorem in class:
"If $T(n)$ is asymptotically non-decreasing and $f(n)$ is smooth, then $T(n) =
O(f(n)|n=b^k, k=integer)$ implies $T(n) = O(f(n))$."
I'm trying to show using a counterexample that this theorem doesn't hold if $f(n)$ is non-decreasing but not smooth. Smoothness means that $f(bn) ... |
I'm reading on small-depth circuits. Since every formula can be turned into a CNF formula, which has depth at most 3, why should we study deeper circuits? Is it because convertion to CNF may result in an explosive blow-up? If so, can you give an example?
|
This person was asked: "Why is a blockchain implementation different than a distributed consensus system like Raft?"
In part of their answer they replied:
For one, Raft is not Byzantine fault tolerant, i.e., not designed to account for arbitrary failures. If a participant fails by telling different peers different thi... |
How to prove that a $k$-universal family of hash functions is $(k-1)$-universal family?
I tried to prove it by definition of k-universal family of hash functions but I didn't know how to use the definition.
If I prove it, Is it necessary that a $1$-universal family of hash function is universal family?
Definitions:
Let... |
There is a very simple randomized algorithm that, given a 3SAT, produces an assignment satisfying at least 7/8 of the clauses (in expectation): choose a random assignment. A random assignment satisfies each clause with probability 7/8, and so linearity of expectation shows that the expected fraction of clauses satisfie... |
I am trying to categorise subfields of computer science. Wikipedia does a good job of it.
However, it cannot fit cloud computing, virtual machines, containers and related technologies in any of the mentioned fields.
Does it fit under computer architecture or do we need a new sub-field?
I know categorising topics under ... |
Let
\begin{align*}
L_1 &=\{\langle M,w\rangle \mid M\text{ halts on }w\}\\
L_2 &=\{\langle M,w\rangle \mid M\text{ does not halt on }w\}\,.
\end{align*}
Here $M$ represents encoding of a Turing machine (T.M.) and $w$ is the input string. What is the class of $L=L_1 \cup L_2$?
I read that the union would be a ... |
I'm trying to understand how the $word2vec$ method actually nudges word vectors of similar semantic/syntactic content closer together in the word vector space.
I've read here (Quora answer) that it's because $word2vec$ tries to maximise the probability of target word $w$ given context $c$, and that this probability is ... |
Suppose a disk has
Number of surfaces: 8
Number of sectors per track: 20
Sector size: 4000B
Number of tracks: 10
It is rotating at 360 rpm.
So disk is reading data from one track at an instance. So I will only find for a single rotation how much data can be fetched & I will find how much data in 1 second.
In 60 second... |
I've only been studying computer science for a few weeks, so I apologize if this is a silly or naive question.
Suppose we're trying to list all elements of the set $$C(r) = \{(x,y,z) \in \mathbb{N}^3 : \sqrt{x^2+y^2+z^2} \leq r\}.$$
An obvious approach would be this: first, list all integers between $0$ and $r$; these ... |
I got a array of colors that are closely related = most of the time there is no sharp transition between color[n] and color[n+1].
Exemple of such an array of colors
[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0,.8,.6,.4,0.2,0]
You'll notice that there are 3 "special" values. The colors
slowly increase from value 0 to 1 (in 10 ste... |
As per the book "Introduction to Algorithms" , to solve the rod cutting problem for a given length n, we basically iterate over all possible lengths of the first part , and calculate the optimal profit for the remaining part ( either through recursion or via stored values in array ). The profit for the first part is pi... |
Say that we have some (integer) weights $w_{1,1},w_{1,2},...,,w_{m,m}$ and a target sum $W$.
Suppose that we want to find whether there are $a_1,...,a_m \in \{0,1\}$ such that
$$\sum_{i = 1}^{m} \sum_{j = i}^m a_i a_j w_{i,j} = W.$$
I read through the Wikipedia article on the quadratic knapsack problem. It mentions (b... |
I have an extremely large (100GB+) corpus of many different texts. All of them are in English and 'well' formatted. They are not loaded into any kind of database, think of them as a huge collection of text files of many different sizes.
What would be the most efficient way to check and retrieve arbitrary text sequences... |
Let we have some problem $A$. Input length is $n$. Now we write a database that will store info about some positive instances of problem $A$. For every $n$ size of $n^{th}$ sector of DB is $O(f(n))$. $f(n)$ is some function.
Then we assume that some solver for problem in complexity class $C$ (for example, $GI$) can use... |
I want to store a subset of $\{1,2,\dots,n\}$ in a data structure such that the total space used is $O(n)$ bits and accessing a particular element can be done in $O(1)$ time. I have tried binary search tree and array data structures but they are too slow.
In short I need a data structure with $O\big(\frac {n } { \log \... |
Bucket sort algorithm lets you sort an array of $n$ elements in expected $O(n)$ time, supposing the elements are equally distributed in the $\lbrack 0,1 )$ interval.
Is there a way to modify the bucket sort in order to sort in expected $O(n)$ time an array of $n$ elements distributed in $\lbrack 0,1)$ according to the ... |
I got this question that's been troubling me for some time.
If $h_1$ and $h_2$ are admissible heuristic functions, prove that $h_3 = (c-1)\,h_1 + c\,h_2$, $0 < c < 1$, is also an admissible heuristic function.
The thing that I get stuck on, and maybe get a little tunnel-vision, is that $(c-1)$ is negative which preve... |
Let's say i make a program that produces an eleven character long ID like youtube does and tries to find a valid video in youtube. What's the actual possibility that it's going to produce a valid ID corresponding to a real video and also an unlisted one??
|
In this image there is a given formula in DNF and CNF. When I check it on Wolfram Alpha I see that it cancel out (E or D) because of (not A or A) which is colored in red. My question is if it is allowed to cancel out (not A or D) because of (not E or E) which is colored in green instead. THX
|
I have this [kind of funny] question in mind. Why is the non-deterministic finite automaton called non-deterministic while we define the transitions for inputs. Well, even though there are multiple and epsilon transitions, they are defined which means that the machine is deterministic for those transitions. Which means... |
$L_0=\{\langle M,w,0\rangle\mid M \text{ halts on } w\}$
$L_1=\{⟨M,w,1⟩\mid M \text{ does not halts on } w\}$
Here $\langle M,w,i \rangle$ is a triplet, whose first component $M$ is an encoding of a Turing Machine, second component $w$ is a string, and third component $i$ is a bit.
Let $L=L_0 \cup L_1$. Is $L$ non R.E... |
The following is an excerpt from the book "An Introduction to Formal Languages and Automata" by Peter Linz.
My question is, why is $\Sigma^+$ used and not $\Sigma^\ast$?
|
I'm trying to calculate the best and worst position for each team in the ranking based on the weekly matches.
Suppose we have 4 teams with these position:
Pos.| Name | Pts.
1 | Team A | 12
2 | Team B | 10
3 | Team C | 8
4 | Team D | 6
And during the week there are 2 matches A vs C and B vs D
If you don't k... |
I'm trying to implement the Fortune's Algorithm, however I can't quite figure out how the status structure should be implemented.
The following is extrapolated from my Computational Geometry book.
The beach line is represented by a balanced binary search tree
$\mathcal{T}$; it is the status structure. Its leaves co... |
I have a value that increases by unknown increments at unknown times. Given a time, I need to check how much it has increased between that time and now.
I could simply store every time/increase pair whenever the value is increased, but this would be too much data to reasonably store.
For example:
DATA:
Value = 0 @ 0:... |
The following is an excerpt from the book "Introduction to the theory of Computation" by Michael Sipser, 2nd edition.
As per the book, this Turing machine accepts the language L = { w#w | w ∈{0, 1}*}. I ran this machine for few strings and it's working properly.
My doubt is, I think there is no need of keeping a trans... |
With Levenshtein distance we can create a metric space over string. Is there are any distance metrics for regular expressions?
|
I'm trying to better understand the min-cut problem for directed acyclic graphs. I understand that the minimum capacity cut has equal capacity to the max flow of a graph by the max flow-min cut theorem (https://en.wikipedia.org/wiki/Max-flow_min-cut_theorem). This makes some sense to me but I'm confused as to what happ... |
Let's say I have a decimal floating-point number, i.e. a mantissa and precision (negative exponent), both represented as integers. How do I convert this into a binary floating point number (of the sort you find in most programming languages, with only the standard operations available). This should be done with maximum... |
I'm trying to determine correlation between two structured data sets.
Eg:
D1
name: ABC
age: 3
address: xyz
D2
name: ABC
dob: x/t/r
occupation: xyz
Is there a way to use Pearson correlation on structured data instead of variables?
|
From a programming language designer's point of view, how is "symbolic"
insertion implemented as opposed to "textual" insertion using pre-processor
macros?
I understand the basics of how "textual" insertion works in C and C++. That is,
the pre-processor might transform:
#include "person.hpp"
class employee
{
pers... |
I take the definition from Computability and Complexity Theory by Steven Homer and Alan L. Selman, 2011.
In their book they said that the domain of a computably enumerable (c.e.) function (f) can be the range of another partial function (p). In particular, the partial function can be the universal Turing machine. The ... |
I have two questions about sorting for posets, one easy and one hard:
Easy: Suppose we have a set of objects and a partial order. Given any two objects such that $a \leq b$, we want to delete $b$ from the set. Is there a sub-quadratic time algorithm that can accomplish this, perhaps for some suitable data structure?
Ha... |
Ok. I know this is probably a commonly asked question. Before you refer me to a site or answer this yourself, I ask for you to please read this through. I have been into computers and electronics for quite a while. I have a pretty good understanding of electronics, and would like to become a computer hardware engineer ... |
Theorem. If and only if SAT instance $\varphi$ is satisfiable, there is a way to negate variables in $\varphi$ and get $\varphi'$ where all clauses have at least one positive literal.
Also we can change word 'negative' by 'positive'.
For example, let we have an instance $(x\lor y\lor\overline z)\land(\overline y\lor\ov... |
I am trying to find a description for canonical form (labelling) for a graph. Specifically, how do we arrive at canonical form for a given graph?
|
Let $L$ be CFG. Is $\{ w \in L : wx \in L, \textrm{for some } x \neq \epsilon\}$ also CFG?
|
I am working on writing an easy to read document about denotational semantics of the lambda calculus. For that I introduce CPOs, monotonicity and continuity.
A CPO is a set $M$ with a partial order $\leq$ and a bottom element $\bot$, requiring $\bot$ to be the smallest element in $M$ and the existence of the least uppe... |
Well, I should have posted this question before Why NFA is called Non-deterministic?. Anyways now this is pondering in my mind.
Why people who came up with this automaton theory restricted the input format of it as a read-only, symbol-stream tape.
Is it not so that if we provide random accessible input tape (as in cas... |
I'm currently trying to write an algorithm that can find individual groups of connected lines within a larger set of lines. The images below should explain this a bit more clearly.
In the first image you can see a set of lines. What I'm trying to do is split those lines into 3 groups, as seen in the second image. The... |
In my last exam this question got asked and i just cant find a clear answer:
If P=NP, which two languages are NOT NP-complete?
So I assume there are two special languages, but which?
Thanks in advance
|
My question stems from something mentioned in the following paper*:
Acyclic Multi-Way Partitioning of Boolean Networks by Jason Cong, Zheng Li, and Rajive Bagrodia
Given a DAG representing a Boolean network, $N$, where each node represents a logic gate, define a k-way partitioning solution as $S = (A_1, A_2, ..., A_k)$... |
When implementing a term rewriting system, one “optimization” one can do is to represent operators known to have certain equational properties with a more directly representative data structure. For example, one can use lists to represent uses of a binary operator known to be associative, rather than using the naïve s... |
I'm new to asymptotic notations and right now I'm trying to prove that $n^4 = \mathcal{O}(2^n)$.
In my current solution (written below) I used L'Hôpital's rule repeatedly, proving that the limit of $n^4/2^n$ goes to zero. Is this correct?
Additionally I'm wondering whehter there is a simpler solution to this problem. ... |
I'm trying to solve this problem for big numbers (up to $10^9$). Namely, let's define $$GCD(a,b) = GCD(a-b, b)$$
We define GCD as function that returns greates common divisor of two numbers.
In case if $b > a$ we swap the values of $b$ and $a$. Now I want to count the number of steps when either $a$ or $b$ will be equa... |
Suppose that my multicore computer system has the diagrammed memory caches.
+---------+---------+-------------------+
| CPU 1 | CPU 2 | CPU 3 | CPU 4 |
+---------+---------+---------+---------+
| Level 1 | Level 1 | Level 1 | Level 1 |
| cache | cache | cache | cache |
+---------+---------+---------+---... |
My basic idea of networking at the lowest layer is that one computer will send a bunch of parallel bits at a time down a cable and another computer will read these bits. For example, computer #1 sends a bunch of parallel bits to computer #2. Computer #2 then gets the bits then waits for the next bunch of bits. And s... |
Let we resolve only two clauses at time and then get rid of them. Such resolution clearly takes $O(n)$ steps.
Sequence is a set of instructions in the form $(C_{S_1}\cup C_{S_2},v\cup\overline v),...$, where $S_i$ denotes a set of merged clauses, $v\in C_{S_1},\overline v\in C_{S_2}$.
Of course such resolution taken de... |
It's an exercise I was given:
We say array of numbers $A$ is geometric if:
It has size $n=2^k-1$
It has $\log n$ distinct numbers
For each $0\leq i \leq k-1$ there exists an element in the array that appears exactly $2^i$ times.
For example: $[8,5,2,5,5,5,8], k=3$
I need to sort the array in $\mathcal{O}(n)$ time a... |
A jet which can fly no more than R kilometers without refilling, is at location 0 and needs to fly to point N+1. There are some petrol stations on the way, some of which are ready to use, others are under construction and will be available soon.
We get an array C of length N, where the value of C[i] describes the petro... |
I was reading DeepMind's paper on I2A's and realized that the sizes of the hidden layers in their model were all like 32, 64, 256, and so on: all powers of 2. I have found the same thing in other papers.
Is there any performance reason for it? Maybe related to data structure alignment?
More concretely, I would like to ... |
I'm trying to reconstruct graph if we have given the result of floyd-warshall algorithm, more formally:
Let's say we have given undirected weighted tree (graph without cycles) with $N$ nodes, such that from this graph we only have given matrix $g$ of size $N \cdot N$ elements, such that $g(i, j)$ gives the shortest pat... |
This question is motivated from this post. Let $G$ be a given graph, for each vertex $v \in V$, I will label $v$ with $Triangle(v)$.
$Triangle(v) : $ means number of distinct triangles contain $v$.
Question : Is it a valid canonical form? Is computing this function easy (mean polynomial time)?
|
I'm currently reading Knuth's proof about O(1) number of probes in
linear probing. I have a small question on the page 536 (Volume 3, 2nd Edition). Knuth says
Let $f(M, N)$ be the number of hash sequences such that position 0 of the table will be empty after the keys have been inserted using linear probing.
The cir... |
I have tried to calculate the maximum number of times the loop will search through this large array, but I am not sure if I have that correct and I also need help with or pointers of how I can calculate the number of minimum times it will search through the array using both the binary search and sequential search. Here... |
This page says following:
Integer Multiplication has an O-optimal linear-time algorithm on a RAM or SMM
Is this page fooling me or how can we multiply 2 numbers in linear time (bitwise complexity) using RAM?
|
All variable names are from Quicksort's wikipedia page's Lomuto's and Hoare's quick sorts pseudocode.
If p is what is returned by the partition function, Hoare divides his array from lo to p and from p+1 to hi, while Lomuto divides his array from lo to p-1 and from p+1 to hi.
I may be wrong about this, but Quicksort's ... |
I am reading a free book on algorithms
http://www.cse.iitd.ernet.in/~Naveen/courses/CSL630/all.pdf
and on page 13 it says
"Compare this to the recurrence relation for Fn: we immediately see that T(n) ≥ Fn"
I do not understand how they know that T(n) ≥ Fn
if someone could explain it to me it would be much appreciated.... |
Let G be the grammar:
S --> ASB | λ
A --> aAb | λ
B --> bBa | ba
Use set notation to define L(G).
So I came across two different answers to this question, none of which are mine, and then compared them to mine. I'm wondering if they are all equivalent.
Answer 1: $L(G) = \{a^{n_1}b^{n_1}...a^{n_k}b^{n_k}b^{m_1}a^{m_1}..... |
Is there any way to find an element in an unsorted doubly linked list given an element and pointer from which we can navigate? (we can't use head/tail pointers since the list is infinite)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.