Text Compression with Huffman Coding

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 121

  • @SensCodingStudio
    @SensCodingStudio 7 років тому +165

    Why i paid 50k for college is beyond me when this explanation is free and is better than how my professor explained it

    • @Stofzuigerr1
      @Stofzuigerr1 6 років тому +13

      Because he doesn't hand out your certificate unfortunately.

    • @zerocode1504
      @zerocode1504 6 років тому +1

      Is this static or dynamic huffman?

    • @OwzaB
      @OwzaB 6 років тому

      Even better than my Course prescribed textbook.

    • @GoodNewsJim
      @GoodNewsJim 3 роки тому +5

      Heads up, University is only for people who don't know how to learn since lectures came online since 2003. If you know how to learn, you can be a polymath in the time people go to uni for stuff.
      If you want to be a slave to student loans, by all means go to uni if you're into that kind of kink. If you're smart, just learn online.

    • @jamalmydeen8446
      @jamalmydeen8446 2 роки тому +2

      i paid 4L indian rupeee

  • @suzanbobette2580
    @suzanbobette2580 7 років тому +32

    Best explanation of Huffman coding!! Thank you! Great pace and simple explanation. Great job!!!

  • @furkanfrost
    @furkanfrost 2 роки тому +2

    this was the best text compression teaching video ive ever watched thanks for helping

  • @celestinomacie9589
    @celestinomacie9589 2 роки тому +2

    I am amazed! I am a college student in Mozambique and I've been struggling to understand the Huffman Coding.
    Thank you for the simplicty of how you explain things

  • @pannerbiryani3002
    @pannerbiryani3002 6 місяців тому

    This is good explanation!! you explained it so simply. we need more explanation videos of this format!!

  • @bluesystemjackson
    @bluesystemjackson 6 років тому +13

    Learned more in 6 minutes than in two entire lectures and two tutorial classes at university. Why do Profs and teachers make it so hard, when it can be explained so easily?

    • @ExZeMIP
      @ExZeMIP Рік тому

      Better to have 2 lectures wasted on something simple, than 2 lectures fully packed with content, no?

  • @JamieJaftha
    @JamieJaftha 7 років тому +2

    Thank you so much!! Now I understand Huffman coding much better than before.

  • @Farrukhw
    @Farrukhw 6 років тому

    Finally, I got some clear understanding of building the tree using smallest frequency values.. Thanks a bunch... Greetings from Pakistan...

  • @UsmanArshad-qv5nt
    @UsmanArshad-qv5nt Рік тому

    What a stupendous, winsome, elegant, and terse explanation!

  • @任安明
    @任安明 7 років тому +9

    finally,i understand Huffman code

  • @gabrielangel1996
    @gabrielangel1996 6 років тому

    Thats the easiest and Best explanation on the subject. Thank you very much sir

  • @ZackDiD
    @ZackDiD 3 роки тому

    man, you are a genius. your explanation is better than some professors

  • @wardamtn
    @wardamtn 7 років тому +1

    You have saved my life. thank you so much. Such an easy explanation.

  • @Kurasz666
    @Kurasz666 5 років тому +3

    Thanks man, cheers from IT student in Poland

    • @jakub6514
      @jakub6514 4 роки тому

      Same situation here :P This guy up there, explained it to me in 6 minutes, when my professor wasn't able to do this is 6 months...

  • @Dacarns
    @Dacarns 4 роки тому

    This is the best example I could find. Thank you!

  • @mortred4144
    @mortred4144 3 роки тому

    Thanks, you explained it better than my professor.

  • @davidbachy5627
    @davidbachy5627 Рік тому

    The best explanation yet!!!

  • @piyushukla22
    @piyushukla22 7 років тому +10

    Honestly speaking, this is the best video available on huffman coding throughout youtube
    Although I have a small doubt about...
    how to trace back to the original message from the encoded one ;)
    If someone could give a little brief.
    Thanks in advance!!

    • @zerocode1504
      @zerocode1504 6 років тому

      Is this static or dynamic huffman?

    • @vapula87
      @vapula87 4 роки тому

      You have to rebuild the tree so that the values are in the exact same place. Then you use the bits to go right or left in the tree.

  • @jasinsworld3095
    @jasinsworld3095 Місяць тому

    Best video on this topic

  • @ndm99999
    @ndm99999 5 років тому

    sir, its too easy to understand thank you so much ,love from sri lanka

  • @GurdevSeepersaud
    @GurdevSeepersaud 2 роки тому +1

    Wow that was actually pretty interesting

  • @puskk1419
    @puskk1419 6 років тому +3

    Best explanation...!! Thanks

  • @02smn
    @02smn 2 роки тому

    Thank you! Great explanation. Subbed because of this great teaching video.

  • @vitragb5908
    @vitragb5908 4 роки тому +1

    Finally got it
    Nicely explain

  • @cangozpinar
    @cangozpinar 3 місяці тому

    Beautifully explained thank you

  • @maazbukhsh7511
    @maazbukhsh7511 7 років тому

    finally, i understand what Huffman coding is

  • @medaminetourham2152
    @medaminetourham2152 15 днів тому

    absolute cinema

  • @lukem6030
    @lukem6030 4 роки тому +1

    This video helped a lot thank you so much :) .

  • @confessions92
    @confessions92 6 років тому

    Best explanation I found on youtube!! :D

  • @YTM4niac
    @YTM4niac 7 років тому

    Actually.. you explained it the best! Thanks :)

  • @kritikabagmar7976
    @kritikabagmar7976 6 років тому +2

    Good explanation.. Thanks

  • @yassinal-nuaimee1204
    @yassinal-nuaimee1204 4 роки тому +1

    Great explanation👌🏼

  • @chrysleague
    @chrysleague 4 роки тому +9

    This demonstration was really great! My only complaint is I think it's unfair to compare the 46 bits with Huffman tree to 136 with ASCII at 8 bits per character. Those 8 bits are supporting up to 256 distinct characters, while the Huffman tree only accommodates 8 characters. So if we only need to encode the characters used in the message (ISPRMVE_), we could do that with just 3 bits per character. Then this fixed-size encoding would be 17×3=51 bits. So the Huffman tree still yields a savings, but it's more like 47/51 ~= 92% of the length of the original. [Full disclosure: I also have an explainer video about Huffman coding, and teach it pretty regularly.]

    • @TashingaPemhiwa
      @TashingaPemhiwa 3 роки тому

      But you'd still need to send a mapping (full ASCII code to Huffman code), along with the encoded data, resulting in the transmitted data being longer than the original data (for this particular example)

  • @RamKumar-ox3bs
    @RamKumar-ox3bs 5 років тому +2

    Easy to digest 😁😁 Thanks

  • @vincentverdugo
    @vincentverdugo 4 роки тому

    The best explanation

  • @dochollywood
    @dochollywood 7 років тому +1

    Clear and concise. Thanks!

  • @jamoliddinz
    @jamoliddinz 4 роки тому

    thank you, that was really easy to understand.

  • @tomq6491
    @tomq6491 10 місяців тому

    Great video and well explained. Just one thing I would say about the ASCII coding, one of its 8 bits is used for parity check so perhaps it would be more fair to consider the ASCII characters as 7 bits. It would still be a great example of lossless compression though.

  • @rustycherkas8229
    @rustycherkas8229 3 роки тому

    Kudos to the presentation, but... for a newbie like me there are some questions remain.
    The original string (used for demonstration only, I understand) is only 17 characters long, and chosen to show some recurring characters.
    The 'dictionary' for this message would contain 8 entries (1 byte each), and the 'paths' for each entry would fit into 8 bits (1 byte), so nothing is gained in this example... A much larger block of English text would benefit from the compression, obviously, but I wonder if protection is needed for long long branches on making Huffman trees?

  • @ahmadrezabolghad9811
    @ahmadrezabolghad9811 3 роки тому

    Thank you so much, this technique is very easy

  • @technoplus9877
    @technoplus9877 5 років тому

    You !!!! please(100X) i love you ....What amazing explanation.... THNKS

  • @Chipotle_is_the_loml
    @Chipotle_is_the_loml Рік тому

    So so good; thank you!

  • @manikantap7865
    @manikantap7865 2 роки тому

    Good explanation sir😊

  • @Saul-ju4zd
    @Saul-ju4zd 3 роки тому

    Great explanation, thanks.

  • @rootMySql
    @rootMySql 6 років тому

    I need it! Thanks for this video:)

  • @shattikbandyopadhyaa1787
    @shattikbandyopadhyaa1787 3 роки тому

    thank you! from Bangladesh

  • @carelceri4428
    @carelceri4428 3 роки тому

    Very clear. Thank you sir

  • @McMxxCiV
    @McMxxCiV Рік тому

    Doesn't the dictionary also need to be saved, with the letters in their original 8 bit form for a total of 64 and the codes adding up to 26, making compressed text + dictionary add up to 136 again?

  • @susybucket-le6vy
    @susybucket-le6vy 9 місяців тому

    great video

  • @kodagabriel
    @kodagabriel 6 років тому

    THE BEST!!

  • @rumishruu7394
    @rumishruu7394 5 років тому

    Thank you very u saved my life

  • @diegosanchez6704
    @diegosanchez6704 11 місяців тому

    Thank you!

  • @dionrl435
    @dionrl435 Рік тому

    2:29 how come u didn’t join pr4 and the one to the right of it?

  • @lajoskicsi6910
    @lajoskicsi6910 3 роки тому +1

    Does the mapping table also take place? The 46 bits probably do not contain it, right? How the receiver decodes it?

    • @tubero911
      @tubero911 День тому

      Correct, the storage of the conversion table (e.g. binary 00 => letter I) isn't included in the video. So that obviously increases the aggregate size.

  • @giacomobiancalana6949
    @giacomobiancalana6949 7 років тому

    I'm not so sure, but for this example, without the Huffman coding, you can represent the letters with only 3 bit (8 characters = 2^3), not 8. 3 is the number of bits with which you have to calculate the percentage. So 3 bits x 17 total characters = 51 . (46/51)*100= 90.2, so the saving is only about 10%. You can't say that you need 8 bit to trasmit/represent each character without the Huffman coding, because in this case you have to use them also with it, which is useless.

    • @luanbaviloni6714
      @luanbaviloni6714 7 років тому +2

      But Huffman Coding is used mostly for text compression, so if you consider that any character of ASCII table can be used in the uncompressed text, the length of 8 bits has to be considered.

  • @tzr6k
    @tzr6k 7 місяців тому

    thank you!

  • @bloopyikes7177
    @bloopyikes7177 4 роки тому

    how would the receiving computer or whatever know how to translate the message though? would the binary values for all of the characters be sent too?

  • @ade-joshe
    @ade-joshe 6 років тому

    Nice and precise

  • @jarrydpatel9650
    @jarrydpatel9650 5 років тому

    Great Video, Thank you..

  • @mixupthings
    @mixupthings 4 роки тому

    superb

  • @12bucukfalandim
    @12bucukfalandim 6 років тому +7

    adamsın corç :d

  • @ethanbai5712
    @ethanbai5712 6 років тому

    Great explanation. Thanks! One question: when building the tree, why did you choose to add PR4 and MVE_ instead of PR4 and S4? MVE_ and S4 have the same values of 4.

    • @harrymon0
      @harrymon0 4 роки тому +1

      He's sticking with prioritizing the rightmost available sums when all else is equal. Try doing it the alternate way you've just outlined. Do you notice the potential to lose efficiency?

  • @bono95zg
    @bono95zg 6 років тому

    And how do you reconstruct it? You have to save the table also but then for this example you didnt save space...

  • @klaragiceva8775
    @klaragiceva8775 5 років тому

    best explanation !!!!!!!!

  • @ndm99999
    @ndm99999 5 років тому

    please i need help , if there are a simple letter ,imagine it is 'm' what is value? is it equal to capital 'M' value ? or do we want to find it ?

  • @uchaopham9147
    @uchaopham9147 2 роки тому

    Did the huffman code provide the best solution? I mean in this example, can we use shorter unused bit for M, V..., like 10, 01 or 11, the total bits must be lower. Thank you for your explanation

    • @chromzepher
      @chromzepher 2 роки тому +2

      Doing that would result in situations where you could end up with ambiguous combinations. Take representing M as 10 like your example.
      If I receive a string of bits 10100100 it's impossible for the receiver to tell is that's mmsi (10 10 01 00) or mpp (10 100 100) as all the computer has is the limited dictionary we gave it and the string of bits.
      Using the full dictionary provided and assuming M was given a value of 10 instead of 1100. When we try to write out Mississippi we get 100001010001010010010000. When the receiver gets this text we can assume it organizes letter by checking the string number by number until it hits an invalid combination then it steps back one and puts a break there. As it runs through this string it will see 1 then 0 and think I know this is an M but if the next number is 0 it is also a P so it checks, finds a 0, then checks the next, finds another 0 but knows there's nothing for 1000 but there is something for 100 so it thinks the first letter is 100 and moves on. If we run it through without any context the computer will try to break it up as pirissippi (100 00 101 00 01 01 00 100 100 00)

  • @hyy3434
    @hyy3434 4 роки тому

    Thanks for great explanation!

  • @mostafaaly9331
    @mostafaaly9331 7 років тому

    good one .....keep it up
    thank u :)

  • @gauravburad7404
    @gauravburad7404 4 роки тому

    Thanks

  • @vaelkokach2941
    @vaelkokach2941 3 роки тому

    i think the calculation is wrong, lowest frequency should have the highest priority not the opposite

  • @TheCCBoi
    @TheCCBoi 7 років тому

    Great video, if I could give you two thumbs up I would. Thank you!

  • @helloyou191
    @helloyou191 6 років тому

    what software do you use for the dashboard ?

  • @tsepontimane4678
    @tsepontimane4678 7 років тому

    got it, thank you.

  • @22puru22
    @22puru22 7 років тому

    Best!!

  • @raymondfosu7821
    @raymondfosu7821 3 роки тому

    "I love you telecommunication and network"
    Can someone solve this using Huffman's tree and Huffman's code

  • @amirezasobhdel7013
    @amirezasobhdel7013 5 років тому

    can you explain how the receiver device understands the encoded message?

    • @leosmi1
      @leosmi1 5 років тому

      I have the same doubt

  • @mp3311
    @mp3311 5 років тому

    Sir, but this is wrong. 8 should switch with 9. The smaller number goes in the left child and the bigger in the right...

    • @vapula87
      @vapula87 4 роки тому

      It doesn't matter. The Huffman binary tree is correct if each parent's key is equal to the sum of its childrens' keys and all nodes with elements are leaf nodes.

  • @grmvishnu7893
    @grmvishnu7893 3 роки тому

    Can you share the code for this ? @Estudy

  • @amansyanbusiness
    @amansyanbusiness Рік тому

    You did a mistake it’s actually 43 bits

  • @surajrock299
    @surajrock299 4 роки тому

    Finally understand

  • @sabsab7504
    @sabsab7504 7 років тому

    if we have frequency 12,12,4,4 how result please help me

    • @bono95zg
      @bono95zg 6 років тому +2

      Combine 4 4, now ypu have 12,12,8. Then combine 12 and 8, now you have 12 20. An thn combine them and have 32

  • @latedeveloper7836
    @latedeveloper7836 4 роки тому

    5:17 Compression Ratio

  • @linconnuoppoa5s
    @linconnuoppoa5s Рік тому

    Why WE compress our language using our language when it IS to thé machine to compress it in its language . Why using A B C. .. when its simple tobuse 0 and 1

  • @getmymail4507
    @getmymail4507 4 роки тому

    best knowladge received

  • @poonjaga4191
    @poonjaga4191 4 роки тому +1

    So easly to understand

  • @nasrothepunisher5744
    @nasrothepunisher5744 Рік тому

    It's 16caractère not 17..you cant count the espace

  • @Symmetryful
    @Symmetryful 7 років тому

    Sorry this might be unrelated but why does ASCII representation use 8 bits? As far as I can see, if you need to represent {a,...,z,A,...,Z} in binary code, surely you just need to minimise n subject to 2^n >= 52 (which yields n = 6). Then you can represent each letter uniquely, 6 bits each. Why use 8 bits?

    • @Drakkenstien
      @Drakkenstien 7 років тому +2

      6 bits doesn't actually give us enough room to work with, because there's a large variation of characters that can't be handled by a mere 6 bytes, including numerals, mathematical symbols, newlines, spaces, tabs, null, end of file characters, and so on. In fact, 8 bytes generally isn't enough either to include all the characters we need either, which is why Unicode was developed.
      As to why 8 bits per byte, it's mostly because it's the first power of two that can store a sufficient number of data to be flexible, while being small enough to be able to work around.

  • @ganeshmantri191
    @ganeshmantri191 7 років тому

    R2 IS SUBSET OF V1

    • @giacomobiancalana6949
      @giacomobiancalana6949 7 років тому

      It is. In fact, for this coding, the only thing is don't be a prefix. Being a subset is ok.

    • @giacomobiancalana6949
      @giacomobiancalana6949 7 років тому

      Sorry for my English... I think that the actual sentence has to finish this way : "...is not to be a prefix".

  • @patrickschnurbusch8319
    @patrickschnurbusch8319 6 років тому

    i think you did it wrong, looking at my class notes 0 should be on the right and 1 on the left

    • @vapula87
      @vapula87 4 роки тому +1

      The number of edges is what is important, not whether you use 0 or 1 in a certain direction. It's the same number of bits.

  • @brookburnham8331
    @brookburnham8331 5 років тому

    grade 9 people watch this

  • @sadiahabib5506
    @sadiahabib5506 7 років тому

    I wonder who disliked

  • @ozairm036
    @ozairm036 3 роки тому +2

    Wrong calculation

  • @sonofzerihune5901
    @sonofzerihune5901 3 роки тому

    not visible at all, bad screen

  • @amit_go
    @amit_go 2 місяці тому

    gem