g | x | w | all
Bytes Lang Time Link
034Raku Perl 6 rakudo240719T190541Zbb94
040Haskell + hgl240624T215634Zcorvus_1
045Haskell240624T230341Zcorvus_1
028MATLAB240625T101259ZWolfie
053R240624T072452ZRic
02505AB1E240624T102025ZKevin Cr
053JavaScript ES6240622T170914ZArnauld
006MATL240623T172553ZLuis Men
041Charcoal240623T123004ZNeil
063Octave240623T120556ZTom Carp
014Uiua SBCS240623T021452Zchunes
081Retina 0.8.2240623T002856ZNeil
133Python 3.8 prerelease240622T184410Zsquarero
011Jelly240622T172800ZJonathan

Raku (Perl 6) (rakudo), 50 34 bytes

Takes a list of Rational numbers.

{(@$_ X==@$_).rotor($_)>>.sum.max}

Attempt This Online!

Haskell + hgl, 56 40 bytes

-16 bytes thanks to Wheat Wizard

xMl<bg<fl(jn eq)<m(gk$(/)<ν<*ʃ"/"*^ν)

Attempt This Online!

Semi-ungolfed:

parseFraction = gk $ (/) < ν <* ʃ"/" *^ ν
f = lengthOfLargest < toBag < filter (join (==)) < map parseFraction

Haskell, 53 45 bytes

xM cnT<(wx<l*^jn eqo<m(gk$(/)<ν<*ʃ"/"*^ν))

Attempt This Online!

Using the approach of Luis' MATL answer. Semi-ungolfed Pseudocode:

parseFraction = gk $ (/) < ν <* ʃ"/" <*> read

-- elementwise equality
eqo :: Eq a => [a] -> [a] -> [Bool]
eqo = liftA2 (==)

f = maxBy count < splitAt length < (join eqo < m parseFraction)

MATLAB, 28 bytes

x=num2str(x);max(sum(x==x'))

How it works

The question doesn't (currently) stipulate the input must be a string, if the input were an array of values [1/3,4/12,2/14,...] then the num2str isn't needed and this drops to 15 bytes.

R, 53 bytes (as a script)

max(0,table(sapply(parse(,,commandArgs()[-1]),eval)))

Explanation

max(                              # max between 0 and contingency table (can be -inf)
  0,                              # by default max return -Inf if all Nan so a 0 corrects this
  table(                          # contingency table of number of occurences
    sapply(                       # map te expression list to eval
      parse(                      # parse input as an expression() list
        ,,commandArgs()[-1]),     # input args
      eval)))                     # eval evaluates the fraction to double

Extra:

If you accept a function then the code is 41 bytes long. In this case the input is a semicolon-separated string.

Try it!

\(x)max(0,table(sapply(parse(,,x),eval)))

05AB1E, 25 bytes

…0/0Kε'/¡`©_i.±«ë®/]{γéθg

Input as a list of strings.

Try it online or verify all test cases.

Explanation:

Unfortunately, dividing by 0 in 05AB1E or 05AB1E (legacy) acts as a no-op, so will result in the nominator itself when done manually or the string itself when using evals (in Elixir, Python or Batch), instead of the for this challenge preferred -INF/NaN/INF. So instead, things have to be done manually..

…0/0K       # Remove any "0/0" items from the (implicit) input-list
ε           # Map over the remaining fractions:
 '/¡       '#  Split it on "/"
    `       #  Pop and push the values of the pair to the stack
     ©      #  Store the top value (the denominator) in variable `®` (without popping)
      _i    #  Pop and if this is 0:
        .±  #   Get the sign of the nominator (-1 if <0; 0 if 0; 1 if >0)
          « #   Append that to each value in the (implicit) input-list
       ë    #  Else (we're not dividing by 0):
        ®/  #   Simply divide the nominator by the denominator `®`
]           # Close both the if-else statement and map
 {          # Sort the mapped values
  γ         # Split it into equal adjacent groups
   é        # Sort these groups by length
    θ       # Pop and keep the last/longest group
     g      # Pop and push its length

Some minor equal-bytes alternatives:

PS: {γéθg cannot be D.M¢ (Duplicate [D] the list; pop and push the most frequent item [.M]; get the count of that in the list ¢) to save a byte, because it won't work correctly with inner lists (caused by the «). And although the « could alternatively be for +1 byte, then D.M¢ would still incorrectly result in [] if the input only contains "0/0" items.

JavaScript (ES6), 53 bytes

Expects an array of strings such as ["1/3","4/12","2/14",...].

a=>Math.max(...a.map(o=x=>o[x=eval(x)]=x==x&&-~o[x]))

Try it online!

Commented

a =>              // a[] = input array
Math.max(         // return the maximum value:
  ...a.map(o =    //   o = object to keep track of counters
    x =>          //   for each value x in a[]:
    o[            //     update o[x]
      x = eval(x) //     where x is first eval()'uated
    ] =           //     to:
      x == x &&   //       false if x is NaN
      -~o[x]      //       or o[x] + 1 otherwise
  )               //   end of map()
)                 // end of Math.max()

Without eval(), 54 bytes

Takes an array of [numerator, denominator] pairs.

a=>Math.max(...a.map(o=([x,y])=>o[x/=y]=x==x&&-~o[x]))

Try it online!

MATL, 6 bytes

U&=sX>

Try it online! Or verify all test cases.

How it works

U    % Implicit input. Convert to numerical vector
&=   % Matrix of pair-wise equality comparisons
s    % Sum of each column
X>   % Maximum. Implicit display

Charcoal, 41 bytes

≔EE⪪S,⮌I⪪ι/×⊟ι⎇Σι∕¹Σι≕math.infθI⌈EθΣEθ⁼ιλ

Try it online! Link is to verbose version of code. Explanation:

≔EE⪪S,⮌I⪪ι/×⊟ι⎇Σι∕¹Σι≕math.infθ

Convert the fractions into floating-point values but using -inf, nan or inf as appropriate.

I⌈EθΣEθ⁼ιλ

Take the Cartesian product of the list with itself, compare each pair of elements, take sums, and output the maximum.

Octave, 63 bytes

Anonymous function which takes a row vector of fractions as its input.

@(x)max([sum([y=isinf(x)&x>0;y&x<0]'),~isnan([c,f]=mode(x))*f])

Try it online!

That started off nice and short, and then ballooned!

It is based around the mode function to calculate the frequency of elements.

Annoyingly Octave's mode function seems to have a bug in it whereby it doesn't treat inf as being equal to inf. So [~,f]=mode([inf inf inf]) returns 1. This differes from MATLAB proper which returns 3 for the same thing. As a result we have to do a lot of extra work to count the number of positive and negative infinities.

@(x)
    max([                     % The largest count overall.
         sum([                % Row-wise sum the infinity checks to get counts of negative and positive infinities.
              y=isinf(x)&x>0; % Check for positive infinities (logical array)
              y&x<0           % Check for negative infinities (logical array)
             ]'),
         ~isnan(              % Check if the most common element is NaN (only true if all NaN)
                [c,f]=mode(x) % Find the most common element and how many of it there are.
               )*f            % 0 if all NaN, or element count otherwise
        ])

Without this mode bug, it would be 27 characters:

@(x)~isnan([c,f]=mode(x))*f

Uiua SBCS, 14 bytes

/↥⊂0⊕⧻⊛.▽≠NaN.

Try it!

/↥⊂0⊕⧻⊛.▽≠NaN.­⁡​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­
        ▽≠NaN.  # ‎⁡remove NaNs (0/0s only)
    ⊕⧻⊛.        # ‎⁢group by length of each value
  ⊂0            # ‎⁣prepend zero so max of empty list is zero instead of ¯∞
/↥              # ‎⁤maximum

Retina 0.8.2, 81 bytes

\d+
$*
G`1
+r`(1*)(\3)*\b/(1+)\b
$#2,$3/$1
1+/
;
O`
m`^(.+)(¶\1)*$
1$#2$*
O^`
\G1

Try it online! Takes input on separate lines but link is to test suite that splits on commas for convenience. Explanation:

\d+
$*

Convert to unary.

G`1

Remove 0/0 entries.

+r`(1*)(\3)*\b/(1+)\b
$#2,$3/$1

Convert the remaining entries to continued fractions.

1+/
;

Remove the trailing n/0 remnant.

O`

Sort the continued fractions.

m`^(.+)(¶\1)*$
1$#2$*

Count how many there are of each, in unary.

O^`

Sort descending.

\G1

Convert the largest to decimal, but if there were only 0/0 fractions, then there is nothing left at this point, so we get a final result of 0.

Python 3.8 (pre-release),  134  133 bytes

-1 byte: if i[-2:]>'/0'elseif'/0'<i[-2:]else.

lambda*x:(s:=[eval(i)if'/0'<i[-2:]else'n+-'[round((n:=eval(i[:-2]))/(abs(n)+.1))]for i in x])and max([(j!='n')*s.count(j)for j in s])

Takes input like f('-1/5', '-2/10', '0/0', '0/0', '0/0').
Try it online!

Explanation

lambda*x:                                                                                                                               # Defines lambda
         (s:=[                                                                             ])                                           # Walrus operator
              eval(i)                                                                                                                   # Evaluates fraction...
                     if'/0'<i[-2:]                                                                                                      # ...if the denominator isn't 0
                                  else'n+-'[                                    ]                                                       # Otherwise, choose one of 3 characters
                                            round((n:=eval(i[:-2]))/(abs(n)+.1))                                                        # chosen by the sign of the numerator
                                                                                 for i in x                                             # Do this for each of the 5 arguments
                                                                                             and                                        # Ignores first argument since it's truthy
                                                                                                               s.count(j)               # Count number of times each item appears
                                                                                                      (j!='n')*                         # ...if it isn't 0/0 --> 'n'
                                                                                                     [                   for j in s]    # Do this for each item in s
                                                                                                 max(                               )   # Finds the largest count

Jelly, 11 bytes

⁾/÷yⱮV⁼þ`SṀ

A monadic Link that accepts the list of strings and yields the count.

Try it online!

How?

⁾/÷yⱮV⁼þ`SṀ - Link: list of lists of characters A
⁾/÷         - list of characters -> "/÷"
    Ɱ       - map across A with:
   y        -   translate (replace '/' with '÷')
     V      - evaluate as Jelly code
        `   - use that as both arguments of:
       þ    -   table of:
      ⁼     -     equal?
         S  - sum (columns)
          Ṁ - maximum