Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34325

Re: Mathematics, Java, good enough

From Duncan Idaho <duncan@dunenoemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Mathematics, Java, good enough
Date 2016-05-17 18:10 +0100
Organization A noiseless patient Spider
Message-ID <nhfj31$509$1@dont-email.me> (permalink)
References (2 earlier) <nhf2l1$6dn$1@dont-email.me> <nhf7kk$o1p$1@dont-email.me> <768508de-3c08-4d46-8c68-8a5f8b7db533@googlegroups.com> <ff57f7e8-2d3a-4fb0-a9fe-763965a76af3@googlegroups.com> <nhfbce$6ii$1@dont-email.me>

Show all headers | View raw


On 17/05/16 15:58, Eric Sosman wrote:
> On 5/17/2016 10:29 AM, FredK wrote:
>> On Tuesday, May 17, 2016 at 7:17:23 AM UTC-7, FredK wrote:
>>> The question arises whether you really want to know how many distinguishable strinmgs there are, which is much smaller if the
>>> original set contains duplicate entries.
>> For example, if the set it "AAB" there are only 3 distinguishable strings of length 2: AA, AB, and BA
>
>      What happened to "BB"?  I think you're writing about a
> situation that doesn't match the O.P.'s question.
>
>      The O.P. wrote that he had a "set of characters," and went
> on to mention its "cardinality" -- from this, I understood him
> to mean that he actually had a "set."

This is correct. I was using the word 'set' to mean (mathematically)
a collection of well defined and distinct objects (NOT java.util.Collection interface of course :-)

Cardinality as in 'the cardinality of a finite set'

as opposed to the cardinality of an infinite set which I believe to be a mathematical principle
that makes as much sense to me as the idea that time existed before there was anyone to measure it.

I mean the cardinality of an infinite set is infinite isn't it ... jeez, math has always made my head spin

Glad we got it sorted out though. c.l.j.p really is a 'resource' isn't it.

{A A B} is not a set.
> (It's a multiset, yes, but not a set.)
>
>      import java.util.HashSet;
>      public class TryMe {
>          public static void main(String[] unused) {
>              HashSet<Character> set = new HashSet<>();
>              set.add('A');
>              set.add('A');
>              set.add('B');
>              System.out.println(set.size());
>          }
>      }
>
> If the output is "3", your Java is broken.  ;)
>


-- 
Duncan Idaho
!(ghola mentat)

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Mathematics, Java, good enough Duncan Idaho <duncan@dunenoemail.com> - 2016-05-17 11:49 +0100
  Re: Mathematics, Java, good enough Eric Douglas <e.d.programmer@gmail.com> - 2016-05-17 04:55 -0700
  Re: Mathematics, Java, good enough Nigel Wade <nmw@ion.le.ac.uk> - 2016-05-17 12:56 +0100
    Re: Mathematics, Java, good enough Nigel Wade <nmw@ion.le.ac.uk> - 2016-05-17 13:06 +0100
    Re: Mathematics, Java, good enough Duncan Idaho <duncan@dunenoemail.com> - 2016-05-17 13:29 +0100
      Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 09:54 -0400
        Re: Mathematics, Java, good enough FredK <fred.l.kleinschmidt@gmail.com> - 2016-05-17 07:17 -0700
          Re: Mathematics, Java, good enough FredK <fred.l.kleinschmidt@gmail.com> - 2016-05-17 07:29 -0700
            Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 10:58 -0400
              Re: Mathematics, Java, good enough Duncan Idaho <duncan@dunenoemail.com> - 2016-05-17 18:10 +0100
                Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 14:02 -0400
                Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 14:10 -0400
                Re: Mathematics, Java, good enough Eric Douglas <e.d.programmer@gmail.com> - 2016-05-17 11:36 -0700
                Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 16:12 -0400
                Re: Mathematics, Java, good enough Eric Douglas <e.d.programmer@gmail.com> - 2016-05-17 13:56 -0700
                Re: Mathematics, Java, good enough Gene Wirchenko <genew@telus.net> - 2016-05-17 14:13 -0700
                Re: Mathematics, Java, good enough Duncan Idaho <duncan@dunenoemail.com> - 2016-05-18 05:06 +0100
  Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 08:25 -0400
  Re: Mathematics, Java, good enough Martin Gregorie <martin@address-in-sig.invalid> - 2016-05-17 12:24 +0000
  Re: Mathematics, Java, good enough Duncan Idaho <duncan@dunenoemail.com> - 2016-05-17 18:15 +0100
    Re: Mathematics, Java, good enough Jerry Stuckle <jstucklex@attglobal.net> - 2016-05-17 13:33 -0400
    Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 14:09 -0400
      Re: Mathematics, Java, good enough Gene Wirchenko <genew@telus.net> - 2016-05-17 14:17 -0700
        Re: Mathematics, Java, good enough Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-17 17:49 -0400

csiph-web