Compute Structure Tensor

As i know, Structure Tensor is:

enter image description here

How i compute $ I_x^2, I_y^2, I_xI_y$ . I used Hadamard product for compute $ I_x^2, I_y^2, I_xI_y$ . But if i use Hadamard product i will get $ det(M) = 0$ . I’m stuck in here for too long. Can anyone explain for me?. Thank you.

Compute the sum given a recursion for each summand

I have a system of two recursive equations with two unknowns A[n] and B[n] which apparently Mathematica can’t solve

RSolve not evaluating when given my system of recurrence equations

Each $ A[n]$ is a polynomial divided by a Pochhammer symbol: $ A[n] = p(q)/(q)_n = p(q)/\prod_{j=1}^n (1-q^j)$ where $ p(q) = \mathbb{Z}[q]$ .

I am only interested in computing the formal sum $ \sum_{n \geq 0} A[n]$ as a power series in $ q$ . Is this something Mathematica can do? I know how to get the corresponding polynomial to each order of $ n$ but I am interested in a closed formula for the formal sum.

For completeness I am copying the system of equations with initial conditions here:

(1-q^n)A[n] = q^{3n-1} B[n-1] + q^{2n+1} A[n-1] + q^{4n-2} (A[n-2]+B[n-2]) B[n] = q^{n+1} A[n-1] - q^{5n -5}(A[n-3]+B[n-3]) A[0] = 1, A[1]=q^3/(1-q), A[2] = q^6/(q)_2 B[0] = 0, B[1] = q^2, B[2] = q^6/(1-q) 

Algorithm to compute decomposition of a union of sets to a disjoint union of intersections

A disjoint union of sets can be decomposed into a disjoint union of intersections. Rather than writing confusing notation, this is easiest to to see in an example of three sets. enter image description here

This clearly generalizes. If we want to calculate the disjoint pieces, we have to compute $ 2^n$ intersections, where $ n$ is the number of sets.

However, if our sets were nested, i.e. $ A_1 \subseteq A_2 \subseteq … A_n$ , we need only to compute $ n$ intersections of the form $ A_i \cap A_{i+1}^c$ . The point is if we did our original exhaustive “binary search” computing $ 2^n$ intersections we would find that most of these intersections are empty, so we are wasting computations.

My question is, what if we had $ n$ sets where the vast majority are nested, but a few aren’t and we don’t know which. Can we compute an $ O(n)$ number of intersections to find the disjoint pieces?

Compute Intersection Of Line With Star Shaped Set

Let there be $ k$ planes $ X_i\subseteq\mathbf{R}^3$ , all tangent to the unit sphere, in general position, represented by normal vectors $ v_i$ . Then $ \mathbf{R}^3\setminus\cup_i X_i$ consists of bounded and unbounded segments, let $ S$ denote the closure of the union of all bounded segments and assume that $ \mathbf{0}\in S$ . This should give a star shape w.r.t. $ \mathbf{0}$ , i.e. for all $ s\in S$ , the ‘interval’ $ [\mathbf{0},s]$ lies within $ S$ . Given a unit vector $ w\in R^n$ , in general position to the others, I can compute all scalars $ \lambda_i$ such that $ \lambda_iw$ lies on $ X_i$ . What is the most efficient method to verify which (necessarily unique) positive $ \lambda_i$ lies on the boundary of $ S$ , if I want to apply it to a lot of $ w$ s but the planes stay fixed?

The easiest way I currently see is to compute all intersection points of three planes each, then for every plane $ X_i$ , arrange a list of all triangles on that plane, that means, the three intersection points of $ X_i$ with two out of three other planes. Now, given $ w$ , I first get the largest $ \lambda_i$ , check whether it lies in some of the triangles on $ X_i$ , if not, continue with the second largest $ \lambda_i$ , etc.

Can quantum computers really compute a vast number of possible solutions simultaneously?

This link says

They are not constrained to stepwise calculations but, rather, can compute a vast number of possible solutions simultaneously—and at a speed that is far beyond anything we can imagine.

Is this really true? AFAIU quantum computers cannot compute a vast number of possible solutions simultaneously. A quantum computer is not a parallel computer. It is true that the wave function will exist in a superposition of states before measurement, but when we make a measurement it will collapse to a definite state. And measurements is all we can do.

