Tag Info

Rook Polynomials

JavaScript (ES6), 31 bytes Expects (m)(n)(k). m=>n=>g=k=>k?m--*n--/k*g(--k):1 Try it online! How? Like other answers, ...
• 193k

The smallest area of a convex grid polygon

Python, n=44 in under 2 minutes This can go up to 44-gons in under 2 minutes, using pypy on my laptop. CPython is slightly slower (2'45''). The approach is rigorous. It uses the dynamic programming ...
• 101

Rook Polynomials

Python, 63 50 bytes lambda m,n,k:comb(m,k)*perm(n,k) from math import* Attempt This Online! To place $k$ rooks on an $m\times n$ chessboard, we choose $k$ ...
• 7,281

Counting universal n-ary logic gates

Python, 1648 bytes ...
• 3,301

Rook Polynomials

Thunno 2, 5 bytes cṭsƇ× Try it online! Port of xigoi's Python answer. Takes k, then m, then ...
• 18.1k

Rook Polynomials

Python, 41 bytes f=lambda m,n,k:k<1or f(m-1,n-1,k-1)*m*n/k Try it online! Based on the formula in Arnauld's answer . Test cases from xigoi. Outputs ...
• 145k

Rook Polynomials

Julia 1.0, 39 33 bytes f(k,m,n)=k<1||m*f(k-1,m-1,n-1)n/k Try it online! -6 bytes and test cases due to @MarcMush Similar in spirit to @The Thonnu 's answer. ...
• 161

Counting rankings

Python 3, 93 84 77 bytes -9 bytes thanks to @xnor! Going for the brownie points, but still exponential runtime ;) ...
• 59.5k

Expected number of rounds for this labeling scheme

05AB1E, 13 10 bytes -3 thanks to @alphalpha Ýsc¤/<z¹F¥ Attempt This Online! Uses a variant of the first method. Ports this Jelly answer for the binomial ...
• 10.6k

Avoiding Loops!

Charcoal, 97 93 bytes ≔⟦⊞ＯＡ¹⟧θＦθ«≔⊟ιη≔⟦⟧ζＦＬιＦΦκ⁻§ιλ§ικ⊞ζ⟦λκ⟧¿ζＦΦζ↨÷κ²±¹⊞θ⊞ＯＥΦι⁻÷μ²÷⌈κ²⎇⁼μ⌊κ§ι⁻｜⌈κ¹＆⌈κ¹λ∕ηＬζ⊞υη»Ｉ↨υ¹ Try it online! Link is to verbose version of ...
• 172k

Avoiding Loops!

Python, 146 142 bytes f=lambda x,*_:sum(s:=[(n!=m)*f(y:=[(c,o-n or m-n)for c,o in x],*map(y.remove,[(a,m-n),(b,m-n)]))for a,n in x for b,m in x if a-b]or[1])/len(s) ...
• 12.3k

Avoiding Loops!

JavaScript (ES6), 138 bytes -11 thanks to Mukundan314 Expects an array of laces, where each lace is a pair of integers representing its ends (e.g. [0,0]). ...
• 193k

Rook Polynomials

R*, 37 35 bytes f=\(l)prod(if(l)c(f(l-1)/l[1]^2,l)) Attempt This Online!* or Try it Online using function instead of the ...

Rook Polynomials

Jelly, 5 bytes !;c@P Attempt This Online! Takes arguments in the form k [m,n]. I didn't manage to come up with anything shorter,...
• 7,281

Rook Polynomials

C (gcc), 37 bytes f(m,n,k){m=k?m--*n--*f(m,n,k-1)/k:1;} Try it online! My first C answer (yay!) Port of Arnauld's JavaScript answer. Fixed thanks to @mousetail
• 18.1k

Rook Polynomials

Desmos, 25 bytes f(m,n,k)=nCr(n,k)nPr(m,k) Try It On Desmos! Takes in $m,n,k$ as input. Port of like most of the answers here.
• 13.6k

Expected number of rounds for this labeling scheme

Tried all three methods, with some minor changes to each for golfiness. In order: Wolfram Language (Mathematica), 52 bytes ...
• 20.7k

Expected number of rounds for this labeling scheme

Charcoal, 48 42 bytes ＮθＮηＩΣＥθ∕Π⁺±⊕…ιθ⁻θ…⁰η×Π…·¹⁻θι⁻Π⁻ι…⁰ηΠ⁻θ…⁰η Attempt This Online! Link is to verbose version of code. Explanation: Implements a modification of ...
• 172k

Robinson Schensted correspondence

Charcoal, 66 bytes ≔Ｅθ⟦⟧ηＦθ«≔⁰ζＷΦ§ηζ›λι«§≔§ηζ⌕§ηζ⌊κι≔⌊κι≦⊕ζ»⊞§ηζι⊞υζ»Ｅ⟦η⊕Ｅθ⌕Ａυκ⟧⭆¹Φιν Try it online! Link is to verbose version of code. Explanation: ...
• 172k

Robinson Schensted correspondence

JavaScript (ES12), 124 bytes Returns [P, Q]. ...
• 193k

Counting rankings

Python 3, 124 119 117 bytes -5 bytes thanks to enzo. ...
• 17.2k

Counting rankings

APL(Dyalog Unicode), 58 57 bytes SBCS {⍵÷⍨⍺(⊣{n×⍵÷1⌈(⌽-⍺∘=)⍳n←≢⍵}¯1↓⊢/⍤⊢+⊢×(≠∨=∘⍳)∘≢)⍣⍵⊢0,⍨⍵⍴1} Try it on APLgolf! A dynamic programming adaption of my recursive ...
• 59.5k

Implement the hyperfactorial

BLC, 8 bytes (61 bit) 0000010101110000001011010011100000010111101100111010001100010 Works for Church encoded numerals with 1=i. ...

Rook Polynomials

05AB1E, 5 bytes cI¹e* Inputs in the order $k,m,n$. Try it online or verify all test cases. Or alternatively: c¹!ªP Inputs in ...
• 128k

Expected number of rounds for this labeling scheme

JavaScript (Node.js), 81 bytes n=>g=(k,j=n,c=(a,b=k)=>!b||c(a,--b)*(a-b)/~b)=>j&&c(n,j)/(c(n-j)/c(n)-1)+g(k,j-1) Try it online! Method 1 -5 bytes ...
• 24.5k

Expected number of rounds for this labeling scheme

Nekomata, 13 bytes →r$ÇƆ/←ŗ0ɔ$ᵑ∆ Attempt This Online! A port of @Command Master's 05AB1E answer. Unfortunately, Nekomata doesn't have ...
• 48.6k

Expected number of rounds for this labeling scheme

R, 53 bytes \(n,k,i=1:n-1)sum((^=choose)(-i-1,n-i)/(i^k/n^k-1)) Attempt This Online! Last few test cases produce incorrect results due to numeric overflow.
• 13.9k

Robinson Schensted correspondence

R, 115 bytes \(x){P=Q=!x%o%x;for(i in x){r=1;while(i<-P[r,w<-which.min(P[r,]%in%1:i)]-!(P[r,w]=i))r=r+1;Q[r,w]=F=F+1};list(P,Q)} Attempt This Online! For an ...
• 13.9k