instruction stringlengths 0 29.8k ⌀ |
|---|
I just saw this [Youtube][1] link about a voice controller module that can recognize some sentences and perform an action.
So what's the math behind this?
Is it Support Vector Machine, Deep Neural Networks, MFCC, PCA, LDA? Or non of them?
[1]: https://www.youtube.com/watch?v=z4Az6-MwPJ4&ab_channel=ScienceBud... |
What is the tool/method behind training a voice control model for Arduino? |
|speech-recognition| |
SVM:
- Faster to compute
- Requires less data to validate
- Less accurate than KNN where KNN is for nonlinear data as well.
Hint: Use a kernel with SVM, then you will get a very good result. |
I am trying to find resources that explain an easy to implement (not necessarily optimal but reasonable runtime) algorithm for inserting Steiner points in a triangulation.
There seems to be little literature on the topic. My understanding is that different people pick different criteria to optimize, some pick trian... |
Algorithm for Steiner points? |
|graphs|computational-geometry|discrete-mathematics|triangulation| |
I could not find a good source on the Stockham FFT either. So here is my attempt of a comprehensive answer. Disclaimer: I did not track down the original source of the Stockham FFT. Most of my information comes from the following **non-encrypted** japanese website, *so make sure You at least **use a script blocker** if... |
If you already have a constrained triangulation, to test if it contains the line segment $(a,b)$, You can do the following:
1. Find the triangle $(p,q,r)$ that contains $a$
2. If $(p,q,r)$ contains b, return $true$
3. Find the edge $(s,t) \in \left\{(p,q), (q,r), (r,p)\right\}$ which intersects $(a,b)$
4. If ... |
If you already have a constrained triangulation, to test if it contains the line segment $(a,b)$, You can do the following:
1. Find the triangle $(p,q,r)$ that contains $a$. If it does not exist, return false
2. If $(p,q,r)$ contains b, return $true$
3. Find the edge $(s,t) \in \left\{(p,q), (q,r), (r,p)\right\... |
null |
null |
Thanks to comment by @Yuval Filmus I get the idea. Basically we abuse transitivity that $x_j< x_{j+1}$ and $x_{j+1}< y_{j+1}\implies x_j< y_{j+1}$. Therefore we can conclude $(x_j,y_j)$ can never be one of $i$ smallest for any $i<j$ by partitioning the array around $(x_i,y_i)$ using `SELECT` (we select only on $x$ entr... |
## What is a fixed point?
A fixed point of a function is a value unchanged by that function. For example $0^2=0$ and $1^2=1$, so $0$ and $1$ are fixed points of the squaring function. Similarly “ASDF” is a fixed point of the function converting text into upper case.
_This was unclear at the time of asking, as ‘fixe... |
Here's a pairwise consistency example. Suppose you're checking a directed graph for pairwise consistency. In other words, you're checking that there are no cases in which, say, A is greater than B is greater than C is greater than A. (Edge direction indicates "is greater than.")
Consider a graph with two paths that ... |
Here's a pairwise consistency example. Suppose you're checking a directed graph for pairwise consistency. In other words, you're checking that there are no cases in which, say, A is greater than B is greater than C is greater than A. (Edge direction indicates "is greater than.")
Consider a graph with two paths that ... |
Here's a pairwise consistency example. Suppose you're checking a directed graph for pairwise consistency. In other words, you're checking that there are no cases in which, say, A is greater than B is greater than C is greater than A. (Edge direction indicates "is greater than.")
Consider a graph with two paths that ... |
null |
Here's a pairwise consistency example. Suppose you're checking a directed graph for pairwise consistency. In other words, you're checking that there are no cases in which, say, A is greater than B is greater than C is greater than A. (Edge direction indicates "is greater than.")
Consider a graph with two paths that ... |
null |
Looking through old exams I found a problem stated as the following:
> Define a 0L-system as a 3-tuple $S = (\Sigma, w, h)$ where $\Sigma$ is an alphabet, $h:\Sigma^* \to \Sigma^*$ is a homomorphism and $w \in \Sigma^*$ is a starting word. Furthermore define $L(S) = \{w,h(w),h(h(w)),...\}$ and define $L$ as a 0L-lan... |
Does this really define a 0L-system? |
|formal-languages|context-free|pumping-lemma| |
null |
Let:  be given by
[![enter image description here][1]][1]
Compute Boolean formulas for the following: [![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/NaIpg.png
[2]: https://i.stack.imgur.com/EOmqd.png
This is p... |
Given a language L how can I derive its Boolean formula? |
|complexity-theory|circuits| |
null |
The decrease key is in fact mentioned as an exercise 6.5-4 in CLR. Here is why I think it was not presented in the chapter itself: It can be constructed simply by reusing the `MAX-HEAPIFY(A, i)` i.e. you will only need to compare the element to its children not its parent(since you decreased the key); The comparison to... |
null |
null |
null |
null |
Shortest cycle: BFS has the nice property that, if started from u, the first time the BFS finds u is when the shortest cycle that includes u has been completed.
Email infections: Determining whether a computer is infected from looking at the email metadata, BFS and DFS are about the same, since you don't know if tha... |
While *Time Complexity* is the measure of how an algorithm scales with respect to input size, *Space Complexity* on the other hand measures how much the memory scales as input changes.
I see programmers pre-dominantly using these 2 metrics but are there any other generic measures/metrics for comparing the ... |
What else measures are used to compare algorithm efficiency apart from Time and Space complexities? |
|algorithms|time-complexity|space-complexity| |
null |
null |
null |
null |
Exercise 2.1. Consider the following two sequential hardware circuits:
r1
AND
x1
r2
OR
x2 OR AND
NOT
y1 y2
Questions:
(a) Give the transition systems of both hardware circuits.
(b) Determine the reachable part of the transition system of the synchronous product of these
transition systems. Assume that the i... |
I'll just consider $\text{MOD}^1_{0,3}$, the other ones are similar. I'm assuming that you want a boolean formula $\phi$ such that $\text{MOD}^1_{0,3}(x_1, \dots, x_n) = 1 \iff \phi(x_1, \dots, x_n) \text{ is true}$.
Note that $\text{MOD}^1_{0,3}(x)$ is true if and only if the number of variables set to $1$ is a mul... |
null |
This paper, [On Strong NP-Completeness of Rational Problems ][1], proves that partition problem is strongly NP-complete when all input numbers are rational numbers.
[1]: https://livrepository.liverpool.ac.uk/3052214/1/csr18.pdf
|
(This is a copy of [the answer][2] to the same question on the general StackOverflow)
There exist algorithms that can add a vertex with all its edges to a graph with a known MST in linear time, which is faster than Prim or Kruskal. Probably the most neat algorithm proposed in the paper below [1] uses just one clever... |
null |
null |
To find all the edges inside a polygonal constraint *inside* of a larger constrained triangulation, You can do the following:
1. Find a single triangle inside the polygonal constraint
2. Use [flood fill](https://en.wikipedia.org/wiki/Flood_fill) to find all triangles inside the polygonal constraint
3. Put al... |
When it comes to the numerical methods used in science and engineering, one important measure is numerical accuracy. |
null |
I have modified Busy Beaver Turing Machine scenario. Is this new scenario equivalent to the standard one?
Consider a double sided tape with P slots on each side.
Twist it into a mobius strip.
Initially all zeros on the slots.
Consider the seam-line at which tape joins itself after twist
We define a mobiu... |
Consider A Busy Beaver like Turing Machine on a Mobius Strip. Is it equivalent to standard BB number? |
|discrete-mathematics|mathematical-analysis| |
I have modified Busy Beaver Turing Machine scenario. Is this new scenario equivalent to the standard one?
Consider a double sided tape with P slots on each side.
Twist it into a mobius strip.
Initially all zeros on the slots.
Consider the seam-line at which tape joins itself after twist
We define a Mobiu... |
null |
I have modified Busy Beaver Turing Machine scenario. Is this new scenario equivalent to the standard one?
Consider a double sided tape twisted it into a mobius strip having P slots in total.
Initially all zeros on the slots.
Consider two adjacent slots.
We define a Mobius Busy Beaver number which is the sum... |
If You find a co-planar triangle candidate, it has to be one that does not contain any other points in that plane. I am not familiar with rust so here is a pseudo-code attempt to enhance your code:
```rust
if dot > best_dot || (
dot == 0 &&
best_dot == 0 &&
(triangle (p1_id, p2_id, best_point) contain... |
If You find a co-planar triangle candidate, it has to be one that does not contain any other points in that plane. I am not familiar with rust so here is a pseudo-code attempt to enhance your code:
```rust
if dot > best_dot || (
dot == 0 && // <- should always be true at this point
best_dot == 0 &&
(t... |
If You find a co-planar triangle candidate, it has to be one that does not contain any other points in that plane. I am not familiar with rust so here is a pseudo-code attempt to enhance your code:
```rust
if dot > best_dot || (
dot == 0 &&
best_dot == 0 && // <- should always be true at this point
(t... |
The geometric solution in case of coplanar points is to form the convex hull of the coplanar points in their plane, giving a convex polygon. The internal sites are discarded.
Unfortunately, I cannot tell you how to update your algorithm.
|
No. A finitely-sized tape means the Turing machine is not Turing-complete, but in fact a (very large) state machine. This makes the busy beaver number computable in your setup, and thus necessarily different than the original busy beaver numbers. |
null |
A hex graph can be represented as a 2D matrix where every other column is shifted vertically. It is no big deal to enumerate the six neighbors of a given cell.
This said, you can start from an empty grid and write the words, starting from a random cell and moving in random directions, as long as the next cell is emp... |
null |
null |
null |
I agree with you, the definition is incorrect.
You are trying to prove that $\exists l.\text{0L-L(l)}\land\lnot CFL(l)$. This proof amounts at telling what $l$ is, to show (in separate branches) that it satisfies $\text{0L-L}(\cdot)$ and fails to satisfy $CFL(\cdot)$.
You pointed out $L(S_C)$ satifies $\text{0L-L}$... |
I am looking for an algorithm that allows me to roughly balance items that are grouped into groups with random sizes between `n` elements in a consistent manner.
Consider the following example:
There are `n` persons.
There are `x` hosts.
There are `y` customers.
A random amount `z` of hosts belong to eac... |
semi-consistently balance grouped items |
by calling the original heap's algorithm `generate(k,A)`, we expect it to print all permutations of $A[1:k]$ and $A$ will be rotated to the right $1$ unit if its size is even, else it'll be unaltered.
I've no idea how to generate k-permutations of N objects by directly changing heap's algo because by changing what ... |
i tried calculating time complexity for this code:[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/8eQ2i.png
the answer i got is n since the the space complexity is logn and i calculated the sum of geometric sequence with q=4 and n=logn. but apparently its sqrt(n) can someone explain why?
... |
calculating time complexity |
|time-complexity| |
**Task.** Find such natural numbers a1,. . . , am , that none of them would be included in the list of excluded numbers, a1 + · · · + am = N and max{a1 , . . . , am} would be as small as possible. Numbers cannot be reused.
**Initial data.** The first line contains two natural numbers N and K - desired sum and length... |
Efficient algorithm for finding the target sum |
|dynamic-programming|combinatorics|subset-sum| |
This *is* an instance of the subset sum problem. The set is the range of naturals up to $N$ from which you remove the excluded numbers. |
I've been looking for an algorithm which divides an undirected graph into 2 subgraphs.
However, unlike most existing work on graph partitioning out there (like METIS), I don't intend to obtain subgraphs that contain the same approximate number of vertices. Instead, I would like these 2 subgraphs to have similar cou... |
Graph partitioning in 2 clusters minimizing between cluster edges |
|algorithms|graphs|optimization|partitions| |
Since each pattern brush potentially overwrites previous pixels, I would suggest you work your way backwards. Basically You start checking for which patterns intersected with the "considered pixels" all pixels have the same color. For each of the patterns call the solver recursively with an image where the pattern pixe... |
I have this tiny C program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak, but now the link is broken): [https://github.com/LessnessRandomness/PE/blob/main/EulerProject3.c][1]
But the ```while``` loop in the function ```find``` is harder than ones I have seen befo... |
Any hints about proof invariant of "while" loop? |
|loop-invariants| |
I have this tiny C program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak, but now the link is broken): [https://github.com/LessnessRandomness/PE/blob/main/EulerProject3.c][1]
But the ```for``` loop in the function ```find``` is harder than ones I have seen before... |
In the following video on computer organization:
https://youtu.be/DoR505t8-7I?t=114
the instructor displays the following:
[![enter image description here][1]][1]
and says that the hex string `0xFFFFFF00` is equivalent to -256. After doing a calculation to see this represented in two's complement, this ma... |
How do you bit-shift in RISC-V? |
|memory-management|numeral-representations| |
Any hints about proof invariant of weird "for" loop? |
Any hints about loop invariant of weird "for" loop? |
I'm just now realizing that I neglected to notice the 3 in the second line of code, indicating that the bits are shifted three times. I guess in RISC-V we shift in some way so that you can think about the usual representation rather than little-endian, and therefore the bit shift looks like this
```
1111|...|1000|... |
I have this tiny C program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak, but now the link is broken):
```
// https://codereview.stackexchange.com/a/74792 by Alnitak
#include <stddef.h>
#include <stdint.h>
uint64_t highest;
// checks if `f` is a factor o... |
I have this tiny C program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak, but now the link is broken):
```
// https://codereview.stackexchange.com/a/74792 by Alnitak
#include <stddef.h>
#include <stdint.h>
uint64_t highest;
// checks if `f` is a factor o... |
I have this tiny program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak, but now the link is broken: https://codereview.stackexchange.com/a/74792):
Here is my try to write it in pseudocode:
```
GLOBAL VARIABLE highest;
factorize(n, f) {
if (n < f)
... |
I have this tiny program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak: https://codereview.stackexchange.com/a/74792):
Here is my try to write it in pseudocode:
```
GLOBAL VARIABLE highest;
factorize(n, f) {
if (n < f)
return n
while (n mod ... |
I tested my [XSAT solver](https://cs.stackexchange.com/questions/148462/conflict-clusters-another-p-np-proof) using the 4 pigeons in 3 holes problem converted to XSAT. The pigeon hole instance I give below had 108 variables and 88 clauses after being converted to monotone XSAT. My solver quickly proved the instance was... |
Reference request for Unit Clause Based SAT Reduction Rules |
|reference-request|satisfiability|3-sat|sat-solvers| |
I'll just consider $\text{MOD}^1_{0,3}$, the other ones are similar. I'm assuming that you want a boolean formula $\phi$ such that $\text{MOD}^1_{0,3}(x_1, \dots, x_n) = 1 \iff \phi(x_1, \dots, x_n) \text{ is true}$.
Note that $\text{MOD}^1_{0,3}(x)$ is true if and only if the number of variables set to $1$ is a mul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.