Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. How much different are they?

How much different are they?

Scheduled Pinned Locked Moved Algorithms
question
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ian Uy
    wrote on last edited by
    #1

    Good Day, Is there a mathematical formula/theory that can tell how much different (in numbers or percentage) two objects are? Say, I have 2 files, File A and File B, and the formula can tell how much are they different? Regards, Ian

    It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

    7 A 2 Replies Last reply
    0
    • I Ian Uy

      Good Day, Is there a mathematical formula/theory that can tell how much different (in numbers or percentage) two objects are? Say, I have 2 files, File A and File B, and the formula can tell how much are they different? Regards, Ian

      It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

      7 Offline
      7 Offline
      73Zeppelin
      wrote on last edited by
      #2

      You need some kind of metric by which to measure the difference. For example, length. Text files could differ by the number of different words if you are comparing an original file with a modified one. So you need to specify what, exactly, you imply by "differ".

      I 1 Reply Last reply
      0
      • I Ian Uy

        Good Day, Is there a mathematical formula/theory that can tell how much different (in numbers or percentage) two objects are? Say, I have 2 files, File A and File B, and the formula can tell how much are they different? Regards, Ian

        It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

        A Offline
        A Offline
        Alan Balkany
        wrote on last edited by
        #3

        This may help you: http://en.wikipedia.org/wiki/WinDiff[^]

        I 1 Reply Last reply
        0
        • 7 73Zeppelin

          You need some kind of metric by which to measure the difference. For example, length. Text files could differ by the number of different words if you are comparing an original file with a modified one. So you need to specify what, exactly, you imply by "differ".

          I Offline
          I Offline
          Ian Uy
          wrote on last edited by
          #4

          Well, I will be comparing binary data. A string of 1's and 0's.

          It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

          1 Reply Last reply
          0
          • A Alan Balkany

            This may help you: http://en.wikipedia.org/wiki/WinDiff[^]

            I Offline
            I Offline
            Ian Uy
            wrote on last edited by
            #5

            Thank you. But I would be comparing binary data. But this is somewhat along the line of what I need.

            It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

            L 1 Reply Last reply
            0
            • I Ian Uy

              Thank you. But I would be comparing binary data. But this is somewhat along the line of what I need.

              It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              You still have to define "different". Say file REF holds 99 bytes of data. File APPEND holds the same 99 bytes of data followed by one more byte. File PREFIX holds that same one byte followed by the original 99 bytes. Now these three files are different. How different are they? That is up to you. One would say APPEND is very similar to REF. One could argue PREFIX is completely different, or very similar. Take your pick. And some parsers would object to "very similar"; if REF represents a valid image (say something Image.FromFile understands), then APPEND is not likely to be a valid image (as per Image.FromFile). :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              Voting for dummies? No thanks. X|


              I 1 Reply Last reply
              0
              • L Luc Pattyn

                You still have to define "different". Say file REF holds 99 bytes of data. File APPEND holds the same 99 bytes of data followed by one more byte. File PREFIX holds that same one byte followed by the original 99 bytes. Now these three files are different. How different are they? That is up to you. One would say APPEND is very similar to REF. One could argue PREFIX is completely different, or very similar. Take your pick. And some parsers would object to "very similar"; if REF represents a valid image (say something Image.FromFile understands), then APPEND is not likely to be a valid image (as per Image.FromFile). :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                Voting for dummies? No thanks. X|


                I Offline
                I Offline
                Ian Uy
                wrote on last edited by
                #7

                I see. I thought there was a general formula to test for "difference".

                It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

                A 1 Reply Last reply
                0
                • I Ian Uy

                  I see. I thought there was a general formula to test for "difference".

                  It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.

                  A Offline
                  A Offline
                  Alan Balkany
                  wrote on last edited by
                  #8

                  It depends on what your goal is.

                  H 1 Reply Last reply
                  0
                  • A Alan Balkany

                    It depends on what your goal is.

                    H Offline
                    H Offline
                    hammerin hank
                    wrote on last edited by
                    #9

                    how about the binary correlation. sum of results where bits equal gives 1 and not equal gives -1 total divided by # bits in file should be useful.

                    A 1 Reply Last reply
                    0
                    • H hammerin hank

                      how about the binary correlation. sum of results where bits equal gives 1 and not equal gives -1 total divided by # bits in file should be useful.

                      A Offline
                      A Offline
                      Alan Balkany
                      wrote on last edited by
                      #10

                      As I said, it depends what your goal is. If this metric is useful for you, go for it.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups