The Verhoeff-Gumm Check Digit Algorithm

  Рет қаралды 191,148

Kevin Lubick

Kevin Lubick

Күн бұрын

Rediscover and explore the Verhoeff-Gumm algorithm, a check digit formula which is more resilient to common errors than the Luhn algorithm, which is widely used in credit card numbers, IMEI numbers and more.
Historical Notes:
"Error Detecting Decimal Codes" [1], a PhD thesis by J Verhoeff was published in 1969. It showed how the vast majority of digit typos were single digit or transposition errors, traditional "modulo 10" algorithms always missed some transposition errors, and introduced a novel class of algorithms based on "the dihedral group of order 10" (pentagon flips and rotations). In section 4.4, Verhoeff outlines using "search program" to find a permutation function that is optimal for detecting errors. A formal proof of the permutation's correctness is omitted. I found Verhoeff's writing to be difficult to approach, so I recommend a section in "Contemporary Abstract Algebra" (seventh edition) by Joseph A Gallian (pg 111-114) for a clearer write-up. A witty quote from Verhoeff in the introduction made me chuckle: "[I believe] that the codes explained in chapter 4 provide the first practical application of the dihedral group. This would illustrate the old saying that all beautiful mathematics will find an application, sooner or later."
In 1985, H. Peter Gumm published "A new class of check-digit methods for arbitrary number systems" [2]. It starts with a dense proof that "modulo 10" (indeed modulo 2k) formulas will always be flawed. The paper then justifies the use of the dihedral group, which to me sounded like a mathematician walking around a store looking for the right outfit ("needs cancellation", "should be associative", "finite members", "can generalize for any even number"). Gumm then proves an algorithm using D_s works, using the number pair notation and a permutation function tau.
Gumm claims to have been unaware of Verhoeff's work. Additionally, Gumm adds a proof and a way to scale it beyond 10 digits, so I decided to credit them both with discovering the algorithm in this video.
A variant of the algorithm saw use (an may still see use) on German Banknotes [4].
Felix Klein (same as the Klein bottle) was an important contributor to group theory [3], and was chosen to be the cardholder in the intro. Likewise, Évariste Galois coined the term "group" and was thus chosen to be the online vendor.
[1] ir.cwi.nl/pub/13046/13046D.pdf
[2] www.researchgate.net/publicat...
[3] archive.org/details/vergleich...
[4] ocs.ef.jcu.cz/index.php/inprof...
Expanding the Mathematical Toolbox:
A key concept in Group Theory is the idea of sets, which is covered very well in [4]. Groups are introduced well in [5] and I hope the author continues the series.
The Rubix cube can be analyzed using group theory [6] or with "graphs" [7], which are both useful when dealing with so many possible states.
[4] • What IS a Number? As E... "What IS a Number? As Explained by a Mathematician" by Another Roof
[5] • Researchers Use Group ... "Researchers Use Group Theory to Speed Up Algorithms - Introduction to Groups" by Nemean
[6] • Group theory 101: How ... "Group theory 101: How to play a Rubik’s Cube like a piano - Michael Staff" by TED-Ed
[7] • The trick that solves ... "The algorithmic trick that solves Rubik’s Cubes and breaks ciphers" by polylog
Animations were made with Manim Community edition (www.manim.community/) taking about 7k lines of Python code to make.
Sound effects from KZbin Audio Library
- Battle Crowd Celebrate Stutter
- Punchline Drum
This was Kevin Lubick's entry into Summer of Math Exposition 3 #SoME3
- some.3b1b.co/
0:00 Luhn Algorithm (and its flaw)
1:39 How could we fix the flaw?
2:21 Basic Integer Operations (how they don't help)
3:12 Rotating and Flipping Shapes is order dependent
4:16 Combining Pentagons (function composition)
5:30 "Packing the box" with pentagons (associativity/inverses)
6:56 Do our pentagons work for all transpositions? (Cayley Table)
8:29 Adding a preprocessing step (sigma function)
9:30 How to prove if sigma works (converting to integer pairs)
11:56 Proving Gumm's sigma function does work
13:12 Expanding sigma into digit permutation
13:38 Scaling up to 3 or more digits/pentagons
15:06 Summarizing the Verhoeff-Gumm Algorithm (and the variants)
16:00 Group theory is all about surprising symmetries

Пікірлер: 160
@dawiid5215
@dawiid5215 9 ай бұрын
Nit: you should show the cayley table for ( \sigma (x), y), would've been cool to show how there is no symmetry along the diagonal anymore
@mauithedog10
@mauithedog10 9 ай бұрын
Probably the best SoME3 submission ive seen so far. The explanations are so good it's almost like a conversation and the animations are super engaging and smooth. Sucked me in to the very end.
@RIPenemie
@RIPenemie 9 ай бұрын
what is #SoME3 ?
@CDCHexaku
@CDCHexaku 9 ай бұрын
@@RIPenemie Stands for "Summer of Maths Expedition", basically think of a game jam, but instead of submitting games, you submit a mathematics communitcation video. Very cool event!
@ricsixd
@ricsixd 9 ай бұрын
Such a good video! The motivation to get that last 2% of transposition errors was so compelling, and the solution so satisfying.
@fangjiunnewe3634
@fangjiunnewe3634 9 ай бұрын
So many math video just name drop group theory and isomorphism without explaining how the shapes actually map to some number system in a specific and useful way. This video managed to finally show me how groups can be mapped to a useable algebra, thank you!
@thecommexokid
@thecommexokid 9 ай бұрын
I could have used some more explicit exposition at 5:05. This is the point at which you switch from treating the group elements as "10 orientations of a pentagon" to "10 operations you could do to pentagons," and you do it essentially without comment or explanation. Obviously both sets are isomorphic but first representing the group elements as themselves being pentagons, then suddenly switching to thinking of them as operations on pentagons, was disorienting. The "rotate by 1/5 turn" or "reflect about the vertical axis" operators are not pentagons themselves and I could have used more handholding when you switched from one to the other practically mid sentence.
@KevinLubick
@KevinLubick 9 ай бұрын
That's good feedback, thank you.
@IhabFahmy
@IhabFahmy 9 ай бұрын
Totally agree
@vladislav_sidorenko
@vladislav_sidorenko 9 ай бұрын
Nitpick but at 2:49, commutative is described as order not mattering. That's true only for operations that are both commutative and associative. If it's commutative and non-associative, it still may be possible to swap 2 elements amd get a different result. For example, let's say that ~ represents an arithmetic mean of the two numbers. It's a commutative operation since in an individual operation, order doesn't matter. However, 1~5~13 = 8, but 1~13~5 = 6.
@K9Megahertz
@K9Megahertz 9 ай бұрын
I ran into this many many years ago. I would like to suggest that rather than adding the digits together (e.g. 12 = 1+2 = 3) you subtract 9 from the number instead. You get the same value, and its a little easier to code if you're implementing this in software.
@Voshchronos
@Voshchronos 9 ай бұрын
fascinating!
@saiv46
@saiv46 9 ай бұрын
Substract not 9, as its true only for 9 < X < 20, but 9 * ((X - (X % 10)) / 10), which works for all integer numbers up to 119
@K9Megahertz
@K9Megahertz 9 ай бұрын
@@saiv46 You're doubling the original single digit number, which means it will never be greater than 18, you don't really need to handle larger cases, and even if you went ahead and did that, where do you draw the line? mod 10, mod 10000? mod 31337? more?
@OldSoulClimber
@OldSoulClimber 9 ай бұрын
Easily one of the best SoME 3 video I have seen yet! Love the different visual language presented!
@shibeinu4988
@shibeinu4988 9 ай бұрын
I just took a class on group theory during my final semester of college and it’s so cool to see an application of the seemingly arbitrary concepts and rules of groups theory
@lilium724
@lilium724 9 ай бұрын
This is hands down the best video I've seen about a practical application to group theory! Really impressive!
@DokterKaj
@DokterKaj 9 ай бұрын
I'm in awe of how you presented this topic in such a comprehensible way. Loved the video, hope you win!
@Heka2
@Heka2 9 ай бұрын
Loved this video! I never really thought about what the digits on a credit card might signify. This is such a clever way of foregoing basic human errors and as always I love to see practical applications for group theory. I felt very drawn into this problem and your explanations were easy to follow. Excited for more
@applimu7992
@applimu7992 9 ай бұрын
Knowing about the semi-direct product from group theory made identifying the pentagons with pairs of numbers alot more satisfying for me
@MasterHigure
@MasterHigure 9 ай бұрын
Really cool video. Very glad to see you call the group D5, which is objectively the correct naming scheme for the dihedral groups. I will personally fight anyone who thinks D10 is even remotely appropriate, with words or fists.
@Racrdude24
@Racrdude24 8 ай бұрын
This video flows so well! You are an excellent storyteller!
@bunniesarecute3135
@bunniesarecute3135 9 ай бұрын
Great video! I actually took a group theory course in uni which left me quite confused about the practical applications of it, but this video was quite eye-opening to say the least :D thanks!
@aidanocallaghan169
@aidanocallaghan169 8 ай бұрын
Great captioning, clarified the pronunciation of a the name of the algorithm. More content creators should act like this!
@coffeemixer4292
@coffeemixer4292 9 ай бұрын
Awesome channel. So many incredible lectures. Thank you❤
@RadenVijaya
@RadenVijaya 7 ай бұрын
After 10 hours of driving, i stumbled upon this video. Now i cant sleep as my mind engages in this topic 😅 nice video btw. I learnt something new here...
@squorsh
@squorsh 9 ай бұрын
This is a great video, I love the visualization of this concept
@eclypze_
@eclypze_ 9 ай бұрын
Amazing video! cant wait for this channel to pop off
@redstowen
@redstowen 9 ай бұрын
One of the best #SoME3 videos!
@siddhantmisal4115
@siddhantmisal4115 5 ай бұрын
Great content ! underrated channel
@kiliane.3266
@kiliane.3266 9 ай бұрын
Would have been so nice to learn about this in University when studying about groups etc - just to show a real world example to create interest in the field.
@sable2x
@sable2x 9 ай бұрын
This video is so well done. I always love seeing group theory out in the wild! Would love to see more of this type of content
@Vfulncchl
@Vfulncchl 9 ай бұрын
FANTASTIC SoME3 entry!!!
@adrianv.v.4445
@adrianv.v.4445 9 ай бұрын
Amazing work! This is a good candidate to get a prize.
@greenafroninja7
@greenafroninja7 9 ай бұрын
Great video! Just shared it with 2 of my mates!
@ahuggingsam
@ahuggingsam 9 ай бұрын
Really cool video, very well done. if I can offer a small bit of feedback though (I'm not associated with SoME): sometimes I feel the screen can get very visually busy, which can be a bit overwhelming, even though it is always clear what you are talking about. Feel free to do with this as you please, thanks again for the cool video :)
@user-jc2lz6jb2e
@user-jc2lz6jb2e 9 ай бұрын
Btw, the reason we ues this group and not any other group, is because there's literally only two groups of order 10 (the amount of digits we have, 0 to 9), and the other one is commutative, which wouldn't work as noted in te video.
@philippberninger7726
@philippberninger7726 9 ай бұрын
This content is amazing. Simply amazing. In school I wished for this Kind of content. Teachers should adapt to Teach things Visually. Wow i am amazed!
@eric3813
@eric3813 9 ай бұрын
such an awesome video!!! loved it! subscribed :)
@pedrocrb
@pedrocrb 9 ай бұрын
what a delightful video
@juancristi376
@juancristi376 9 ай бұрын
Great video!!
@candilunio
@candilunio 9 ай бұрын
These colorful pentagons are CUTE! 😍
@GauravNirala
@GauravNirala 9 ай бұрын
Just phenomenal!
@user-le1oc9js4h
@user-le1oc9js4h 9 ай бұрын
Thank you for this video! I always wanted to know the applications of group theory irl
@Cobalt1911
@Cobalt1911 9 ай бұрын
Great work! 👏
@mostlyokay
@mostlyokay 9 ай бұрын
Love the "quacks like a duck..." joke
@bananya6020
@bananya6020 9 ай бұрын
For some reason, the first thought I had upon seeing the Verhoeff-Gumm was "oh look it's tetris!" I wonder if there's some knowledge about perfect clears that can explain this too.
@ExplodingWaffle101
@ExplodingWaffle101 9 ай бұрын
great video! the box analogy is not “intuitive” to me, but it doesn’t matter because you didn’t use it for the rest of the video :) and you did such a good explanation of the algorithm. well done
@kwiky5643
@kwiky5643 9 ай бұрын
What a great educational video
@zach4505
@zach4505 9 ай бұрын
Amazing work, hope this helps give your videos the visibility they deserve. You other videos are amazing and more people should see them.
@categorygrp
@categorygrp 9 ай бұрын
while i hate that notation, the capital letters for group elements, this is a wonderful idea edit: I see you switched to the much nicer notation midway. good man
@worldadmin9811
@worldadmin9811 9 ай бұрын
nicely done :)
@nxpnsv
@nxpnsv 9 ай бұрын
Excellent use of a comic rimshot!
@matthewhansen9223
@matthewhansen9223 9 ай бұрын
This video has some mad timing cause I just started my senior year in my math undergrad, and I am taking group theory this semester!
@scragar
@scragar 7 ай бұрын
I much prefer the idea of just having two different checksum digits using different algorithms. The first checksum can check everything before the last digit, and the last digit can remain the luhn algorithm as present, this gives us extra security and since we're not using all the digits of the card number already(there's orders of magnitude less cards than possible card numbers) it's not going to cost us anything for the additional safety that'd remain backwards compatible. If you're going to go for a solution most people can't do in their heads though I suggest going all out and just use a traditional hashing algo, they munge the data each step in such a way that communitivity is lost making transpositions as obvious as a changed value(using SHA for example that uses a grid of numbers, then every time it applies a change(by bitmasking numbers together) it applies row/column shifts such that the next number would apply differently). This also requires the least effort to add to new services, every modern programming language has access to libraries that can provide access to a bunch of pre-existing hashing algorithms.
@ItIsJan
@ItIsJan 9 ай бұрын
is this essentially a hash function? applying some function to first n (i think n=9 in this case?) digits of a credit card number, to get the n+1th digit, so if you type it in, if the function desnt result in the last digit, they misstyped something..?
@HyperFocusMarshmallow
@HyperFocusMarshmallow 9 ай бұрын
Nice video. Well put together. I kind of felt that you brushed past actually explaining what a “group” is in mathematics and what group theory is in mathematics. Even at the end when you were trying to recap you mostly said some pretty generic things that wasn’t very mathematical at all. But that’s acceptable I guess. I usually feel that if you want to introduce a word in mathematics you had better define it and motivate it, otherwise try to do the same thing without introducing the fancy word… But sometimes it’s also good that people just hear words so they can recognize them the next time. Overall great video!
@U.Inferno
@U.Inferno 7 ай бұрын
When I heard pentagons and group theory i for some reason thought youd be throwing the quintic at us
@NeverSnows
@NeverSnows 9 ай бұрын
I was wondering, but couldn't quite figure out how, what if we used binary? Using the property of 1+2+4+8+... could lead into some efficient algorithm. Maybe assign a binary number to each digit, such as 0=1, 1=2 etc?
@DavidLindes
@DavidLindes 9 ай бұрын
Interesting stuff. Help me understand how the tetris shapes fit in (unfortunate pun) to things? Like, you seem to equate them to the hexagons, but I don’t grok how or why, and also they don’t seem to have a consistent shape per digit, so… I’m just lost as to what they’re actually trying to represent. ?? Thanks!
@Dominik-K
@Dominik-K 9 ай бұрын
Great video, would've loved to see the table representation to see that there is no symmetry anymore
@ericsbuds
@ericsbuds 9 ай бұрын
ive always wondered how the card number is checked like that. thanks!
@wowzande
@wowzande 8 ай бұрын
You got my sub. How long does it take for you to release these type of videos?
@KevinLubick
@KevinLubick 8 ай бұрын
This video took about 80-100 hours to make once i had an idea and a rough outline of what I wanted to say. Videos happen when they happen :)
@vladimirfokow6420
@vladimirfokow6420 9 ай бұрын
Great! I finally received a direct practical example of how group theory can be useful, which makes it very easy to learn it if I decide to do it in the future. Thanks!🤗
@catte_6376
@catte_6376 9 ай бұрын
such a great video!!!!!!!!!!!!!!1
@paulschnetzler9410
@paulschnetzler9410 8 ай бұрын
What am I even watching that late at night, I should sleep
@mc-not_escher
@mc-not_escher 9 ай бұрын
Strangely enough, this reminds me of the subject of topology and also as an extension how tying your shoes one way vs. the "normal" 'loop-and-swoop' way is still misunderstood by the vast majority.😅
@yesworld7292
@yesworld7292 9 ай бұрын
The video is extremely well made and entertaining. And I was surprised by number of views and subscribers. I guess, you gotta work on your video cover. I mean this wasn't bad, cuz I clicked it. But I was just curious, because I couldn't see any relations in title and images. Overall, as I said video is great. Graphics was entertaining. Continue your work buddy. It was very interesting.
@stephnue7790
@stephnue7790 9 ай бұрын
I have a question regarding the formular at 10:26 What is the first input of the mod-operation? Is it the second number, that encodes the rotation? Then it should be (f*g,(f*s+r)mod 5) Or am I mistaken here and it is aplied to the whole tuple
@KevinLubick
@KevinLubick 9 ай бұрын
Technically to both parts of the tuple, but because the first term is only multiplying {-1, 1}, the mod doesn't really.
@johnchessant3012
@johnchessant3012 9 ай бұрын
Very nice! In fact the group of the ordered pairs (f, r) with that seemingly strange operation for combining them is the semidirect product Z_n ⋊ Z_2. So this means the dihedral group D_n is isomorphic to Z_n ⋊ Z_2 for all n.
@MarcellsChannel
@MarcellsChannel 9 ай бұрын
Azmazing video! I just have one question: with all this erroe correction in mind how many possible card number are there?
@KevinLubick
@KevinLubick 9 ай бұрын
You can put anything you want in the 15 data digits and the check digit is then fixed. With 10 digits to choose from, 15^10 valid cards.
@anndrey93ify
@anndrey93ify 9 ай бұрын
576,650,390,625 valid cards, i think.
@marvinochieng6295
@marvinochieng6295 8 ай бұрын
This guy does the math
@blackpepper2610
@blackpepper2610 8 ай бұрын
Subscribed
@magnusmalmborn8665
@magnusmalmborn8665 9 ай бұрын
A checksum video without mentioning Galois..!
@evreatic3438
@evreatic3438 9 ай бұрын
144° , 216°... Ahh! They hurt my brain! 4π/5 and 6π/5 are way more intuitive when dealing with pentagons.
@Deathington.
@Deathington. 9 ай бұрын
Thanks for explaining how to find valid credit card numbers for credit card theft 😂
@Hans_Magnusson
@Hans_Magnusson 5 ай бұрын
A variation is used for Swedish social security number… But the difference eg between 70 and 67 in this case is the check digit!
@worldfromhome4033
@worldfromhome4033 9 ай бұрын
And I randomly come to this video!
@canaDavid1
@canaDavid1 9 ай бұрын
Isn't it more convenient to just represent 0-9 as the 10 flips of a decagon? Then, if there are odd numbers, the check sum is the last flip, and if an even number of digits, the following check digit is the missing rotation.
@canaDavid1
@canaDavid1 9 ай бұрын
No, this does not differentiate between two orthogonal flips. If only we used an odd base.
@JoeyLlamaGames
@JoeyLlamaGames 8 ай бұрын
So if this is the formula to check if it is a correct number, then what is the initial formula that generates these numbers. And how do we not run out of valid numbers.
@cmilkau
@cmilkau 9 ай бұрын
In theory, we also need to check whether flips are detected when σ is applied to the second digit, as flips can occur at any position in the credit card number, not just every other position.
@partywumpus5267
@partywumpus5267 9 ай бұрын
no, as flipping X and Y would just be the same as swapping the two sides of the not-equals sign. as in `sigma(X)*Y != sigma(Y)*X` the other way around is just `sigma(Y)*X != sigma(X)*Y`
@KevinLubick
@KevinLubick 9 ай бұрын
Correct. This is briefly mentioned at 14:00, but I skip showing the derivation since it is very similar to before (good practice though if you want to try it).
@SirRebrl
@SirRebrl 9 ай бұрын
@@partywumpus5267 Not quite. What's being attended to here is if you have A B C and you apply sigma to every other digit [eg sigma(A) B sigma(C)], when you prove that sigma(X) * Y != sigma(Y) * X, you account for the A B to B A transposition but not the B C to C B transposition, which needs X * sigma(Y) != Y * sigma(X). Not the same inequality because composition is not commutative.
@partywumpus5267
@partywumpus5267 9 ай бұрын
@@SirRebrl ah of course, it's not commutative. Fair enough then.
@alextasarov1341
@alextasarov1341 9 ай бұрын
Wait I got a little lost. How would the front end know the difference between a valid and invalid card number? Does the card company only make numbers that follow a pattern? What makes swapping two numbers invalid besides producing a different result? Is it the check value? Would this value be something like the security code or just unique to the algorithm? Rewatching lol
@KevinLubick
@KevinLubick 9 ай бұрын
Credit Card companies only put numbers on the cards that follow the Luhn algorithm. Specifically, a credit card vendor starts with their "assigned" prefix (e.g. all Visa cards start with a 4 and no other vendor does) www.ibm.com/docs/en/order-management-sw/9.3.0?topic=cpms-handling-credit-cards (see Table 1) Then, they add a certain number of digits that correspond to an account number. At this point, they have n-1 digits where n is the length (Visa, Mastercard and Discover have 16 digits but some vendors have less). Then, they perform the Luhn algorithm on all those digits and "round up" to the next multiple of 10 to get their check digit and append it to the end. With this fact (all credit card numbers follow the Luhn algorithm), a frontend can also run the Luhn algorithm to verify that what a user typed *might* be valid (passes Luhn check) before sending it off to the database. The security code on the back is likely a different algorithm and is probably secret/proprietary (so it cannot be reverse-engineered by bad actors).
@alextasarov1341
@alextasarov1341 9 ай бұрын
@@KevinLubick Thank you!
@multiarray2320
@multiarray2320 9 ай бұрын
why is it saying "double every other number"? it was confusing for me.
@Asterism_Desmos
@Asterism_Desmos 9 ай бұрын
I will never unsee “o with a hairdo”
@matheustran8009
@matheustran8009 9 ай бұрын
Jacobus Verhoeff is the father of my professor Tom Verhoeff at tu/e!!!
@hansisbrucker813
@hansisbrucker813 2 ай бұрын
That's so cool. What do you study? 😊
@Xorume.
@Xorume. 9 ай бұрын
Would any sigma table fit this algorithm, as long as no two digits mapped to the same and zero mapped to zero? If so, that step feels a bit overengineerd. But it was cool anyways. Thanks for the video!
@bobbob905
@bobbob905 9 ай бұрын
Its a great video but i dont really understand the point of the b value when it always gets cancelled out
@KevinLubick
@KevinLubick 9 ай бұрын
The b value is important when dealing with X * sigma(Y) != Y * sigma(X), the derivation was not shown. b is also handy in making simga(0) be 0, which allows for the leading 0 trick.
@simpli_A
@simpli_A 9 ай бұрын
As a cuber myself, I wholeheartedly agree with your mother… sticker peelers are the worst cretins on this earth
@YellowBunny
@YellowBunny 9 ай бұрын
At around 11 minutes you write (fg, fs+r) mod 5 which I don't really like because the first component is not mod 5 but instead from {-1,+1}. Something like (fg, fs+r mod 5) would have been better.
@prcvl
@prcvl 9 ай бұрын
Doesnt the Luhns Algorithm start with the second to last number and doubles it?
@KevinLubick
@KevinLubick 9 ай бұрын
It does, which is what is shown in the animation. The reason this is done (I believe) is so the check digit doesn't have to be doubled, which complicates the calculation.
@SirNobleIZH
@SirNobleIZH 9 ай бұрын
If it walks like a duck and it quacks like a duck, it's isomorphic to a duck
@alexjohnward
@alexjohnward 9 ай бұрын
Is there an optimal algo for error correction, not just error detection?
@KevinLubick
@KevinLubick 9 ай бұрын
KZbinr @AnotherRoof did a great video recently on the error correcting algorithm that NASA uses to send images through outer space: kzbin.info/www/bejne/ip7bXqlqe86DbKs
@cleverclover7
@cleverclover7 9 ай бұрын
i'm lacking some knowledge to understand this seemingly very interesting video. how are the number's generated in the first place? They have to be 1. unique, and 2. satisfy the algorithm(s) you give in this video. But I presume they don't just brute force increment and check?
@KevinLubick
@KevinLubick 9 ай бұрын
A credit card vendor starts with their "assigned" prefix (e.g. all Visa cards start with a 4 and no other vendor does) www.ibm.com/docs/en/order-management-sw/9.3.0?topic=cpms-handling-credit-cards (see Table 1) Then, they add a certain number of digits that correspond to an account number. At this point, they have n-1 digits where n is the length (Visa, Mastercard and Discover have 16 digits but some vendors have less). Then, they perform the Luhn algorithm on all those digits and "round up" to the next multiple of 10 to get their check digit and append it to the end.
@cleverclover7
@cleverclover7 9 ай бұрын
@@KevinLubick what a great reply! thanks!
@KalijahAnderson
@KalijahAnderson 9 ай бұрын
Now I want an Isomorphic duck. :P
@michelefurci3506
@michelefurci3506 9 ай бұрын
So now how to know if a credit card uses Luhn or Verhoeff algo? Maybe you transposed a number and it's checked with Luhn but it was using Verhoeff.
@KevinLubick
@KevinLubick 9 ай бұрын
I believe *all* credit cards use the Luhn algorithm, as per the specification www.ibm.com/docs/en/order-management-sw/9.3.0?topic=cpms-handling-credit-cards
@d.lawrencemiller5755
@d.lawrencemiller5755 9 ай бұрын
I have no idea what you mean about intuitive sized boxes 0:53
@KevinLubick
@KevinLubick 9 ай бұрын
Suppose you go to the post office and buy a box. They only have boxes in certain sizes, say 9 x 6 x 2 or 11 x 9 x 6. Your stuff is unlikely to fit *exactly* in one of those pre-sized boxes, but you can add packing peanuts or other filler to take up the rest of the empty space. In that analogy, the filler is the check digit because it makes the existing content conform to some rule (fit in a box) so it is more robust during shipping.
@orichen5409
@orichen5409 9 ай бұрын
I think you have a mistake at 10:21 when you substituted the variables you mixed up s and r.
@KevinLubick
@KevinLubick 9 ай бұрын
Good catch. Thankfully, since we multiply by 1, the mistake is short lived :)
@anon_y_mousse
@anon_y_mousse 9 ай бұрын
Wouldn't it be easier to just use one number for each pentagon, +[0-4] for regular, -[0-4] for flipped? If you insist on using integers, scale the numbers by 1, or I suppose you could find a computer that uses 1's complement negation. Though, I can't remember which computers use that, I know they're still being made to this day. Either way, you can have a negative and a positive 0 with floating point, but it'd be easiest to just adjust the scale by 1 and remember that in your calculations.
@rueblimaster
@rueblimaster 9 ай бұрын
What if multiple numbers are transposed?
@SirRebrl
@SirRebrl 9 ай бұрын
Had fun coming up with a sigma function. Tried sigma(f, r) = (f, r + fb) but that failed on f = g = 1 && r != s, and f != g && r = s && r + b = 0 mod 5. Came up with sigma(f ,r) = (f, -fr + fb) and that did the trick on sigma(x) * y != sigma(y) * x, but it fails for some cases on x * sigma(y) != y * sigma(x), which I didn't think to check before finishing the video.
@KevinLubick
@KevinLubick 9 ай бұрын
Great job giving it a go, though!
@tracyh5751
@tracyh5751 9 ай бұрын
A bit brisk, but so was 3b1b back in the day.
@tommasobanfi8133
@tommasobanfi8133 8 ай бұрын
i wonder how many people went to check their credi card number after this video to see if the test works
@HarrysDogmalaysia
@HarrysDogmalaysia 9 ай бұрын
How did i get here? Why am i learning how to forge a card
@friedrichhayek4862
@friedrichhayek4862 9 ай бұрын
Is the sigma operation isomorphic?
@fakezpred
@fakezpred 8 ай бұрын
To what?
@friedrichhayek4862
@friedrichhayek4862 8 ай бұрын
@@fakezpred To itself. No it is not sigma(1 + 4) is not the same as sigma(1) + sigma(4).
@fakezpred
@fakezpred 8 ай бұрын
@@friedrichhayek4862 It doesn't make much sense to discuss isomorphism of functions. What you seem to be thinking of is linearity, or perhaps you were wondering if sigma is an automorphism on some group
@friedrichhayek4862
@friedrichhayek4862 8 ай бұрын
@@fakezpred certainly not linearity, just an automorphism on the same group of pentagons
@fakezpred
@fakezpred 8 ай бұрын
@@friedrichhayek4862 I see, so you wanted to ask whether sigma was an automorphism. That makes more sense
@devvy8343
@devvy8343 9 ай бұрын
When we make the rules for the box stricter, we cut off more potential correct inputs though, right? Like the reason transposing 0 and 9 worked is because doing that provided two valid codes. Like *the best* system would just be "if the code doesn't equal x, its wrong" because ANY error to ANY digit that could be infinitely long could be detected. Verhoeff-Gumm seems to work because it just makes the rules more strict! But, I like it, very interesting!
@mrphlip
@mrphlip 9 ай бұрын
Not necessarily... both of these codes have 1/10 of the inputs be valid, like, if you were to pick a string of digits completely at random, you'd have a 10% chance of it being considered valid by each of these codes. What has changed is the distribution of those valid inputs, ensuring that no two inputs are neighbours by a single transposition or a single digit change. Compare to the encoding scheme that "a number is valid if the final digit is a 7"...still has a 1/10 chance of passing a random string, but now all the valid strings are closely clustered together, so any transposition or digit change is very likely to give you another valid code.
@partywumpus5267
@partywumpus5267 9 ай бұрын
nope afaict both codes could still be valid, just with different check bits
@MasterHigure
@MasterHigure 9 ай бұрын
If you have 11 free digits and one check digit, then no matter what check digit scheme you use, you have the same number of valid codes. The trick is making sure that common errors in typing the first 11 results in a different check digit as often as possible. Which is to say, have as few as possible valid codes that are "close to one another", where "close" is defined in terms of how easy it is to type one when you mean the other.
@NonTwinBrothers
@NonTwinBrothers 9 ай бұрын
Man I wish I knew what was purple and commutes ...
@KevinLubick
@KevinLubick 9 ай бұрын
I'd always heard the "What's nutritious and commutes?" version, but apparently there are multiple: math.stackexchange.com/questions/1354105/explanation-of-a-joke-on-abelian-groups-grapes
@ryanjiva
@ryanjiva 8 ай бұрын
Hexagons are bestagons.
A problem so hard even Google relies on Random Chance
12:06
Breaking Taps
Рет қаралды 1,1 МЛН
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 33 МЛН
Black Magic 🪄 by Petkit Pura Max #cat #cats
00:38
Sonyakisa8 TT
Рет қаралды 30 МЛН
狼来了的故事你们听过吗?#天使 #小丑 #超人不会飞
00:42
超人不会飞
Рет қаралды 60 МЛН
Rethinking the real line #SoME3
14:54
Proof of Concept
Рет қаралды 92 М.
Greatest Mathematicians and their Discoveries - Part 2
9:40
ThoughtThrill
Рет қаралды 6 М.
The Magic of Zero-Knowledge Proofs #SoME3
26:49
Ingonyama
Рет қаралды 59 М.
What Happens If We Add Fractions Incorrectly? #SoME3
29:04
The Boundary of Computation
12:59
Mutual Information
Рет қаралды 934 М.
The Art of Procedural Noise #SoME3
32:03
Vojtěch Pröschl
Рет қаралды 46 М.
The Fascinating Math behind Piston Extenders #SoME3
20:08
mattbatwings
Рет қаралды 553 М.
Making a calculator from scratch - #SoME3
24:25
VoxelRifts
Рет қаралды 29 М.
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 33 МЛН