instruction
stringlengths
35
29.1k
I have a weighted directed graph (it's sparse, 35,000 nodes and 19 million edges) and would like to calculate similarity scores for pairs of nodes. SimRank would be ideal for this purpose, except that it applies to unweighted graphs. It's easy to adapt the matrix representation of SimRank to use weighted edges: $\mathb...
Hey all I have a weird question (first time poster so forgive me if this is super newb)... I am wanting to see the inner workings of a SSL/TLS connection between a client and a server at the packet level (in the clear) in order to learn. Is there a way to do this where I will see all of the traffic including the hands...
I'm writing a compiler, and I've built a recursive-descent parser to handle the syntax analysis. I'd like to enhance the type system to support functions as a valid variable type, but I'm building a statically typed language, and my desired syntax for a function type renders the grammar temporarily* ambiguous until res...
So I know that arrays use a block on contiguous memory addresses to store data to memory, and lists (not linked lists) make use of static arrays and when data is appended to the list, if there is no room, a new static array is created elsewhere in memory larger in size so more data can be stored. My question is, how do...
As you add length to an encryption key, at some point the message becomes impossible to brute-force decrypt. This is because at that point, if you go through all the possible keys, you'll get many meaningful decryptions just by random chance and you won't be able to determine which was the original message. As you add ...
The following question assume that the decision problem definition (syntactic) has been written (and could be changed if it isn't able) to catch a concept (meaning, semantic) which has both nice implications and some models. So please don't answer "the definition is the definition". Let be any usual proof system, let $...
I am looking for a formal name and an algorithmic approach to the following problem. Given is a set of services each coming with a price: {s1, 300} {s2, 400} {s3, 800} Additionally there is a set of servicepackages each with a price that may differ from the total cost of the individual services: {p1, {s1, s2}, 60...
I was trying to figure out the value of the following expression. (0 | 1)*00 ∩ (0 | 1)*01 I tried drawing DFAs for(0 | 1)*00 and (0 | 1)*01 separately and combine them using a table. Is it the approach I should use? or is there any better way?
I got this question today and I'm nowhere near the solution, Given a sequence of real numbers (X1, X2, ..,Xn). write an algorithm as efficient there is, that finds the number of strictly increasing sub-sequences for every index j, that end with Xj. My solution should include a recurrence formula that solves this proble...
I've been working on an industrial project where my job was to design a data model in-memory and in a relational database in such a way, that can capture the time-varying nature of the production planning of a factory. In other terms, there exist input data and whenever a planning occurs, I have to take a snapshot of t...
I have recently learned about radix sort. I am aware that you can change the base of the numbers you need to sort but I don't really understand why this is good for the radix sort. Radix sort runtime is $O(d(n+k))$ where $d$ is the number of digits in the numbers, and $k$ is the base. So shouldn't there be a permanent ...
I'm currently reading the elements of programming book and have come across a section I don't quite understand A computational basis for a type is a finite set of procedures that enable the construction of any other procedure on the type. A basis is efficient if and only if any procedure implemented using it is as eff...
Suppose we have the graph of a social network with symmetric connections (e.g. Facebook or LinkedIn). Suppose we would like to find all pairs of people who have at least k friends in common, in order to show them friend recommendations. What is the most efficient way to do this? Does this problem have a name? Apart fro...
During the formal language exam, the professor allowed to find a CFG to following language: $\{a^m b^n c^p d^q, m\neq n\wedge p\neq q\}(1)$, because neither he saw a solution (He passed a test without resolve it before!!!) to $L=\{a^m b^n c^m d^n, m\neq n\}(2)$. First language I can resolve in seconds, but I cannot vis...
I'm going over "Introduction to the Theory of Computation" by Michael Sipser in which there's an example of using the pumping lemma for CFLs to prove that $L=\{ a^n b^n c^n \colon n\ge 0 \}$ is not a CFL. Now, in the book they do it in a way that I understand but I think it can be simplified, so here goes: Assume by co...
Languages such as Java and C specify implicit widening of integer types for numeric operators, especially arithmetic operators, to a minimum of 32 bits. What is the rationale behind doing this? My impression is that it's based on the end-programmer's expectations - that is, 200 + 100 should yield 300, and not overflow ...
I have to prove that $\left \{ a, b \right \}^{\ast} - \left \{ a^ib^i | i\geq 0 \right \}$ is a context-free language and it's not regular. So far I've got that this language is not regular because regular languages are closed under complementation and $\left \{ a^ib^i | i\geq 0 \right \}$ is a well know context free ...
I've posted this question first on StackOverflow but this section seems more suited for this kind of questions. Also I'm not trying to simply solve this exercise (it is a "parsing" exercise, once I'll figure out the regular expression I'll derive the equivalent Finite Automaton that accepts the language generated by th...
In recent article of PM the memcomputing is presented. But I did not understand how it works, according to the text. What is the general principle of work for this memcomputing? How it is done in hard-ware?
I am no computer scientist, so I can be naively missing some commonly implemented optimization strategies but... Looking at two ways of counting words in a text (shown below), I tend to think that the iterative method, as it runs through each word in the text only once, will use less memory than the second method, expr...
The purpose of this exercise is to write a program that recognize all the words derived from this grammar. The time complexity of this program must be O(n) hence i must be able to derive a regular expression from the grammar $S\rightarrow ASA\mid A$ $A\rightarrow aAa\mid aAab\mid bA\mid\epsilon$ By intuition I gues...
I’m learning (self-taught) about language implementation and compiler design, and I’m implementing a toy language to cement the concepts in my mind. However, I’m having trouble understanding how scope trees are meant to be used. In my toy language, I’m using the Visitor pattern to traverse the syntax tree as a simple i...
There is a way to convert regular expression to DFA (deterministic finite automata) which is to build a syntax tree and then compute first pos, last pos, follow pos, and then use a Transition technique to build DFA for that particular regular expression. But this case only works when operators in the regular expression...
let's have these two languages in the alphabet $\{a,b,c\}$: $L_1 = \{ w \mid w \text{ is a palindrome and $|w| < 200$}\}$ $L_2 = \{ w \mid w \text{ is a suffix of $u$ and $|u|$ is a prime number and $u$ doesn't contain a $c$}\} $ and I have to prove that $L_1 ∪ L_2$ is regular. So my idea is I have to prove both langua...
Given a finite set $\Sigma$ and a positive integer $n$, a mechanism is a set $\{ \mu_x \vert x \in \Sigma^n \}$ such that $\mu_x$ is a probability measure on some $\sigma-$algebra for each $x$. Now given a communication protocol $P$ between two privately coin-flipping parties $A$ and $B$ who start with the inputs $x$ ...
I'm trying to figure out how to build a regular expression for a language that doesn't contain substring bbb. The alphabet is {a,b,c}. I'm trying to construct a DFA and convert to help me get the Regular Expression but still stuck as I found the DFA a bit complicated. I appreciate any help. Thanks!!! Ok, here is the Re...
We know that checking whether some word w is accepted by a turing machine TM is undecidable. But what about the problem of finding one accepting word of a TM? Are these two problems related in some way, i.e. undecidability of one implies the undecidability of other (in any structure, like FA, LBA, PDA etc)? My hunch i...
I am working on an algorithm which approximates a certain optimal quantity. The approximation becomes better when the size of the problem ($n$) becomes larger: the difference from the optimum is approximately $1/n$. Initially, I wrote that the algorithm achieves an approximation of: $$\Omega(1-1/n)$$ But, now I am no...
Consider the the Geometric Brownian motion $\qquad dX_t=\mu X_t dt+\sigma X_t dW_t$, with $X_0=1$, $\mu=0.2$, and $\sigma=0.30$. for each $n=1,2,3,..$ let $h_n=1/n$, and let $X^n_n$ be the final value of the discrete process obtained from Euler scheme wrt $h_n$, i.e. $\qquad X^n_{k+1}=X^n_{k} +\mu X^n_k h_n +X^n_k \...
The required solution is given. I have to prove that its solution is $O(n\log n)$. My idea is shown below: I have to prove, $T(n) \le cn\log n$ for some constant $c$ $$\begin{align} T(n) &\le 2c\log(n/2) + n\\ &= 2c\log(n) - 2c\log(2) + n\\ &= 2c\log(n) - 2c + n\\ &= c\log(n) + ( c\log(n) - 2c + n )\\ ...
Here is my implementation of mergeSort. I need n extra space for the helper array. But what about recursive calls? I call sort log n times. mergeRoutine is a tail call, and it doesn't add to the call stack. The extra space I need equals to n + log n. How can the extra space be O(n)? I think we just consider log n negl...
Let $M_i$ be the Turing machine with Gödel number $i$. Let $$A = \{i \mid M_i \text{ with input \(x\) halts after exactly 14 steps}\}$$ Is the set $A$ recursive?
I am stuck with understanding the transformation of final-state acceptance automaton into empty-stack acceptance automaton. From everywhere that I've read, it always says introduce a new start state with a new start stack symbol, and another state after the original final states for emptying the stack. I understand the...
So there is an algorithm to convert lambda calculus terms to combinatory logic using SK combinators. It produces things that explode in size. I would like to know more about this explosion in size. I can't seem to think of a better algorithm however. I have heard of functional languages being practically compiled to co...
I was wondering about a problem in analyzing a social network (counting friends-in-common between all pairs of members) that requires squaring its adjacency matrix, and started reading up on algorithms for multiplying sparse matrices. However, all I found so far were different ways of arranging the more or less naive "...
how i can define what are Client-Server Architecture for a website that suggestion courses for students after students insert the history of courses. The language will be PHP,mysql and HTML. In this case ,server side is the PHP and client side will be the HTML . Is that how i can define the Architecture? If no , what ...
I would like to know about how we can detect how 'deep' into a scene a user is looking. If looking into a 3D environment, with an object close to the user and one further away, how can we detect when the user is looking at the object further away? Or, rather, how can we detect which object a user is looking at in a 3D ...
I know how to find SURF feature points and have code to find them, but I have no idea how to find the same point in 2 different images, I have laplacian, scale, orientation, descriptor, response and x, y. If i give it a very simple image, a triangle with no bottom and place it in two different places in two different ...
$n$ people want to have dinner together around a table for $k$ nights so that no person has the same neighbor twice. How big can $k$ be in terms of $n$? Does everybody get to sit next to everybody else? How many seating arrangements are there?
What is the simplest example of a rewriting system from binary strings to binary strings $$f:\Sigma^*\rightarrow\Sigma^*\qquad\Sigma=\{0,1\}$$ that can perform universal computation? Binary string rewriting systems in general can compute any computable function, but I have trouble finding particular instances that can ...
What would be an ideal environment/manner to judge the effectiveness of multiple segmentation algorithms? The goal is to determine which algorithms provide the best results for pre-clinical imaging. Our group has considered a GUI in MATLAB, and have different modules for different algorithms. Various papers have conduc...
Assume you have two parameters, $N \gg 1$ and $\epsilon < 1$. I have an algorithm (and matching lower bounds) that runs in $\Theta(\epsilon^{-1}+\log N)$ for $\epsilon > N^{-1}$, and $\Theta\big(N\log\big(\frac{2}{N\epsilon}\big)\big)$ otherwise. I would like to write it using one notation (possibly with $\max$ or $\mi...
This might be too easy... But I just don't get it. I've been reading about flow in networks and I stumbled upon this definition in wikipedia: https://en.wikipedia.org/wiki/Flow_network $\sum\limits_{w\in V} f(u,w) = 0 $ $(\forall u \in V-\{s, t\})$ That implies $\sum\limits_{(u,v)\in E} f(u,v) = \sum\limits_{(v, z)\in...
For example, we can say we have a abstract program that, given a finite binary string as input, removes all of the zeros (i.e. 0010001101011 evaluates to 111111), which is definitely a Turing-computable function. How can a cyclic tag system compute this (which it can, by definition of it being Turing-complete) when it ...
I have a fairly general problem and I wonder if it has a name. The problem statement, as best I can put it, is the following: Let $I=\{i_1,i_2,...,i_n\}$ be a set of items. Let $C=\{C_1,C_2,...,C_m\}$ be a set of containers. Each container is unique and contains a set of items from $I$. Let $C_{a,b} \subseteq C$ be th...
The primary definition of Turing machine (TM), at least in my own reference textbook (Hopcroft+Ullman 1979) is deterministic. Hence my own understanding of the halting problem is primarily for deterministic TM, though I am aware that it may be considered for other kinds of automata. I also noticed that determinism is o...
In a research paper I read $F(n) \leq O(g(n))$ and $F(n) \geq \Omega(h(n))$. Isn't this the same as $F(n) = O(g(n))$ and $F(n) = \Omega(h(n))$? Is there a difference?
Given a graph G, and positive integers k, q, pack the edges of G in (pairwise edge disjoint) connected sub-graphs, each of size (number of edges) at most k, and such that, no vertex is part of more than q of these connected sub-graphs. What is the closet related problem already studied? What can be said in case we rest...
In the field of data structures (and maybe in graph theory), can we use the term topology to speak about the shape of a tree? For instance, consider the two following trees : 1) The first one: Node $a$ is parent of $b$ and $c$. Node $e$ is parent of $a$ and $d$ 2) the second one: Node $a$ is parent of nodes $b$, $c$ an...
My question is why the dynamic programming of the knapsack problem does run in polynomial time? The question is answered here Why is the O(nW) algorithm for the Knapsack problem not a polynomial one? I understand the argument of the answer above. Also the answer is given in this book ''The Desing of Approximation Algor...
Recently I was faced with the following Graph traversal problem: "Given an arrangement of buildings in form of a DAG. All the buildings have to be colored, but there is an order for that represented by edges in the DAG. If there is an edge from A->B, this would mean building B can only be colored after building 'A' has...
L is as usual the complexity class DSPACE($\log n$), of languages decidable using a deterministic Turing machine using logarithmic workspace. Is L closed under linear-time reductions? It is possible that for some pair of languages Q and R, every linear-time reduction from Q to R requires more than logarithmic space. ...
In the context of communication complexity I see a definition of differential privacy which isn't totally clear to me as to why it makes sense. So the two parties $A$ and $B$ draw two strings $X$ and $Y$ from the set $S^n$ where $S$ is some finite set. Let $P$ be the protocol. Now if $z_1 = (X_1,Y_1)$ and $z_2 = (X_2,...
For the program mean(A,n) if n = 1 then return A[n] else return A[n]/n+mean(A,n-1)*(n-1)/n end Show that if the recursive call to mean (A, n-1) returns the mean of A[1,...n-1] then the call mean (A,n) returns the mean of A[1,...n]. I know that the program always terminates with mean (A...
There's tons of research on program transformations for optimization. Is there any research on transformations that improve numeric stability? Examples of such transformations might include: Transform $\log(\exp(a)+\exp(b))$ into $\max(a,b)+\log(\exp(a-\max(a,b))+\exp(b-\max(a,b)))$ Convert multiplication of an inve...
I'm trying to use computer vision to identify objects an image. I am currently using the SURF algorithm, but Harris and SURF both find virtually no points on our objects (a paper ball and a deodorant can) due to their simple features. If it does find points it finds one or two that aren't the same points it find in the...
I am having trouble finding an example for the following algorithm to prove that it calculates a 2-approximation: Repeatedly select a vertex $v$ of highest degree, add one of its edges $(v,w)$ to the cover, and remove all edges incident to $v$ or $w$. Please give me insights on how to pick an example.
I was listening to Eric Demaine's video lecture on AVL trees and there was a claim that comes up that keeping a trit on each node (to indicate whether the node is left heavy, right heavy or balanced) should be sufficient for all AVL tree operations, so essentially we don't need to keep heights of the node for every nod...
could someone provide me/refer me to a intuitive idea/proof behind Kirchhoff's Matrix Tree Theorem that uses as little technical details involving matrices/linear algebra as possible? I'm trying to give a group of talented high schoolers who haven't seen matrices before a sketch/cursory proof of the result, but I could...
Thanks in advance...looking for recommendations on an algorithm to find all paths of length n starting from a single node in a directed, cyclic graph. I am not concerned with at which node the path completes. i.e. not looking to travel from i to j in a path of a certain length. I would like to start from i and end ult...
I jsut read up on the principle of centrality, where "Think of a "network" as an NxN matrix, which has information about how N people (or N pages or N countries..) are connected to each other. Adjacency Matrix is an NxN matrix, let's say it looks something like this. People who aren't connected to each other have A[i]...
I have the following algorithmic problem. I am given a set of elements. Each element has a set of properties. For example: A: has properties p1, p2, p4 B: has properties p2, p4 C: has properties p2, p1 The task is to find the number of subsets of elements, where the union of the properties of the elements in the su...
I have to solve the following problem: Al and Bob are arguing about their algorithms. Al claims his $O(n\log n)$ time method is always faster than Bob’s $O(n^2)$ time method. To settle the issue, they perform a set of experiments. To Al’s dismay, they find that if $n<100$, the $O(n^2)$ time algorithm runs faster, and ...
In graph theory, the crossing number cr(G) of a graph G is the lowest number of edge crossings of a plane drawing of the graph G. (from wikipedia) I know that the problem of counting the Crossing Number of a graph to be less than or equal to K is proven to be NP-Complete by Garey and Johnson in 1983. I couldn't f...
I am trying to understand the concept of logical to physical addressing. I am given 72 physical addresses (0-71) with values A virtual address = 2^(p+w) p = page bits w = word bits I know the page table is of size 6 indexed 0-5 If a page size is 16 words does that mean that the offset(w)=4, giving me 2^(p+4). If tha...
I'm studying ones' complement representation and I read in a book that a negative number in ones' complement is a pseudo-positive of value $R^n - 1 - |x|$. However there is no demostration and I can't find it anywhere. If someone could tell me the reason I will be very thankful.
Perhaps my limited understanding of the subject is incorrect, but this is what I understand so far: Functional programming is based off of Lambda Calculus, formulated by Alonzo Church. Imperative programming is based off of the Turing machine model, made by Alan Turing, Church's student. Lambda calculus is as powerful...
Given the following recurrence: $$ T(n) = T(n-1) + n^2$$ How can I prove it to be $O(n^3)$ with the substitution method? The $O(n^3)$ guess derives from the fact that at every step of the recursion we pay $n^2$ and we have $n$ steps of recursion therefore having: $n \times n^2 = n^3$. I would even expect this to be $\T...
As is widely known, Alan Turing discovered/invented the Turing Machine in his classic 1936 paper. Here he also gave how these machines are specified in terms of their machine states and instructions on how they operate. Is there any official or widely accepted name for this "first" mathematically defined programming la...
Look at the diagram in the middle of page 6-3 here, http://stellar.mit.edu/S/course/6/fa14/6.845/courseMaterial/topics/topic3/lectureNotes/qctlec6/qctlec6.pdf I am confused as to how should one think of the Hadamard gate. As per the mathematics shown below it seems that the Hadamard gate, $H$ acts on tensor products o...
By a word frequency algorithm: An algorithm gets a document as an input, and returns each unique word along with the number of times it has appeared in the document. For example: in:"Hello my name is Hello" out: {'Hello':2, 'is':1, 'my':1, 'name':1} In my implementation, I used a hash table to store the words. But I'...
In algorithms we use to find Big-O (upper bound), Big-omega (lower bound) and Big-Theta but why we are always interested in finding upper bounds instead of lower bounds?
I understand what parity is (Sort of): A data recovery mechanism where missing data is calculated based on the data that exists. However i have encountered terminology which i can't define or put into perspective of the RAID system. This terminology is 'dedicated' and 'distributed' Parity. Now i imagine that it is som...
I want to find all the simple cycles with bounded length that pass through a vertex in a directed graph. Enumerating all the cycles in large graph takes exponential time. Since I need to find only the cycles that passes through a given vertex and I can save the running time. But I am not getting any proper algorithm to...
I got this question in a past test that I'm trying to solve but i don't have the solutions to check my self: Given a set of n segments $[a_i ,b_i]$ where $i=1,..,n$ and $a_i < b_i$. write an algorithm which find a segment that the number of segments $[a_l ,b_l]$ before it $(b_l < a_i)$ are equal to the number of segmen...
I'm trying to show that $L=\{ \langle M \rangle \colon L(M)=L(M)^R\}$ is undecidable, but I don't even know where to begin. Google wasn't much of a help, maybe because it's hard describing the language in words. Any hints?
I have a large number of floating point numbers (~10,000 numbers) , each having 6 digits after decimal. Now, the multiplication of all these numbers would yield about 60,000 digits. But the double range is for 15 digits only. How can I get my product with minimum loss in precision? I thought of storing the numbers as 6...
I'm designing an in-memory object database for a very specific use case. It is single writer, but must support efficient concurrent reads. Reads must be isolated. There is no query language, the database only supports: get object/-s by attribute/set of attributes (there may be support for expressions, e.g. x.count < 5...
I have the following interface: public interface TreeElement<T>{ public List<TreeElement<T>> getChildren(); } Now, suppose I have a collection of TreeElement<T> representing a valid tree. How to find it's root element? Is there something more efficient than iterating over the whole collection?
Assume that initially in array each element has infinity as value. Now M queries are input of the type l r x. Here l to r is range where value need to be updated if a[i]>x where l<=i<=r. and l<=r<=n After M queries you need to output the minimum value at each index. One way to this is to use Brute Force memset(a,inf,si...
Let $L(M_k) = \{ \langle M \rangle | M \text{ halts on }\epsilon \} \cap \Sigma^k $ Disprove that $\exists f\colon N \rightarrow \Sigma^* . f(k)=\langle M_k \rangle$. I am not sure where I am wrong: I said that I can convert the question to whether the language of all the Turing machines that accept the language $L(M...
Let's say I have some very long hex fraction like this: 0.3F30A21306AEFCBADE3230A593EFAEB395A39E What are some algorithms with an acceptable complexity to convert it to the associated decimal string: 0.246835... ?
I'm reading "Structured Programming with go to Statements" by Knuth, and in it, he gives the following algorithm and a run-time cost analysis of some hypothetically generated code, letting $n$ stand for the number of times around the loop, and where instruction fetch and memory accesses cost one unit, so for example $r...
This comes from trying to understand the "Simon's algorithm". So we have a set of $2^n$ kets $|x_i \rangle$ one each for $i \in \{0,1\}^n$. Each $x_j \in \{0,1\}^n$. And we have the further constraint that $x_i = x_j$ iff $i = j + s \pmod{2} = j \oplus s$ (bitwise addition modulo $2$) for a certain $s \in \{0,1\}^n$. ...
I'm not sure if this is an open question, but what is the graph with $8$ vertices and $12$ edges that has the most spanning trees?
I have trouble determining the running time function for algorithm below. I know that there are initially two assignment operations, int i=n and int s=0. Also, I know that the while loop is represented by $\lfloor \log_2n \rfloor + 1$, but the for loop depends on the value of $i$ which decrements by half. So, the first...
I was having a heated debate with a friend of mine (who considers me an idiot, mind you) and we were arguing about whether a compiler has an index, or coefficient, that judges how poorly code is written. Things such as useless for loops, declared variables that aren't used, excessively verbose parameter names, and the ...
Consider the (big-step) semantics of a language ($a, e$ terms, $v$ values), defined by two mutually recursive relations, $\downarrow$ and $\Downarrow$, given by a set of rule-schemata (simplified): $\frac{a \cdot x \Downarrow e ~~ e \downarrow v}{a \cdot x \downarrow v}{\tiny PROJECT} ~~~~~~~ \frac{a \downarrow \{ \ldo...
I am starting to study about Multi Agent Systems and I wanted to know which sciences are most used in these systems, I am aware of game theory and Markov statistical relations (Markov Decision Process and Markov Hidden Model). But I am not aware of all.If someone could name them for me it would be appreciated. I also w...
I am trying to calibrate a Markov Chain. Usually you would have the amount that "moves" from one state to the other and then the resulting value, with data at any given time with the following arrangement: $$ \begin{matrix} F_{a,a} & F_{a,b} & F_{a,c}\\ F_{b,a} & F_{b,b} & F_{b,c}\\ F_{c,a} & F_{c,b} & F_{c,c}\\ ...
I have an edge weighted $N{\times}N$ graph and the edge similarity values are bound to $[0,1]$. What I am trying to do is to find a cut-off threshold below which I can say that that edges are noisy/ non relevant. What I have tried so far is removing edge values that are below median or 60% - 70% quantile. Another appr...
My question is about D2D as it relates to 3GPP (release 13+, I believe). All I have read on the subject uses Game Theory as a mechanism to explain usage. Why would authors use Game Theory for explaining D2D with 3GPP (5G, LTE) communication? Have telephony companies had to do the same with 3G and 4G for some reason?...
Suppose we have a DAG of tasks: Arrows represent flow (reversed dependencies: 8 must be run after 7). Some of the tasks (like 4, 5, 6) can be run in parallel (Par block). Dependent tasks (like 7, 8, 9) must be run sequentially (Seq block). I need to parse this DAG into recursive structure of Seq and Par blocks (collec...
In an answer to a previous question Luke Mathieson wrote: A place where this might fall down is when you are working with numbers. As a number with magnitude $m$ can be encoded in $n=O(\log m)$ bits, if our running time were $O(m)$, this would be $O(2^n)$ - exponential in the actual input size - which would make the m...
I have already taken a college course at my uni on machine learning where we implemented all the basic ML programs: linear regression, logistic regression, basic neural network with logistic regression (not perceptron, but we learned the theory of perceptron as a history lesson), k-means, and naive Bayes classifier. Th...
Languages to express domain rules are quite diverse from very simple and inexpressive to Turing-complete programming languages. If we consider developing some DSL (domain-specific language), is there any generally useful scale (Chomsky hierarchy comes to mind as an analogy, as well as Description Logic "letters", like ...
I'm not really sure, if this is the right place to ask this question. I would have asked on stackoverflow, but since my question is rather theoretical, I ask here. When I'm wrong, please migrate. Thank you :) I'm trying to multiply polynomials using FFT. When doing an FFT in-place, the output is in bit-reverse order,...
I am quite new to vision and OpenCV, so forgive me if this is a stupid question but I have got really confused. My aim is to detect an object in an image and estimate its actual size. Assume for now I only want length and width, not depth. Lets say I can detect the object, find its size(length and width) in pixels and ...
I am looking for an efficient method to find all unique combinations of $n$ rows in a matrix. For example, if $n=6$, then I want to find all sets of 6 rows from the input set C in which the columns have only unique values. Input: C = [[ 3.031 3.392 2.987 4.248 3.364 3.354] [ 3.031 3.392 2.987 3.975 2.911 3...
I have a map size of 8 x 8 cells with no obstacles. I should generate random path from start cell to the end cell with given length. Path can move up/down/left/right directions but not cross itself. What algorithm I can use to do this?