We want to show that any divisor
-
(given) -
(restatement of step (1)) -
(step (2), is even) -
is pseudo-prime in base (definition)
Thus,
import Mathlib.Tactic.Ring -- import the `ring` tactic | |
import Mathlib.Algebra.Algebra.ZMod | |
import Mathlib.Data.Nat.Init | |
import Mathlib.Data.Int.Notation | |
import Mathlib.Init | |
import Mathlib.Data.Nat.ModEq | |
import Mathlib.Data.ZMod.Basic | |
import Mathlib.Data.Nat.Notation | |
namespace Nat |
We want to show that any divisor
Thus,
# model two bodies orbiting each other with a bunch of near zero mass particles around them | |
# the first time you run this, Julia will ask you if you want to install them (say yes) and | |
# then spend a fair bit of time compiling them. That won't happen on subsequent loads. | |
""" | |
To load and run this code, start Julia and then "include" this file: | |
``` | |
julia> include("orbits.jl") | |
┌ Info: start | |
│ size(u0) = (408,) |
function normalize_rows(x) | |
n = sqrt.(sum(x .* x, dims=1)) | |
x ./ (n + (n .== 0)) | |
end | |
""" | |
Project and plot high-dimensional data. | |
Data is n x d where each row is a point. The projection p is n x 2. | |
""" |
While building a filter for a WSPR beacon, I noticed that the primary inductor in the circuit behaved as if it had more inductance than expected.
To learn more about what was happening, I built a test jig made up of a single 180pf SMD capacitor with two SMA connectors and used a vector network analyzer (VNA) to measure the resonant frequency of test coils to determine their effective inductance. This gave me enough data to derive an empirical formula
The idea of content-based recommendation is that instead of looking purely at a history of | |
how users interact with items where both users and items are considered as things we know | |
nothing about (other than their interactions), we can consider the features of the items. | |
By content here, we might consider actual textual descriptions, but we might also consider | |
more structured information about the objects like their color or whether they are shoes, | |
books or music. | |
If we look at the content associated with items, we can restate the user x item history as | |
a user x content-feature history. That is to say that we can look at what content features | |
our users interacted with as opposed to which items. Essentially, we are recommending features |
Pragma version; | |
CREATE TABLE distributors ( | |
did integer CHECK (did > 100), | |
name varchar(40) | |
); | |
insert into distributors values (200, 'a'); | |
insert into distributors values (201, 'b'); | |
select min(columns('d.*')) from distributors; |
x1 | x2 | x3 | |
---|---|---|---|
0.7231422916301575 | 0.819657781416707 | 0.6567508886461839 | |
0.4020425739176958 | 0.1549076251851813 | 0.4282647678658029 | |
0.4629109586444531 | 0.9094363294197141 | 0.1236688659876839 | |
0.747467460858015 | 0.2428975528400832 | 0.6360313817514556 |
julia> A = 3 # this is \Alpha | |
3 | |
julia> Α = 4 # this is A | |
4 | |
julia> Α == A # they aren't the same | |
false | |
julia> x′ = rand(2,2) # this is x\prime |
library (dplyr) | |
data = read.csv('median-error.csv') | |
png("max-error-uniform.png", width=1200, height=1000, pointsize=25) | |
i = -3.8 | |
boxplot(abs(error) ~ delta, (data %>% filter(n0==20)), ylim=c(0, 0.05), xlim=c(0.6,4.4), boxwex=0.1, at=(1:4)+i/11, xaxt='n', xlab=expression(delta), cex.lab=1.4) | |
axis(side=1, at=1:4, labels=c(50,100,200,500)) | |
for (nx in c(20, 50, 100, 1000, 10000, 100000)) { |