From scott aaronson’s blog (https://www.scottaaronson.com/blog/)

If you take just one piece of information from this blog: Quantum computers would not solve hard search problems instantaneously by simply trying all the possible solutions at once.

curious to know what experts think

How to compute the difference between position vectors in c++ [closed]

I am an 2nd year engineering student with very little experience with anything to do with coding. I am working on a design project where we are building an X-Y Plotter to generate “random” motion in a rainfall simulator that is being used in a lab.

I have been able to write a program in C++ that will generate an x_coordinate and a y_coordinate as you can see below. I was wondering if anyone had suggestions on how I could store the position it is currently at [x1,y1] and find the distance to the second position [x2, y2] from that last position.

I am hoping my final result will be a program which:
Step 1: Generates a position.
Step 2: Moves to that position.
Step 3: Generates a new position.
Step 4: Calculates the distance to the new position.
Step 5: Repeat steps 2-4

Any advice or direction on what to research would save me lots of time. Thanks!

#include <iostream> #include <stdlib.h>     /* srand, rand */ #include <stdio.h>      /* printf, NULL */ #include <random>  float x_position; float y_position; float x_coordinate; float y_coordinate; int x_MAX; int y_MAX; int i = 0; int positionCount = 100; using namespace std;   int main() {   //Create Limits      cout << "Enter Max Value for X:";         cin >> x_MAX;     cout << "Enter Max Value for Y:";     cin >> y_MAX;      srand(1);     //Generate Coordinates     while (i < positionCount) {          x_coordinate = rand() % x_MAX;         y_coordinate = rand() % y_MAX;          cout << "New Position Coordinate is: [" << x_coordinate << "," << y_coordinate << "]" <<endl;           i++;   }     return 0; } ``` 

Postgres: handy way/function to compute bearing change from coordinates

I am going to compute point-based acceleration and bearing relative to true/magnetic north from the sequence of GPS points with timestamp and instantaneous speed.

Here’s how the dataset looks like:

postgres=> SELECT * FROM location_track LIMIT 10; user_id  | timestamp  |                        geo                         |    lat     |    lon     | speed ---------+------------+----------------------------------------------------+------------+------------+-------       49 | 1458203631 | 0101000020E6100000F74BD5873F9C21C07530AC2C1BDF4340 | 39.7430168 | -8.8051722 |     9       49 | 1458203632 | 0101000020E6100000F74BD5873F9C21C07530AC2C1BDF4340 | 39.7430168 | -8.8051722 |     9       49 | 1458203633 | 0101000020E610000005888219539C21C0F8CC48731ADF4340 | 39.7429947 | -8.8053215 |     9       49 | 1458203634 | 0101000020E610000005888219539C21C0F8CC48731ADF4340 | 39.7429947 | -8.8053215 |     9       49 | 1458203635 | 0101000020E610000007D7378B729C21C05452CCE616DF4340 | 39.7428864 | -8.8055614 |  7.75       49 | 1458203636 | 0101000020E610000007D7378B729C21C05452CCE616DF4340 | 39.7428864 | -8.8055614 |  7.75       49 | 1458203637 | 0101000020E610000027B220DE849C21C04E4DDDF016DF4340 | 39.7428876 | -8.8057012 |     8       49 | 1458203638 | 0101000020E610000027B220DE849C21C04E4DDDF016DF4340 | 39.7428876 | -8.8057012 |     8       49 | 1458203639 | 0101000020E610000028EFE3688E9C21C03505D78118DF4340 | 39.7429354 |  -8.805774 |  8.25       49 | 1458203640 | 0101000020E610000028EFE3688E9C21C03505D78118DF4340 | 39.7429354 |  -8.805774 |  8.25 (10 rows)  postgres=> \d location_track Table "postgres.location_track"    Column   |       Type       |           Modifiers ------------+------------------+--------------------------------  user_id    | integer          | not null  timestamp  | integer          |  geo        | geography        |  lat        | double precision | not null  lon        | double precision | not null  speed      | real             | 

Then I want to modify the location_track table by adding acceleration and bearing columns. I know acceleration could be derived from speed / timestamp AS acceleration, but I am wondering if there’s a handy way or function in Postgres to derive the bearing.

The GPS is received at an interval of 1 second, so the bearing of the point in row 1 would be computed in relation to the point in row 2 (i.e the next consecutive point) that way, until the last point. Additionally, lat and lon are in degrees, so should be converted to radians.

Any handy way of doing this in postgres?

Why assume Turing machine can compute arbitrary results in Kraft-Chaitin theorem?

The Kraft-Chaitin theorem (aka KC theorem in Downey & Hirschfeldt, Machine Existence Theorem in Nies, or I2 in Chaitin’s 1987 book) says, in part, that given a possibly infinite list of strings $ s_i$ , each paired with a desired program length $ n_i$ , there is a prefix-free Turing machine s.t. there is a program $ p_i$ of length $ n_i$ for producing each $ s_i$ , as long as $ \sum_i 2^{-n_i} \leq 1$ . The list of $ \langle s_i, n_i \rangle$ pairs is required to be computable (D&H, Chaitin) or computably enumerable (Nies).

The proofs in the above textbooks work, it seems, by showing how to choose program strings of the desired lengths while preserving prefix-free-dom. The details differ, but that construction is the main part of the proof in each case. The proofs don’t try to explain how to write a machine that can compute $ s_i$ from $ p_i$ (of course).

What I’m puzzled about is why we can assume that an infinite list of results can be computed from an infinite list of arbitrarily chosen program strings using a Turing machine that by definition has a finite number of internal states. Of course many infinite sequences of results require only finite internal states; consider a machine that simply adds 1 to any input. But in this case we’re given a countably infinite list of arbitrary results and we match them to arbitrary (except for length and not sharing prefixes) inputs, and it’s assumed that there’s no need to argue that a Turing machine can always be constructed to perform each of those calculations.

(My guess is that the fact that the list of pairs is computable or c.e. has something to do with this, but I am not seeing how that implies an answer to my question.)