instruction
stringlengths
0
29.8k
⌀
I'm building an application which should suggest products for the users. I want to base my recommendation on different attributes, like: location, weather, date, etc. Every of this attribute can have multiple values so the space of the possible situations I have to take into account is huge. I was thinking about two a...
Recommendation algorithms based on a set of attributes
|recommendation-systems|
Before I start: I understand the scope of this StackExchange site (I think), but do pardon if I'm off-topic. My question is an intersection of mathematics, computer science, and software engineering, so picking the right site to ask on has been a bit unclear. That said, after asking [here](http://metaoptimize.com/qa/) ...
How do I classify my emulator input optimization problem, and with which algorithm should I approach it?
|reference-request|optimization|machine-learning|
|artificial-intelligence|recommendation-systems|
Due to the nature of the question, I have to include lots of background information (because my question is: how do I narrow this down?) That said, it can be summarized (to the best of my knowledge) as: **What methods exist to find local optimums on extremely large combinatorial search spaces?** ## Background ...
|reference-request|machine-learning|combinatorics|optimization|search-problem|
As Kaveh says in a comment, Kleene bestowed the name way back when he kicked off automata theory and formal languages. I believe the term was arbitrary, though it has been many years since I read his original paper. Mathematicians have a habit of hijacking common nouns and adjectives for mathematical objects and pr...
null
null
Generating functions are a very powerful and very useful magic wand. The following solution to the first question (why are there $C_n$ trees) is somewhat less magical. Hence, cute. **First bijection.** A typical definition for trees in ML is `type tree = T of tree * tree | E`; that is, a tree either has two (ordered...
Say I have a weighted undirected complete graph $G = (V, E)$. Each edge $e = (u, v, w)$ is assigned with a positive weight $w$. I want to calculate the minimum-weighted $(d, h)$-tree-decomposition. By $(d, h)$-tree-decomposition, I mean to divide the vertices $V$ into $k$ trees, such that the height of each tree is $h$...
|algorithms|complexity-theory|graphs|approximation|
Let us break it down bit by bit. First of all, remember what Knuth wrote on page 7: > Let us formally define a *computational method* to be a quadruple $(Q,I,\Omega,f)$, in which $Q$ is a set containing subsets $I$ and $\Omega$, and $f$ is a function from $Q$ into itself. [...] The four quantities $Q$, $I$, $\Omega$...
That text describes the following (Python) pseudocode: subs = a list of string pairs As = a list of integers Bs = a list of integers def f(state, pc): if pc == N: return (state, pc) if state.find(subs[pc][0]) != -1: return (state.replace(subs[pc][0],subs[pc...
|cryptography|security|authentication|
|complexity-theory|time-complexity|computational-geometry|
I am wondering if there are any connection between convex polygon and castable object? What can we say about castability of the object if we know that the object is convex polygon and vice versa. Let's gather together few basic things that we have to know. >The object is castable if it can removed from the mold. ...
|algorithms|machine-learning|computational-geometry|
|asymptotics|recurrence-relation|
null
Are there undecidable properties of linear bounded automata (avoiding the empty set language trick)? What about for a deterministic finite automaton? (put aside intractability). I would like to get an example (if possible) of an undecidable problem that is defined *without using Turing machines* explicitly. Is T...
Are there undecidable properties of non-turing-complete automata?
|computability|automata|undecidability|
Let $f(n)$ be a shorthand for the right-hand side of the recurrence. We find an lower and upper bound for $f$: $$ 3 T(n/3) + 2n^2+ 5n + 42 \quad \le\quad f(n) \quad\leq \quad 3 T(n/2) + 2n^2+ 5n + 42 \quad$$ If we use the lower resp. upper bound as right-hand side of the recurrence, we get $T'(n) \in \Theta(n^2)...
The language is regular. Consider this (rule set of a) simple regular grammar that obviously generates $L$: $\qquad \displaystyle S \to 11S \mid \varepsilon$
|formal-languages|regular-languages|proof-techniques|
The [Knuth-Morris-Pratt algorithm](http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm) does this in linear time without any error.
|algorithms|strings|searching|probabilistic-algorithms|
I need to detect whether a binary pattern $P$ of length $m$ occurs in a binary text $T$ of length $n$ where $m < n$. I want to state an algorithm that runs in time $O(n)$ where we assume that arithmetic operations on $O(\log_2 n)$ bit numbers can be executed in constant time. The algorithm should accept with probabi...
Randomized String Searching
$$ 3 T(n/3) + 2n^2+ 5n + 42 \le \\2 T(n/2) + T(n/3) + 2n^2+ 5n + 42 \le \\3 T(n/2) + 2n^2+ 5n + 42$$ First and third one by master theorem are $\Theta(n^2)$ so your problem is $\Theta(n^2)$. --- P.S: For ending with this proof, you should prove that your function is increasing function.
Let $f(n) = 2T(n/2) + T(n/3) + 2n^2 + 5n + 42$ be a shorthand for the right-hand side of the recurrence. We find an lower and upper bound for $f$ by using $T(n/3) \leq T(n/2)$: $$ 3 T(n/3) + 2n^2+ 5n + 42 \quad \le\quad f(n) \quad\leq \quad 3 T(n/2) + 2n^2+ 5n + 42 \quad$$ If we use the lower resp. upper bound a...
|complexity-theory|satisfiability|
I wanted to confirm something and will appreciate your help. Suppose we have three nodes called A,B and C. All are connected to a switch whose port supports 1 Gbps. Now suppose, Node's A network card is 100 Mbps while the the remaining have a 1 Gbps. Following are the constraints; 1. A can send B only with a maximum...
|reference-request|computer-architecture|operating-systems|computer-networks|power-consumption|
Define $\mathrm{Prefix} (L) = \{x\mid \exists y .xy \in L \}$. I'd love your help with proving that $\mathsf{RE}$ languages are closed under $\mathrm{Prefix}$. I know that recursively enumerable languages are formal languages for which there exists a Turing machine that will halt and accept when presented with any...
Proving that recursively enumerable languages are closed against taking prefixes
|formal-languages|turing-machines|closure-properties|
I am struggling with hashing and binary search tree material. And I read that instead of using lists for storing entries with the same hash values, it is also possible to use binary search trees. And I try to understand what the worst-case and average-case running time for the operations 1. `insert`, 2. `find` ...
Hashing using search trees instead of lists
|data-structures|time-complexity|runtime-analysis|search-trees|hash-tables|
See Levenshtein's [paper][1]. It contains bounds on the number strings obtained from insertion and deletion of a string. If $n$ is the length of the string and the string is binary, then the maximum number of nearest neighbors in the Levenshtein distance is $\Theta(n^2)$. It is comparatively harder to say anything abou...
### Constructing a DFA There is an algorithm to construct a [minimal DFA](http://en.wikipedia.org/wiki/Dfa_minimization) for a regular language. In this case, it isn't too hard to come up with a DFA with $z(z+1)/2$ states. Observe that $L_z = \{\epsilon, abc, aabbcc, \ldots, a^{z-1}b^{z-1}c^{z-1}\}$. Once you kno...
A divide and conquer algorithm's work at a specific level can be simplified into the equation: $\qquad \displaystyle O\left(n^d\right) \cdot \left(\frac{a}{b^d}\right)^k$ where $n$ is the size of the problem, $a$ is the number of sub problems, $b$ is the factor the size of the problem is broken down by at each re...
Recursion for runtime of divide and conquer algorithms
|algorithm-analysis|asymptotics|runtime-analysis|recursion|mathematical-analysis|
My answer : (0+1)* 0 (0+1)* 0 (0+1)* Why is this incorrect? Can somebody explain to me what the correct answer is and why?
Regular expression for all strings with at least two 0s over alphabet {0,1}
|regular-expressions|
Suppose that $L(M) = L$ where $M$ is a $TM$ that moves only to the right side. I need to Show that $L$ is regular. I'd relly like some help, I tried to think of any way to prove it but I didn't reach to any smart conclusion. what is it about the only side right moves and the regularity? Any hints? Thanks a lot...
$L(M) = L$ where $M$ is a $TM$ that moves only to the right side so $L$ is regular
|formal-languages|turing-machines|regular-expressions|
Suppose that $L(M) = L$ where $M$ is a $TM$ that moves only to the right side. I need to Show that $L$ is regular. I'd relly like some help, I tried to think of any way to prove it but I didn't reach to any smart conclusion. what is it about the only side right moves and the regularity? Any hints?
null
Suppose that $L(M) = L$ where $M$ is a $TM$ that moves only to the right side. I need to Show that $L$ is regular. I'd relly like some help, I tried to think of any way to prove it but I didn't reach to any smart conclusion. what is it about the only side right moves and the regularity?
From wikipedia, definition of big O notation: > if and only if there is a positive constant M such that for all > sufficiently large values of x, f(x) is at most M multiplied by g(x) > in absolute value. That is, f(x) = O(g(x)) if and only if there exists > a positive real number M and a real number x0 such that...
Is it true or false? Explain please. Let f and g be asymptotically nonnegative functions. Then, at least one relationship of `f(n) = O(g(n))` and `g(n) = O(f(n))` must always hold Thanks in advance
Asymptotic notations
|untagged|
It's incorrect for example because it does not match the string $100$. The two zeroes would have to match the two zeroes in your regexp that are ouside the parentheses. Because of that, $(0+1)^*$ would have to match $1$, but it doesn't. That's because $(0+1)^*$ implies there has to be at least one zero for every $1$...
It's incorrect for example because it does not match the string $100$. The two zeroes would have to match the two zeroes in your regexp that are ouside the parentheses. Because of that, $(0\!+\!1)^*$ would have to match $1$, but it doesn't. That's because $(0\!+\!1)^*$ implies there has to be at least one zero for e...
Is it true or false? Explain please. Let f and g be asymptotically nonnegative functions. Then, at least one relationship of $f(n) = O(g(n))$ and $g(n) = O(f(n))$ must always hold
|homework|asymptotics|
null
From wikipedia, definition of big O notation: > if and only if there is a positive constant M such that for all > sufficiently large values of $x$, $f(x)$ is at most M multiplied by $g(x)$ > in absolute value. That is, $f(x) \in O(g(x))$ if and only if there exists > a positive real number $M$ and a real number ...
null
null
|homework|asymptotics|mathematical-analysis|
|formal-languages|regular-expressions|
Hint -- You need to show that your TM has the same power as a finite-state automaton (as the commenter Dave Clark said), that is, given such a TM, construct a FSA that accepts the same language. But since the TM has no memory but the tape, ask yourself what a right-only TM can do with its tape. It should be relat...
What is a good way to do this, passing through only valid words in between ([this](http://www.wuzzlesandpuzzles.com/wordchange/) website has some examples)? My current idea: - I could use a shortest path algorithm with the Hamming distance for edge weights. The problem is that it will take a long time to build ...
Turn one string into another with single letter substitions
|algorithms|
The only difference between a finite automaton and a Turing machine is the tape. The tape provides memory ability. If you can go only on one side, then you simply can't read what you have written. To formally prove this you build an automaton from your machine $M$. Suppose $A$ is the automaton in $M$. Then your auto...
|algorithms|strings|edit-distance|
|algorithms|time-complexity|strings|word-combinatorics|edit-distance|
The graph I consider has the valid words for vertices and edges correspond to one-letter substitutions. In this graph the Hamming distance never *overestimates* the distance but can underestimate it (e.g. between $aa$ and $cc$ in the set of valid words $\{aa,ab,bb,bc,cc\}$) You don't need an actual graph, you just n...
I am not sure if I understood the problem setting correctly, but I think a breadth-first search works? **Problem:** Given words $w$ and $w'$ from a dictionary $D$, is it possible to find a sequence of words $w_0,...,w_k$, such that each word is from $D$, $w_0=w$, $w_k=w'$, and $w_i$ and $w_{i+1}$ differ by exactly ...
Why is the worst scenario $\mathcal{O}\left(n^2\right)$ when using quicksort to find the median of a set of numbers? - If your algorithm continually picks a number larger than or smaller than *all* numbers in the list wouldn't your algorithm fail? For example if the list of numbers are: $S = (12,75,82,34,55,1...
Quicksort to find median?
|algorithms|algorithm-analysis|search-algorithms|sorting|
Why is the worst scenario $\mathcal{O}\left(n^2\right)$ when using quicksort to find the median of a set of numbers? - If your algorithm continually picks a number larger than or smaller than *all* numbers in the list wouldn't your algorithm fail? For example if the list of numbers are: $S = (12,75,82,34,55,...
null
A recent exam question went as follows: A is an infinite recursively enumerable set. Prove that A has an infinite recursive subset. (I did this.) Let C be an infinite recursive subset of A. Must C have a subset that is *not* recursively enumerable? I answered affirmatively and argued as follows. Suppose that all ...
subsets of infinite recursive sets
|computability|turing-machines|recursion|
Quicksort is for sorting, the algorithm you refer to is known as Selection algorithm and it is in fact O(n) worst-case. [Selection algorithm][1] [1]: http://en.wikipedia.org/wiki/Selection_algorithm
null
Describe the Cyclic Coordinate method and outline the similarities and the differences between the Cyclic Coordinate method, the Hooke and Jeeves method, and the Rosenbrock method. Any Ideas? Or some good sources to Read, I'm having trouble finding any..
Question Regarding Cyclic Coordinate method
|algorithms|optimization|
Hint -- You need to show that your TM has the same power as a finite-state automaton (as the commenter Dave Clarke said), that is, given such a TM, construct a FSA that accepts the same language. But since the TM has no memory but the tape, ask yourself what a right-only TM can do with its tape. It should be rela...