Compare commits
54 Commits
74bae7ec01
...
main
Author | SHA1 | Date | |
---|---|---|---|
145a871d1d | |||
b018456d64 | |||
6a8712dc7c | |||
892f40f37e | |||
83ceb7a5d0 | |||
3395a32204 | |||
4f1ea82d06 | |||
2857e5ea84 | |||
142ab93d04 | |||
90c9111a08 | |||
053eea8b11 | |||
9efb23dc3d | |||
e5d60bfb94 | |||
cbe5d6cde7 | |||
c80bacb2fc | |||
bff7640d0a | |||
27b25ff6dd | |||
1052e71a6d | |||
0a0d3c833e | |||
1fb125825d | |||
00010e0ec8 | |||
5941f9907f | |||
c59d6f536d | |||
f763dac3b2 | |||
40a8bdfbe4 | |||
a75a02e406 | |||
316d29ad4f | |||
cfbfc6aeee | |||
a1caa119cc | |||
824806137c | |||
892f17fdff | |||
3693a5d628 | |||
c33fcf8639 | |||
29ab0c850c | |||
6548157af2 | |||
81dfab2213 | |||
1e752aa5a5 | |||
4524d8d85d | |||
3a2c94fc29 | |||
d241cd84a2 | |||
21b1eb4641 | |||
f2a5d9fde3 | |||
1e9eb77e4b | |||
d426182082 | |||
0cc087eded | |||
7dbff08408 | |||
9ccd3322e8 | |||
19255083a7 | |||
0213e7e5bd | |||
a29a161a9e | |||
584cebafdb | |||
66cd4f22ea | |||
35cd8c438a | |||
4d56d80666 |
2
.obsidian/app.json
vendored
2
.obsidian/app.json
vendored
@ -2,7 +2,7 @@
|
|||||||
"vimMode": true,
|
"vimMode": true,
|
||||||
"promptDelete": false,
|
"promptDelete": false,
|
||||||
"pdfExportSettings": {
|
"pdfExportSettings": {
|
||||||
"includeName": true,
|
"includeName": false,
|
||||||
"pageSize": "Letter",
|
"pageSize": "Letter",
|
||||||
"landscape": false,
|
"landscape": false,
|
||||||
"margin": "0",
|
"margin": "0",
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"prevConfig": {
|
"prevConfig": {
|
||||||
"pageSize": "A4",
|
"pageSize": "A4",
|
||||||
"marginType": "1",
|
"marginType": "1",
|
||||||
"showTitle": true,
|
"showTitle": false,
|
||||||
"open": true,
|
"open": true,
|
||||||
"scale": 100,
|
"scale": 100,
|
||||||
"landscape": false,
|
"landscape": false,
|
||||||
|
2
.obsidian/plugins/obsidian-git/data.json
vendored
2
.obsidian/plugins/obsidian-git/data.json
vendored
@ -5,7 +5,7 @@
|
|||||||
"autoSaveInterval": 5,
|
"autoSaveInterval": 5,
|
||||||
"autoPushInterval": 0,
|
"autoPushInterval": 0,
|
||||||
"autoPullInterval": 5,
|
"autoPullInterval": 5,
|
||||||
"autoPullOnBoot": true,
|
"autoPullOnBoot": false,
|
||||||
"disablePush": false,
|
"disablePush": false,
|
||||||
"pullBeforePush": true,
|
"pullBeforePush": true,
|
||||||
"disablePopups": false,
|
"disablePopups": false,
|
||||||
|
3
education/calculus/precalculus/Composing Functions.md
Normal file
3
education/calculus/precalculus/Composing Functions.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- To compose a function is to create a new function from multiple smaller functions.
|
||||||
|
- They can be solved from the inside out
|
||||||
|
-
|
279
notes/3D printing/Filament.md
Normal file
279
notes/3D printing/Filament.md
Normal file
@ -0,0 +1,279 @@
|
|||||||
|
https://www.youtube.com/watch?v=weeG9yOp3i4
|
||||||
|
|
||||||
|
# PLA (Polylactic acid)
|
||||||
|
| Pros | Cons |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| - Easy to print<br>- Very cheap<br>- Widely available<br>- Prints quickly<br>- Prints well<br>- Stiffest non-composite thermoplastic | - Can permanently deform with consistent load application<br>- Not UV resistant<br>- Warps under heat<br>- Shatters<br>- Difficult to sand/glue/paint |
|
||||||
|
## Variants
|
||||||
|
### Silk PLA
|
||||||
|
Silk PLA has an additive to make prints shinier. This weakens the print, but it makes supports easier to remove. When silk PLA heats up, it puffs up and this can damage the extruder.
|
||||||
|
|
||||||
|
Silk PLA trades performance for aesthetics and can damage both a Bambu AMS and a Prusa MMU.
|
||||||
|
|
||||||
|
### PLA-CF (Carbon Fiber PLA)
|
||||||
|
Carbon fiber PLA is made by adding chopped or ground PLA to the filament. It does not typically improve the strength of prints, but it stabilizes the filament as it cools (preventing warping and shrinkage), and it can improve detail.
|
||||||
|
|
||||||
|
The addition of carbon fiber makes the end product stiffer, but more brittle. PLA-CF is one of the best filaments for detail oriented printing. It's overall a better filament than PLA, with the only drawbacks being a hardened steel nozzle requirement, and lack of color options.
|
||||||
|
|
||||||
|
### Metal-filled PLA
|
||||||
|
Metal filled PLA is made by adding metal shavings to the filament during production. This makes the print heavier and infuses the print with some of the properties of the metal added. Copper infused filament can gain a patina, stainless steel infused filament can be polished, iron is magnetic, et cetera et cetera.
|
||||||
|
|
||||||
|
The addition of metal particulate reduces the strength of the print and makes it more brittle. Metal-filled PLA is extremely expensive, difficult to print with, and anything that can be achieved with metal-filled PLA can also be achieved using paint, inserts, or some form of electroplating.
|
||||||
|
|
||||||
|
### Wood-filled PLA
|
||||||
|
Wood-filled PLA is comprised of sawdust, and PLA. Cheap wood-filled PLA looks brown and has no particular wood-like qualities, but higher quality WF-PLA has visible chips of wood. This impacts the print by giving it a wood-like texture and allowing you to use varnish on the print.
|
||||||
|
|
||||||
|
WF-PLA is difficult to print with, it easily absorbs humidity and sputters from the nozzle. The resulting product is also weaker.
|
||||||
|
|
||||||
|
### PLA Alloys
|
||||||
|
This category of PLA is created by combining PLA with another plastic additive to change the properties of the resulting filament in some way.
|
||||||
|
|
||||||
|
There are 3 primary categories of PLA alloys:
|
||||||
|
1. "Tough" PLA
|
||||||
|
Tough PLA is created by combining PLA with polybutylene terephthalate, or PBT. PBT is commonly used in keycaps for keyboards.
|
||||||
|
|
||||||
|
Tough PLA prints and acts similarly to PLA, but it has higher temp and impact resistance, and it's less brittle. This is largely an upgrade to PLA with no real drawbacks.
|
||||||
|
|
||||||
|
2. "Matte" PLA
|
||||||
|
Matte PLA is created by combining PLA with a plant based additive.
|
||||||
|
|
||||||
|
Matte PLA has a higher impact and shatter resistance than regular PLA, but it absorbs humidity more easily and is more likely to jam in an extruder during printing. This is largely a side-grade to regular PLA, it makes a slightly different set of tradeoffs.
|
||||||
|
3. "High speed" PLA
|
||||||
|
High speed PLA has a lower melting temperature and a reduced viscosity, greatly increasing the speed at which it can be printed at.
|
||||||
|
|
||||||
|
# PCL (Polycaprolactone)
|
||||||
|
PCL has an extremely low melting point, printing at just 100 Celsius. The melting point is so low that you can shape it in a warm bath, or with a hair dryer.
|
||||||
|
|
||||||
|
It has a warm waxy consistency that no adhesive will stick to.
|
||||||
|
|
||||||
|
# PETG/PET-G (Polyethylene terephthalate-glycol)
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| - Tougher<br>- Better temperature resistance<br>- Highly transparent<br>- Very low coefficient of friction.<br>- Food safe | - Slightly more difficult to print than PLA<br>- Struggles with overhangs<br>- Struggles with support removal<br>- High humidity absorption |
|
||||||
|
## Variants
|
||||||
|
### PETG-CF (Carbon Fiber PETG)
|
||||||
|
Carbon fiber stabilizes molten filament, and given that PETG struggles with overhangs, PETG-CF has massively improved print support quality, along with improved stiffness.
|
||||||
|
|
||||||
|
The combination of matte carbon fiber with shiny polyester tends to create a very unique, aesthetically pleasing finish.
|
||||||
|
|
||||||
|
# PCTG (Polycyclohexylenedimethylene Pthalate-Glycol)
|
||||||
|
PCTG is a newer, better, alternative to PETG, compared to PETG:
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
||||||
|
| - Higher toughness<br>- Lower water retension<br>- Very little warping or sagging<br>- Almost perfect layer adhesion | - Supports are difficult to remove<br>- Expensive<br>- Not widely available |
|
||||||
|
# PET (Polyethylene Terephthalate)
|
||||||
|
PET is the foundation of PET-G, but without the addition of glycol as a plasticizer. Compared to PETG:
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||||
|
| - Stiffer<br>- Tougher<br>- Shinier<br>- Very high temp resistance<br>- Easier to print than other engineering filaments like nylon or polycarbonate | - Extremely high print temp (275C minimum)<br>- Struggles with humidity, overhangs, and warping |
|
||||||
|
## Variants
|
||||||
|
### PET-CF (Carbon Fiber PET)
|
||||||
|
- Almost as easy to print as PETG
|
||||||
|
- Extremely stiff
|
||||||
|
- Hard to find, expensive
|
||||||
|
|
||||||
|
# PVB (Polyvinyl Butyrate)
|
||||||
|
- Printing qualities similar to PLA
|
||||||
|
- Behaves similar to PETG, weaker but more flexible
|
||||||
|
- When exposed to isopropanol alcohol, the layers melt and fuse together, resulting in a very glossy, seamless finish.
|
||||||
|
|
||||||
|
# ABS (Acrylonitrile Butadiene Styrene)
|
||||||
|
- Very common in consumer injection-molded parts.
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||||
|
| - Melts in acetone, acetone vapor smoothing can be used to improve surface finish<br>- Prints fairly quickly<br>- Very high toughness relative to PLA or PETG<br>- High temperature resistance<br>- UV resistant | - Very high warpage<br>- Smells horrid and outputs toxic fumes when printing |
|
||||||
|
# ASA (Acrylonitrile Styrene Acrylate)
|
||||||
|
Chemically similar to ABS, just better.
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
||||||
|
| - Very high temp resistance (past 100C)<br>- Very high UV resistance<br>- Matte surface finish<br>- Prints *very quickly*<br>- Greatly reduced warping compared to ABS | - Equally bad fumes as ABS<br>- Still somewhat difficult to print. |
|
||||||
|
# HIPS (High Impact Polystyrene)
|
||||||
|
Similar to ABS, but softer, waxier, and more flexible.
|
||||||
|
|
||||||
|
Has a very low density, works well for wearables and props. HIPS is commonly used as a support material for ASA or ABS because limonene will dissolve HIPS but does not impact other plastics in the styrene family (ABS, ASA).
|
||||||
|
|
||||||
|
# Nylon
|
||||||
|
Nylon filaments are engineering filaments. They're difficult to print but have excellent mechanical properties.
|
||||||
|
|
||||||
|
## Variants
|
||||||
|
### PA-6
|
||||||
|
| Pros | Cons |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| - Extremely strong<br>- Excellent layer bonds<br>- High flexibility<br>- Very high temp resistance<br>- Very low coefficient of friction | - Horrible to print<br>- Very high moisture retention<br>- Can't be too dry<br>- Very high warpage<br>- Requires a closed (ideally heated) chamber |
|
||||||
|
### PA-12
|
||||||
|
- Higher warpage than PA-6
|
||||||
|
- Higher toughness
|
||||||
|
- Higher temp resistance
|
||||||
|
- Durable but brittle
|
||||||
|
### PA-CF (Carbon Fiber Nylon)
|
||||||
|
- Very stiff
|
||||||
|
- Less warping
|
||||||
|
- High friction
|
||||||
|
- High end printer required
|
||||||
|
|
||||||
|
### PA-GF (Glass Filled Nylon)
|
||||||
|
- Used in the real world (handguns, chainsaws)
|
||||||
|
- More affordable than PA-CF
|
||||||
|
- Much stiffer, tougher, and more resistant to heat and abrasion than vanilla nylon.
|
||||||
|
- Greatly reduced warping
|
||||||
|
- Fairly easy to print
|
||||||
|
- Still requires a high-end printer (tungsten carbide or gemstone nozzle, abrasion resistant drive gears)
|
||||||
|
- Durable enough to act as a viable alternative to machined aluminum
|
||||||
|
|
||||||
|
### PA-PETG (Nylon PET alloy)
|
||||||
|
Often called tough PETG or low temp nylon, PA-PETG is meant to serve as both a step up from PETG and a more accessible nylon alternative.
|
||||||
|
- Bad warping, poor bed adhesion
|
||||||
|
- Often just better to use nylon *or* PETG
|
||||||
|
|
||||||
|
# Polycarbonate (PC)
|
||||||
|
- In the real world, polycarbonate is used to make bulletproof glass. While FDM polycarbonate is not bulletproof, many of the properties of polycarbonate still apply.
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||||
|
| - One of the toughest, stiffest filaments<br>- Extremely high temp resistance<br>- Does not shatter<br>- Highly transparent | - Extremely high moisture retention<br>- Prints above 300C<br>- Difficult to print |
|
||||||
|
## Variants
|
||||||
|
### PC-CF (Carbon Fiber Polycarbonate)
|
||||||
|
- Record setting stiffness, prints can withstand hundreds of kilos
|
||||||
|
- Will destroy most drive motors
|
||||||
|
- Surprisingly cheap (~60USD/kilo at the time of writing)
|
||||||
|
|
||||||
|
### PC-PBT (PBT Infused Polycarbonate)
|
||||||
|
PBT flaccifies the polycarbonate but preserves PC's strength and shatter resistance in the cold, making it one of the few cold-resistant filaments.
|
||||||
|
- Lower print temp
|
||||||
|
- Improved print quality
|
||||||
|
- Very low warping
|
||||||
|
- One of the easiest filaments to print in
|
||||||
|
|
||||||
|
### PMMA (Polymethylmethacrylate)
|
||||||
|
Also known as acrylic plexiglass, the high transparency of PMMA is the only advantage it has over other polycarbonates for printing.
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| - Highest transparency thermoplastic<br>- Can be buffed to a frosted/polished surface<br>- High UV resistance<br>- Relatively affordable<br> | - Horrible bed adhesion<br>- Bad layer adhesion<br>- High coefficient of thermal expansion leads to constant print failures during or after the printing process<br>- Very brittle<br>- High water absorption |
|
||||||
|
# TPU (Thermoplastic Polyurethane)
|
||||||
|
TPU is the most common flexible filament
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| - Flexibility<br>- Cheap<br>- Wide range of colors and hardnesses<br>- Perfect layer adhesion<br>- Basically shatterproof | - Permanently bonds to most build plates (use gluestick)<br>- Very high water absorption, needs to be dry to print well |
|
||||||
|
## Variants
|
||||||
|
### TPU (~99D)
|
||||||
|
- Harder than a skateboard wheel
|
||||||
|
- Basically rigid
|
||||||
|
- Useful because it's "shatterproof"
|
||||||
|
- Often used for combat gear or robotic applications
|
||||||
|
- Easiest TPU variant to print
|
||||||
|
|
||||||
|
### TPU (~80D)
|
||||||
|
- About as hard as the sole of a running shoe
|
||||||
|
- Good for things like bumpers or hinges
|
||||||
|
- Still fairly easy to print
|
||||||
|
### TPU (~80A)
|
||||||
|
- Very soft
|
||||||
|
- Prints at very low speed, can wrap itself around the drive gears
|
||||||
|
|
||||||
|
# TPE (Thermoplastic Elastomer)
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| ------------------------ | ---------------------------------- |
|
||||||
|
| - Flexible<br>- Stretchy | - **Very** difficult to print with |
|
||||||
|
# SEBS (Styrene Ethylene Butterine Styrene)
|
||||||
|
TPE enhanced with the same chemicals used to make ABS.
|
||||||
|
|
||||||
|
| Pros | Cons |
|
||||||
|
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| - Prints much better than TPE<br>- Very flexible and tough | - Very hygroscopic<br>- Styrene fumes released during printing<br>- Softens at a very low temp<br>- Still requires some level of tuning |
|
||||||
|
# PP (Polypropylene)
|
||||||
|
- Very bendable
|
||||||
|
- Very rugged
|
||||||
|
- Perfect layer adhesion
|
||||||
|
- Very low density
|
||||||
|
- Horrible bed adhesion
|
||||||
|
- High warping
|
||||||
|
- Supports are impossible to remove
|
||||||
|
## Variants
|
||||||
|
### PP-GF (Glass-filled PP)
|
||||||
|
- Standard for industrial machinery
|
||||||
|
- More difficult to print than regular PP
|
||||||
|
- One of the toughest, most durable filaments
|
||||||
|
- Very lightweight
|
||||||
|
# OBC (Olefin Block Copolymer)
|
||||||
|
- Fairly new for 3D printing
|
||||||
|
- Attempts to combine the good qualities of PP and PET-G
|
||||||
|
- Very low bed adhesion
|
||||||
|
- Very expensive
|
||||||
|
- Typically requires printing on a purpose made printer
|
||||||
|
|
||||||
|
# HDPE (High Density Polyethylene)
|
||||||
|
- Most bottles and jugs use this filament
|
||||||
|
- Horrible to print in every way
|
||||||
|
- Useful for purging the nozzle when switching between high and low temp filaments
|
||||||
|
|
||||||
|
# POM (Polyoxylmethylene)
|
||||||
|
POM is most commonly used when CNCing plastic.
|
||||||
|
- It's cheap and very easy to print, with a low coefficient of friction.
|
||||||
|
- Zero bed adhesion
|
||||||
|
- Very poor layer adhesion
|
||||||
|
- When it overheats, it turns into formaldehyde
|
||||||
|
|
||||||
|
# PVDF (Polyvinylidene Flouride)
|
||||||
|
- A chemical cousin of teflon
|
||||||
|
- As easy to print as PET-G
|
||||||
|
- Extremely tough
|
||||||
|
- High heat/friction resistance
|
||||||
|
- Hydrophobic
|
||||||
|
- Most important because of its chemical resistance.
|
||||||
|
- Fairly expensive
|
||||||
|
- When mildly overheated, turns into horribly toxic chemicals (carbon monoxide, hydrogen cyanide, hydrofluoric acid, even more)
|
||||||
|
|
||||||
|
# PEEK (Poly-ether Ether Ketone)
|
||||||
|
- Mechanical properties massively beyond other plastics
|
||||||
|
- Close to steel
|
||||||
|
- Twice as tough as the toughest polycarbonate
|
||||||
|
- Used in missiles and is fireproof
|
||||||
|
- $700 a kilo (at the time of writing)
|
||||||
|
- Prints at 400C
|
||||||
|
- Requires a 140C heated chamber
|
||||||
|
- Extremely high water retention
|
||||||
|
- Special bed adhesive required
|
||||||
|
- Difficult to print
|
||||||
|
|
||||||
|
# PEKK (Polyether Ketone Ketone)
|
||||||
|
Same building blocks as PEEK, in different levels
|
||||||
|
- Worse than PEEK mechanically, still far beyond other filaments
|
||||||
|
- Much easier to print compared to PEEK
|
||||||
|
|
||||||
|
# PPS (Polyphenylene Sulphide)
|
||||||
|
- Most chemically resilient filament
|
||||||
|
- $200/kilo
|
||||||
|
|
||||||
|
# PSU (Polysulphone)
|
||||||
|
- Weakest superpolymer
|
||||||
|
- Mechanical properties similar to PA6 nylon
|
||||||
|
- Very high glass transition temperature (187C)
|
||||||
|
|
||||||
|
# Additive Superpolymers
|
||||||
|
As a general rule, these (CF-PEEK, et cetera), are all extremely difficult to print and put a ton of strain on the printer. They *do* warp less than the vanilla counterparts.
|
||||||
|
|
||||||
|
# PEI (Polyetherimide)
|
||||||
|
- Used to coat print beds
|
||||||
|
- Sold in two grades, 1010 and 9085 (9085 is horrible and shouldn't be used)
|
||||||
|
- $400/kilo
|
||||||
|
- Second strongest filament after PEEK
|
||||||
|
- Glass transition temp at 217C
|
||||||
|
- Electrically/chemically/radiation resistant
|
||||||
|
- Prints at 425C nozzle/160C bed
|
||||||
|
- Needs a special bed
|
||||||
|
- Relatively friendly to print once equipment requirements are met
|
||||||
|
|
||||||
|
# TPI (Thermoplastic Polyamide)
|
||||||
|
- Kapton tape, in a filament
|
||||||
|
- Glass transition temp above 250C
|
||||||
|
- Most heat-proof filament
|
||||||
|
- Mechanical properties about 25% worse than PEEK
|
||||||
|
- Printing is basically impossible
|
@ -1,8 +1,8 @@
|
|||||||
<https://arxiv.org/abs/1311.2540>
|
<https://arxiv.org/abs/1311.2540>
|
||||||
|
|
||||||
In standard numeral systems, different digits are treated as containing the same amount of information. A 7 stores the same amount of info as a 9, which stores the same amount of info as a 1.
|
In standard numeral systems, different digits are treated as containing the same amount of information. A 7 is stored using the same amount of info as a 9, which is stored using the same amount of info as a 1, that is, 1 digit.
|
||||||
|
|
||||||
This makes the amount of information a single digit stores *uniform* across all digits. However, that's far from the most efficient way to represent most datasets.
|
This makes the amount of information a single digit stores *uniform* across all digits. However, that's far from the most efficient way to represent most datasets, because real world data rarely follows a uniform distribution.
|
||||||
|
|
||||||
ANS theory is based around the idea that digits that occur more often can be stored in a way that requires less information, and digits that occur less often can be stored using more information.
|
ANS theory is based around the idea that digits that occur more often can be stored in a way that requires less information, and digits that occur less often can be stored using more information.
|
||||||
|
|
||||||
@ -12,4 +12,38 @@ Taking a look at the standard binary numeral system, there are two digits in the
|
|||||||
|
|
||||||
Given that $x$ represents a natural number, and $s$ is the digit we're adding. In a standard binary system, adding $s$ to the least significant position means that in the new number $x$ (before the addition) now represents the Nth appearance of an even (when $s = 0$ ), or odd (when $s = 1$). With ANS, the goal is is to make that asymmetrical, so that you can represent more common values with a denser representation.
|
Given that $x$ represents a natural number, and $s$ is the digit we're adding. In a standard binary system, adding $s$ to the least significant position means that in the new number $x$ (before the addition) now represents the Nth appearance of an even (when $s = 0$ ), or odd (when $s = 1$). With ANS, the goal is is to make that asymmetrical, so that you can represent more common values with a denser representation.
|
||||||
|
|
||||||
|
# Arithmetic Coding
|
||||||
|
Arithmetic coding works by taking a stream of data, and converting it into an infinitely precise number between $0.00$, and $1.00$. This is based off of the idea that the sum of the probability of all events happening will always amount to $100\%$.
|
||||||
|
|
||||||
|
For example, the probability of a coin flip resulting in tails is 50%, and the probability of a coin flip resulting in heads is 50%. The probability of a coin flip resulting in heads *or* tails is %100.
|
||||||
|
|
||||||
|
If we wanted to keep track of the result of a series of coin flips, this could be done by subdividing a range. If the coin flip is between $0$ and $0.5$, then we know that the first flip must have been tails.
|
||||||
|
|
||||||
|
If the coin flip is between $0.5$ and $1$, then we know that the first flip must have been heads.
|
||||||
|
|
||||||
|
This subdivision process can be repeated infinitely to store an infinite number of coin flips by dividing each range again.
|
||||||
|
|
||||||
|
To store two coin flips, you might have the first subdivision represent the outcome of the first coin flip, and the second subdivision represent the outcome of the second coin flip:
|
||||||
|
|
||||||
|
| Range | Result |
|
||||||
|
| ------------- | ------------ |
|
||||||
|
| $0.00 - 0.25$ | Tails, Tails |
|
||||||
|
| $0.25 - 0.5$ | Tails, Heads |
|
||||||
|
| $0.50 - 0.75$ | Heads, Tails |
|
||||||
|
| $0.75 - 1.00$ | Heads, Heads |
|
||||||
|
Imagine a situation where we want to store all possible outcomes of three consecutive coin flips using a decimal number, *Heads, Heads, Tails*.
|
||||||
|
Encoding this would happen as follows:
|
||||||
|
1. First we subdivide the range by the probability of each event happening. The probability of each is 50%, so that's simple. Referring above, we know that heads is represented by the top half of the range, and tails is represented by the bottom half of the range.
|
||||||
|
> Because the *first* coin flip resulted in *Heads*, the output value must be between $0.50$ and $1.00$.
|
||||||
|
2. Subdividing the range $0.50$ and $1.00$ again to store the results of the second flip, we end up with values between $0.50$ and $0.75$ representing the sequence *Heads, Tails*, and values between $0.75$ and $1.00$ representing the sequence *Heads, Heads*.
|
||||||
|
> Because the *second* coin flip resulted in *Heads*, we know that the output value must be between $0.75$ and $1.00$
|
||||||
|
3. Subdividing the range $0.75$ and $1.00$ yet again, $0.750$ - $0.875$ means the third coin flip resulted in *Tails*, and a value in the range $0.875$ - $1.000$ means the third coin flip resulted in *Heads*
|
||||||
|
> Because the *third coin flip resulted in *Heads*, any value between $0.875$ and $1.000$ encodes the fact that the first three coin flips went *Heads, Heads, Tails*.
|
||||||
|
|
||||||
|
The decoding process performs the same series of steps, but by asking a question instead of outputting a value.
|
||||||
|
1. Is the value between $0.00$ and $0.50$? If so, the first coin flip resulted in *Tails*. Otherwise if the value is between $0.50$ and $1.00$, the first coin flip resulted in *Heads*.
|
||||||
|
The above process can be repeated just like the encoding process until we've determined the result of the first three coin flips.
|
||||||
|
|
||||||
|
These subdivisions can be encoded using $0$ and $1$, where $0$ represents the bottom half of the range, and $1$ represents the top half of the range.
|
||||||
|
|
||||||
|
When the alphabet is large enough that you can't select a particular outcome using one bit, multiple bits can be used instead to divide up and down the range.
|
Reference in New Issue
Block a user