text:
Mutate my DNA sequence
When translating DNA into proteins, the ribosomes read the sequence of DNA nucleotides 3 by 3. Each set of 3 nucleotides is called a codon, and each codon encodes for an amino acid, with some redundancies. Here's the conversion table used by most organisms (table is read left, top, right):

Humans and most other organisms use just a single amino acid as a "start" codon: Methionine, a.k.a. Met, M, or ATG. This means that any DNA sequence coding for a protein starts with ATG, which will be recognised by the translation machinery.
However, three different codons are used to stop the translation: TAA, TAG and TGA. If the replication machinery encounters any of these, it will stop, and the translated protein will be released into the cell.
Therefore, one of the most dangerous mutations that can occur is one that will cause an early termination of protein translation. For example, if we take this DNA sequence:
ATGGCCTTCATATCGGCGGACAGCGAATCTGGTGATTAA
Split into codons:
ATG GCC TTC ATA TCG GCG GAC AGC GAA TCT GGT GAT TAA
Once translated, will give:
met ala phe ile ser ala asp ser glu ser gly asp STOP
But if we replace C at 14th position into an A, then the protein sequence will be
met ala phe ile STOP
This substitution would be written in genomics as 14C>A.
I could also perform other substitutions (25G>T for example) that would cause early termination, but 14C>A is the first one in the sequence, and so would produce the shortest protein after translation.
Challenge
Given a string of nucleotides coding for a protein (first codon is ATG, last is a STOP), find the first substitution that would cause an early termination of protein translation, resulting in the shortest possible protein. This is code golf, so fewest bytes wins!
Rules and specifications
(these will be updated if anyone asks relevant questions about what's allowed)

DNA sequence is stored in a character string as consecutive block capitals, no spaces or punctuation in it, and contains only ACGT. If you want to store it into binary (A:00/C:01/G:10/T:11) or as integers (A:1/C:2/G:3/T:4), that's fine (you don't need to follow these encodings).

Declaration of the codon to amino acid conversion table is part of the golfing challenge. You must choose which parts you deem relevant. Most softwares use hashes / dictionaries to store it.

Code should return the substitution formatted under the preferred nomenclature: 14C>A (position, original nucleotide, ">", new nucleotide), but any format that includes those three elements is accepted.

If there are no possible early termination sites, function should return any easily recognisable error value (raise an error, FALSE, -1, etc) or return nothing.

Test cases
ATGCACTGTTGGGGAGGCAGCTGTAACTCAAAGCCTTAG
-> 9T>A

ATGGTAGAACGGAGCAGCTGGTCATGTGTGGGCCCACCGGCCCCAGGCTCCTGTCTCCCCCCAGGTGTGTGGTCATGCCAGGCATGCCCTTAG
-> 7G>T

ATGGAACATCAATCTCAGGCACCTGGCCCAGGTCATTAA
-> 4G>T

ATGTGCCAAGTGCATTCTTGTGTGCTTGCATCTCATGGAACGCCATTTCCCCAGACATCCCTGTGGCTGGCTCCTGATGCCCGAGGCCCATGA
-> 6C>A

ATGCTTTTCCATGTTCTTTGGCCGCAGCAAGGCCGCTCTCACTGCAAAGTTAACTCTGATGCGTGA
-> 20G>A

ATGGTAGAGTAA
-> 7G>T

ATGGTTCCACGGTAA
-> ERROR

05AB1E, 29 27 bytes
vNU4E¨NXǝ3ô•`|Ž•₅вåàiX>yN)q

Input as 2341 for ACGT respectively.
Output in the format and order [position, original nucleotide, new nucleotide]. Will output the input itself if there are no possible early termination sites. (Could be 1 byte less by removing the > if 0-based positions were allowed.)
Try it online or verify all test cases or verify all test cases with a conversion back to ACGT.
Explanation:
v             # Loop over each of the digits of the (implicit) input-string
 NU           #  Store the current loop-index in variable `X`
   4E         #  Inner loop in the range [1,4]:
     ¨        #   Remove the last digit of the (implicit) input-string
              #   (this is to ensure it doesn't find the trailing STOP all inputs will have)
      NXǝ     #   Insert the current digit of the inner loop at position `X` in the string
         3ô   #   Split the string into parts of size 3
   •`|Ž•      #   Push compressed integer 7964812
        ₅     #   Push builtin integer 255
         в    #   Convert the larger integer to base-255 as list: [122,124,142]
   å          #   Check for each of these three values if it's in the list
    ài        #   If any is truthy:
      X       #    Push the current index of the outer loop we stored in `X`
       >      #    And increase it by 1 to make the 0-based index 1-based
        y     #    Push the current digit of the outer loop
         N    #    Push the current digit of the inner loop
          )   #    Wrap all three values into a list
           q  #    And terminate the program
              #    (after which this list is output implicitly as result)
              # (and if no value is found after the nested loop,
              #  output the (implicit) input as output implicitly instead)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •`|Ž• is 7964812 and •`|Ž•₅в is [122,124,142].

JavaScript (ES6),  124 ... 93  92 bytes
Output format: XiY, with X = original nucleotide, i = position, Y = new nucleotide.
s=>s[i=([,,x,y]=s.match(/(.A[AG]|.GA|T(.[AG]|(A|G).))(...)*$/)).index+!!x+!!y]+-~i+'AT'[+!x]

Try it online!
Regular expression
r = /(.A[AG]|.GA|T(.[AG]|(A|G).))(...)*$/
     (          |               )           // 1st capturing group
      .A[AG]|.GA                            // match ★AA, ★AG or ★GA
                 T(.[AG]|(A|G).)            // 'T' + 2nd & 3rd capturing groups:
                                            // match T★A, T★G, TA★ or TG★
                                 (...)*$    // make sure that the number of trailing
                                            // nucleotides is a multiple of 3

To summarize, this will match 21 codons that can be mutated to generate a STOP. By testing the 2nd and 3rd capturing groups, we can classify them into 3 categories describing the position of the nucleotide that needs to be altered.
 2nd group | 3rd group | position | matching codons
-----------+-----------+----------+-------------------------------------------------------
  not set  |  not set  |    1st   | (TAA) (TAG) (TGA) CAA CAG CGA AAA AAG AGA GAA GAG GGA
    set    |  not set  |    2nd   | TTA TTG TCA TCG TGG
    set    |    set    |    3rd   | TAT TAC TGT TGC

Commented
s =>               // s = input DNA sequence
  s[               // append the original nucleotide ...
    i =            //   ... which is at position i (0-based)
    ( [,, x, y] =  //   x = 2nd capturing group, y = 3rd capturing group
        s.match(r) //   apply the regular expression to s
    ).index        //   get the position of the matching codon
    + !!x + !!y    //   add 2 if x and y are set, 1 if only x is set, 0 if x is not set
  ]                //
  + -~i            // append the 1-indexed position
  + 'AT'[+!x]      // append the new nucleotide: 'T' if x is not set, 'A' otherwise

Perl 5, 73 72 bytes
-1 byte using anchor at the end instead of the start

/(?|(.)(A[AG]|GA)|T(.)[AG]|T[AG](.))(...)*$/;$_="$+[1]$1>".($-[1]%3?A:T)

TIO
/^(...)*?(?|(.)(A[AG]|GA)|T(.)[AG]|T[AG](.))/;$_="$+[2]$2>".($-[2]%3?A:T)

Try it online!

Jelly, 30 bytes
os3ḅ4f“EGM‘Ḋ
JṬ€×Ɱ4ZẎçƇ⁸ḢĖżW€Ṁ

A monadic Link accepting a list of integers (in [1,2,3,4] mapping to ACGT respectively) which yields a list of lists of integers, [[position, new nucleotide], original nucleotide].
(A valid sequence with start, and stop but no possible substitution that would cause early termination will output [[4]])
Try it online!
...Or see this version which performs both a translation from the ACGT input format, and a translation to the {position}{original nucleotide}>{new nucleotide} output format.
How?
os3ḅ4f“EGM‘Ḋ      - helper Link: [0,...,0,new nucleotide], N; DNA integer list, A
o                 - (N) logical OR (A) (vectorises)
 s3               - split into chunks of three
   ḅ4             - convert from base four to integer
      “EGM‘       - code-page index list = [69,71,77]
     f            - filter keep (i.e. only keep stops)
           Ḋ      - dequeue (so if only a single stop was found and hence no early
                             stops we'll have an empty list which is falsey)

JṬ€×Ɱ4ZẎçƇ⁸ḢĖżW€Ṁ - Main Link: DNA integer list, A
J                 - range of length (of A) -> [1,2,...]
 Ṭ€               - untruth each -> [[1],[0,1],[0,0,1],...]
   ×Ɱ4            - map across [1,2,3,4[ performing multiplication
      Z           - transpose
       Ẏ          - tighten -> [[1],[2],[3],[4],[0,1],[0,2],[0,3],[0,4],[0,0,1],...]
                  - (call that X)
          ⁸       - use chain's left argument, A, as the right argument
         Ƈ        - filter keep those (x in X) for which this is truthy:
        ç         -   call the helper link as a dyad f(x, A)
           Ḣ      - head (which will be the shortest)
            Ė     - enumerate (that)
              W€  - wrap each (integer a in A) in a list
             ż    - zip left and right together
                Ṁ - get the maximum

@Jitse that is an invalid input since every input is guaranteed to end in a stop signal - "Given a string of nucleotides coding for a protein (first codon is ATG, last is a STOP)"

This seems to be the best score for this challenge! Should I accept it as answer to "declare" the winner?

I'd personally leave off a green tick in a golfing challenge like this for at least a week. I wouldn't be surprised if this were beatable too.

Python 3, 88 bytes
f=lambda i,j,k,*l,n=1:(j+k<4)*(n,i,5)+(i-k>2)*(n+1,j,1)or(i-j>2)*(n+2,k,1)or f(*l,n=n+3)

Try it online!
Solution without regex. Uses 1235 for AGCT, respectively. Takes each base as a separate argument. Will suggest A for any instance of T*A, T*G, TA*, TG*. Outputs as (position, original base, new base). Returns an (invalid) 6-element tuple when there is no early termination site.
Explanation
f=lambda i,j,k,*l,n=1:
  (j+k<4)         # If the last two bases are 1+1 (AA), 1+2 (AG) or 2+1 (AG)
    *(n,i,5)      #   Return (position, 1st base, 5 (T))
  +(i-k>2)        # If the 1st base is 5 (T) and the 3rd base 1 (A) or 2 (G)
    *(n+1,j,1)    #   Return (position, 2nd base, 1 (A))
  or(i-j>2)       # If the 1st base is 5 (T) and the 2nd base 1 (A) or 2 (G)
    *(n+2,k,1)    #   Return (position, 3rd base, 1 (A))
  or f(*l,n=n+3)  # Else process the next three bases

C# (Visual C# Interactive Compiler), 138 bytes
x=>{for(int i=0;;i++)foreach(var k in"AGT")if("TAG TAA TGA".Contains(x.Remove(i,1).Insert(i,k+"").Substring(i-i%3,3)))return(i+1,x[i],k);}

Try it online!

Python 2, 138 133 144 142 bytes
f=lambda s,i=0:next((`i-~j`+s[j]+'TAA'[j]for j in[0,1,2]if re.match('.TTA.[[[AAAGGG]]].'[j::3]+'|.GA',s[:3])),s[6:]and f(s[3:],i+3))
import re

Try it online!
Returns nXY instead of nX>Y, or the empty string if there is no valid substitution.

@ChasBrown FYI the input above is an invalid input, no need to address that :)

K (oK), 91 bytes
{,/(1+t),(x@t:(&u)+3*-3!p),(u:r@p)#'t@3!p:*&1=+/'r:0N 3#,//~(t:3 3#"TAATAGTGA")=\:/:0N 3#x}

Try it online!
I'm sure my solution can be significally golfed (I used too many named varialbes)

@ngn Looking forward to your sub 40 solution :)

your solution doesn't handle the "error" case in the last test. ignoring that, here are a few improvements

i couldn't quite get to 40 :|

@ngn Great, as always! About the error handling - I don't remember if it was stated at the time I was solving the problem.

Brainf***, 696 624 397 Bytes
>>>>>>,,,++>>>+[-<<,<<+<<+<<+>,>>,>>>[>+<<<<<<<<+>>>>>>>-]>[-<+>]<<<<<<<<-[-[-[->->-[-[-[->->[-]>->+++>>>+<<<<<]>[->-[-[[-]>->+++>>+<<<<<]]>[->+>->+<<<]]<]>[->-[-[-[->->++>>+<<<<]>[->++>->+<<<]<]>[->+>-->+<<<]<]>[-]]<]>[->-[-[-[->->++>>+<<<<]>[->++>->+<<<]<]]>[-]]<]]]>[->-[-[>->[-]>->+++>>>+<<<<<]>[->-[[-]>->+++>>>+<<<<<]>[->>>++++<<<]]<]>[->-[-[[-]>->+++>>>+<<<<<]]>[->>>++++<<<]]]>>>>]<<<.>.>.

Uses the actual bytes 1, 2, 3, 4 to code for A, G, C, T respectively and outputs the position as a byte as well, so you only get the position modulo 256. Outputs position + two zero bytes if there is no possible mutation.
Try it online!
How?
# X 1 Y 1 Z 1 C L L F
>>>>>>,,, #first codon is always ATG
++>>>+[
    - #zero exit flag
    <<,<<+<<+<<+> #input X into L1 for a trick later|set switch flags|seek to Y
    ,>>, #memory is now 0 1 Y 1 Z 1 4 X 0 0
    >>>[>+<<<<<<<<+>>>>>>>-]>[-<+>] #copy L1 onto cell0
            #memory is now X 1 Y 1 Z 1 4 X 0 0
    <<<<<<<< #begin switch on X
    -[-[-[-

    #case T:
        >- > #begin switch on Y
        -[-[-[-
        #case TT:
            >->[-]>->+++>>>+<<<<<] #TT not possible|zero out switch flags|inc exit flag|increase counter
        #case TC:
            >[- > #switch Z
            -[-[[-]>->+++>>+<<<<<] #cases TCT TCC not possible
             ] #TCG ~ TAG (fall through)
            >[- >+>->+<<<] #TCA ~ TAA
            ]<]
        #case TG:
            >[- >
            -[-[-[-
            >->++>>+<<<<] #TGT ~ TGA
            >[- >++>->+<<<]<] #TGC ~ TGA
            >[- >+>-->+<<<]<] #TGG ~ TAG
            >[-] #TGA is correct STOP
            ]<]
        #case TA:
            >[- >
            -[-[-[-
            >->++>>+<<<<] #TAT ~ TAA
            >[- >++>->+<<<]<] #TAC~TAA
             ] #TAG is correct STOP (fall through)
            >[-] #TAA is correct STOP
            ]
        <]
    #case C:
        ] (fall through)
      #we can fall through because we already put the letter into L1
    #case G:
        ] (fall through)
    #case A:
        >[- >
        -[-[
        #cases _C & _T not possible
            >->[-]>->+++>>>+<<<<<]
        #case _G:
            >[- >
            -[[-]>->+++>>>+<<<<<] #cases _GC/_GT/_GG are not possible
            >[->>>++++<<<] #_GA ~ TGA
            ]<]
        #case _A:
            >[- >
            -[-[[-]>->+++>>>+<<<<<] #cases _AC/_AT not possible
             ] #AAG ~ TAG (fall through)
            >[->>>++++<<<] #_AA ~ TAA
            ]
        ]

    #pointer is on cell5
    #if exit flag is zero then exit loop:
    >>>>
]
<<<.>.>. #print position and letters

It loads one codon at a time and uses a series of switch statements to look for all the possible codons that could mutate into a STOP. Further golfing ideas I have are:

For C__, G__, A__ codons, the switch statements are almost identical. There has to be a way to collapse them Done.

Is there a way to fall through cases in BF? Some of the cases are identical There is! Just replace the entire case with ].

There's probly a more optimal arrangement of the memory cells

The last bullet won't save too much; I'm happy with shaving 300 bytes for now.

Retina 0.8.2, 68 bytes
((...)*?((.)(?=AA|AG|GA)|T(.(?=G)|G.)))(?<=(.)).*
$.1$6>$#4$*T$#5$*A

Try it online! Link includes test cases. Explanation:
(

Capture the string up to and including the mutation so that we can take the length.
 (...)*?

Capture as few codons as necessary.
 (

Choose either:
  (.)(?=AA|AG|GA)

a nucleotide followed by AA, AG or GA (using the count of captures of capture group 4 to identify the necessary mutation)
 |

or
  T(.(?=G)|G.)

a nucleotide either side of a G, both following a T (using the count of captures of capture group 5 to identify the necessary mutation)
 )

End of choice.
)

End the first capture at the nucleotide to be mutated.
(?<=(.))

Look behind to see the nucleotide to be mutated (trying to capture it inside the group turns out to be nontrivial).
.*

Also delete the rest of the input.
$.1

Output the position of the nucleotide to be mutated.
$6>

Output the nucleotide to be mutated plus a >.
$#4$*T

If the first alternative matched then mutate the nucleotide to a T.
$#5$*A

If the second alternative matched then mutate the nucleotide to an A.

Red, 187 bytes
Thanks to @Jitse for finding a bug!
func[s][k: 0 until[v: take/part s 3 foreach t["TAA""TAG""TGA"][u: collect[repeat i 3[if(m: v/:i)<> n: t/:i[keep/only reduce[k + i m">"n]]]
]if 1 = length? u[print u exit]]k: k + 3 s =""]]

Try it online!
Using Red's parse:
Red, 211 bytes
func[s][u: func[c][print[index? p p/1">"c]]t:"T"a:"A"c:"C"g:"G"parse
s[any[[[p:[a | g | c]"AA"|"AG"|"GA"](u"T")|[t p:[t | c | g][a | g]](u"A")|[t
p:[a | t | c]a](u"G")|["TG"p:[g | t | c]](u"A")](exit)| 3 skip]]]

Try it online!

@JonathanAllan I wish it wasn't a bug, but unfortunately it was - I was calculating the index incorrectly. I can't believe my code worked for the test cases :)

K (ngn/k), 56 bytes
{(1+;x;a)@'*<(*&~^5 6 9?4/+0N 3#)'i@[x;;:;]'a:1&3!i:!#x}

Try it online!
encodes "TAGC" as 0 1 2 3 respectively
returns 1 1 0 on error
important observation: there's no point trying to replace a nucleotide with anything other than T (when first in the codon) or A (when second or third)
{ } function with argument x
i:!#x the list 0 1 ... length(x)-1, assigned to i
a:1&3!i mod 3 and min with 1: 0 1 1 0 1 1 ... 0 1 1, assigned to a
@[x;;:;] a projection - tetradic @ (a.k.a. "amend") with 2 missing arguments. this is a function that when given args u and v, creates a copy of x and replaces its u-th element with v
i@[x;;:;]'a call the projection with corresponding elements from i and a
( )' each
0N 3# reshape to a 3 columns wide matrix
4/+ decode from base 4. for a codon u v w this is (16*u)+(4*v)+w
*&~^5 6 9? find the index of the first codon that decodes to 5 (TAA) or 6 (TAG) or 9 (TGA)
*< from the length(x) such possible first codons, find the index p of the one that terminates earliest
(1+;x;a)@' make a list of (1+p;x[p];a[p])

Thank you for the explanation!


text:
Draw the flag of Tennessee
The flag of Tennessee is specified by chapter 498 of the Public Acts of 1905.

An oblong flag or banner in length one and two thirds times its width, the large or principal field of same to be of color red, but said flag or banner ending at its free or outer end in a perpendicular bar of blue, of uniform width, running from side to side; that is to say, from top to bottom of said flag or banner, and separated from the red field by a narrow margin or stripe of white of uniform width; the width of the white stripe to be one-fifth that of the blue bar; and the total width of the bar and stripe together to be equal to one-eighth of the width of the flag.
In the center of the red field shall be a smaller circular field of blue, separated from the surrounding red field by a circular margin or stripe of white of uniform width and of the same width as the straight margin or stripe first mentioned. The breadth or diameter of the circular blue field, exclusive of the white margin, shall be equal to one-half of the width of the flag. Inside the circular blue field shall be three five-pointed stars of white distributed at equal intervals around a point in the center of the blue field and shall be of such size and arrangement that one point of each star shall approach as closely as practicable without actually touching one point of each of the other two around the center point of the field; and the two outer points of each star shall approach as nearly as practicable without actually touching the periphery of the blue field. The arrangement of the three stars shall be such that the centers of no two stars shall be in a line parallel to either the side or end of the flag, but intermediate between same; and the highest star shall be the one nearest the upper confined corner of the flag.

Here is the flag, with annotations for its ratios:

Your task is to draw this flag in a way that complies with the statute. However, because the statute is ambiguous, you have some wiggle room with what you output. Specifically:

You may use any colors reasonably recognizable as "red", "white", and "blue". (The sample image uses #cc0000, #002d65, and #ffffff.)
The "stars" may have any exterior or interior angles. But all the interior angles must be equal, all the exterior angles must be equal, all edges must be the same length, it must have ten edges and ten vertices, and it must be reasonably recognizable as a five-pointed star.
The stars must be as large as "practicable" so that their points do not touch each other in the center or the white band around the edge of the circle. Between the two points of each star closest to the edge and the edge, and between the points approaching the center of any two stars, there must be at least 1 pixel of space but not more than 1/48 of the length of the flag.
The centers of the three stars may form any equilateral triangle, so long as no side of the triangle is parallel to an edge of the flag, and the vertex closest to the top of the flag is closer to the top left corner than the top right corner.

Shortest code wins.

So no ASCII art...

PostScript, 346 315 bytes
Code (compressed version):
5 5 scale<</C {setrgbcolor}/R{1 0 0 C}/B{0 0 1 C}/W{1 setgray}/o{closepath fill}/c{0 360 arc o}/f{rectfill}/t{translate}/p{currentpoint}/s{gsave p t 4{0 -11 lineto p t -144 rotate}repeat o grestore}>>begin R 0 0 74 48 f B 75 0 5 48 f W 37 24 13 c B 37 24 12 c W 37 24 t 3{-.1 -.5 moveto s 120 rotate}repeat showpage

Code (uncompressed version):
5 5 scale                 % over-all scale

% define some short-named procedures for later use
<<
  /C {setrgbcolor}
  /R {1 0 0 C}            % set red color
  /B {0 0 1 C}            % set blue color
  /W {1 setgray}          % set white color
  /o {closepath fill}
  /c {0 360 arc o}        % draw circle
  /f {rectfill}
  /t {translate}
  /p {currentpoint}
  /s {                    % draw 5-pointed star
    gsave
    p t
    4 {
      0 -11 lineto          % one line of star
      p t
      -144 rotate           % rotate by 144°
    } repeat
    o                       % fill the star
    grestore
  }
>> begin

R 0 0 74 48 f             % draw big red rectangle
B 75 0 5 48 f             % draw blue rectangle
W 37 24 13 c              % draw white circle
B 37 24 12 c              % draw blue circle
W
37 24 t                   % translate to center of circle
3 {
  -.1 -.5 moveto          % move a little off the center
  s                       % draw white star
  120 rotate              % rotate by 120°
} repeat
showpage

Result:

HTML+CSS 28+291 = 319 bytes
Tested on FireFox 69 and Chrome 77 on Windows 10 1903.

*{position:absolute}c,d{height:480px}d,e{background:blue}c{width:700px;background:red}d{width:84px;left:716px}e{width:240px;height:240px;left:214px;top:104px;border-radius:100%;color:#FFF;border:16px solid}f{left:21px;top:-44px}g{font-size:150px;transform:rotate(120deg);top:65px;left:110px}
<c><d></d><e><f><g>★<g>★<g>★

HTML+CSS 28+278 = 306 bytes
This version uses % instead of pixels, so some places can be off by a tiny amount of pixels, but CSS is shorter.

*{position:absolute}c,d{height:480px}d,e{background:blue}c{width:700px;background:red}d{width:84px;left:102%}e{width:34%;height:50%;left:31%;top:22%;border-radius:100%;color:#FFF;border:16px solid}f{left:9%;top:-19%;font-size:938%}g{transform:rotate(120deg);top:65px;left:110px}
<c><d></d><e><f><g>★<g>★<g>★

This answer is invalid because the flag's proportions are incorrect (with a width of 480px it should be 800px long) and the stars are not correctly rotated: "one point of each star shall approach as closely as practicable without actually touching one point of each of the other two around the center point of the field; and the two outer points of each star shall approach as nearly as practicable without actually touching the periphery of the blue field".

@PurpleP, I think the size is correct, total height = 480px, total width including white and blue strip = 800px, I will look into rotating stars later.

On my system, the stars clip outside the circle.

Looks ok on mine (Chrome on Windows). Nice work.

The stars collide on Chrome OS 79.

Like most pages that mix absolute and relative units, this CSS fails to set the root font-size.  Those of us with a browser default root font-size that's different from the author's end up seeing mis-sized and mis-placed stars.

Scratch, 530 bytes
Try it online!
I will be explaining the code here as well as in Scratch so that parameters can be more easily confirmed. Note that 1/48 = 2 pixels. Alternatively, 43 blocks
define W
set pen color to(#fff
define B
set pen color to(#036
when gf clicked
set y to(-48
erase all
set pen size to(1
pen down
repeat(96
change y by(1
set x to(86
B
set x to(76
W
set x to(74
set pen color to(#c00
set x to(-74
end
go to x:()y:(
set pen size to(52
W
pen down
set pen size to(48
B
pen down
set pen size to(1
W
repeat(3
pen up
go to x:()y:(
turn cw(120)degrees
move(2)steps
pen down
set[S v]to(20
repeat(9
change[S v]by(-2
turn cw(18)degrees
move(1)steps
turn ccw(18)degrees
repeat(5
move(S)steps
turn cw(144)degrees

Definitions
define W                Combined, these definitions save ~ 40 bytes
set pen color to(#fff   Sets the pen color to white
define B                Note that these hex values are approximations - they may not be perfectly replicated in vanilla Scratch
set pen color to(#036   Sets pen color to blue

Base
when gf clicked         Initiates code
set y to(-48            Sets y position to the bottom of the flag
erase all               Clears the stage
set pen size to(1       Resets the pen to be 1 pixel in diameter
pen down                Applies the pen
repeat(96               Loops code for each row of pixels in the flag
change y by(1           Moves y position to the next row
set x to(86             Sets the x position to the right side of the flag
B                       Sets pen color to blue
set x to(76             Draws a horizontal line 10 pixels long
W                       Sets pen color to blue
set x to(74             Draws a horizontal line 2 pixels long
set pen color to(#c00   Sets pen color to red
set x to(-74            Draws a horizontal line 148 pixels long
end                     Signifies the end of the code that should be looped

Circles
go to x:()y:(        Sets position to the center of the red field (which, for optimization, is the origin)
set pen size to(52   Sets the diameter of the pen to 52 pixels (diameter of the white ring)
W                 Sets the pen color to white
pen down             Applies the pen
set pen size to(48   Sets the diameter of the pen to 48 pixels (diameter of the blue circle)
B                    Sets the pen color to blue
pen down             Applies the smaller blue circle onto the white, making the ring

Stars
set pen size to(1     Sets the diameter of the pen to 1 pixel
W                     Sets the pen color to white
repeat(3              Loops code for each star
pen up                Removes the pen
go to x:()y:(         Moves to the center of the circle
turn cw(120)degrees   Rotates around the center
move(2)steps          Moves 2 pixels out in a certain direction
pen down              Applies the pen
set[S v]to(20         Sets the size of the stars to 20 pixels
repeat(9              Loops code so that 9 nesting pentagrams are drawn, essentially filling in the stars
change[S v]by(-2      Decrements the size of the next pentagram
turn cw(18)degrees      Moves the starting position
move(1)steps            of the pentagram to adjust
turn ccw(18)degrees     for the smaller size
repeat(5              Loops code for each edge of a pentagram
move(S)steps          Draws an edge of the appropriate length
turn cw(144)degrees   Rotates the edge to be drawn an appropriate amount

     Note that an "end" line is not needed if a "c-block" is at the end of a script

I had to measure to confirm that the star closest to the top of the flag is closer to the top right corner than the top left corner. It is, but only by about 4%, so well done.

The top vertex is centered in the red field, but since the red field is offset by the white and blue fields, the vertex is just barely closer to the left. Realizing this saved 14 bytes.

PHP, 288 bytes
<?php
echo gzuncompress(base64_decode("eJyNjssKgzAQRX9loIupi9DM+GgF47+IJiagtcT08fnVYMFCF90Mc+Hcw63mR19XXrcBnq4LViEzo9Wut0EhZRkaNwwKD62UeNrI10rluBUo/8VLLla+h+Cb62wmPyqM79AEfSQiOHPygY0xWFet8+2gwStMy7W7ywXCt/fWBAuuW5wIyx0FExCU4gKLuRC5oJgEMVBMIgXiGCOxOu6zBuu1WawBdzP9FOJGlskfGGcRewOZ3F4l"))?>

Unpacks and echos the following inline svg image that abuses the browser's handling of both the HTML and SVG standards (newlines added for readability):
<svg>
<rect width='222'height='144'fill='#c00'/>
<rect x='225'width='15'height='144'fill='#026'/>
<g transform='translate(111 72)'fill='#fff'>
<circle r='39'/>
<circle r='36' fill='#026'/>
<path id='t' d='m-21 1 9-8 11 6-5-11 9-8-12 1-5-11-3 12-12 1 11 6'/>
<use href='#t'transform='rotate(120)'/>
<use href='#t'transform='rotate(240)'/>

Tested under Chrome and Firefox.
Try it on phpfiddle.org

Java + Processing, 441 bytes
void star(float x,float y,float r1,float r2){float t=TWO_PI/5;beginShape();for(float a=0;a<TWO_PI;a+=t){vertex(x+cos(a)*r2,y+sin(a)*r2);vertex(x+cos(a+t/2.0)*r1,y+sin(a+t/2.0)*r1);}endShape();}void setup(){size(166,100);background(#cc0000);stroke(255);fill(#002d65);strokeWeight(2.1);circle(77,50,50);rect(154,-3,13,103);noStroke();fill(255);for(int i=0;i<3;i++){pushMatrix();translate(77,50);rotate(i*2*PI/3);star(-5,12,4,11);popMatrix();}}

5 pointed star function modified from Processing examples.

Python+PIL, 485 bytes
from math import*;from PIL import Image,ImageDraw
_=255
w,B,W,l,a=(_,_,_),(0,45,101),425,393,1.85
I=Image.new('RGB',(W,_))
d=ImageDraw.Draw(I)
t=d.rectangle
t([0,0,W,_],(_,0,0));t([l,0,W,_],B);t([l,0,398,_],w)
x,y,e,f=193,127,64,'d.ellipse([(x-e,y-e),(x+e,y+e)],%s)'
exec(f%'w'+';e-=4;'+f%'B')
def S(x,y,R):p,a,v,r=[],pi/5,2.65,29;exec('R+=2*a;p+=[(x+cos(R)*r,y+sin(R)*r),x+cos(R+a)*r/v,y+sin(R+a)*r/v];'*5);d.polygon(p,w)
exec('S(193+cos(a)*32,127+sin(a)*32,a-1.85);a+=2;'*3)
I.save('img.png')

SVG, 260 bytes
Not very cross browser friendly, renders correctly in Firefox.

<svg viewBox=-35,-24,80,48 style=background:red><g fill=blue stroke=#fff><circle r=12.5 /><path d=M39.5,-44v99h99 /><g fill=#fff stroke=blue stroke-width=.2><text x=-10>★</text><text x=-10 transform=rotate(120)>★</text><text x=-10 transform=rotate(240)>★

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Number of characters skipped determines code printed
Write a program which, when every nth character is skipped, it prints n. For example, if every 2nd character is skipped, it prints 2.
Example
n=0
foobar

Output:
0

n=1
foa

Output:
1

n=2
fobr

Output:
2

Rules

If n=0 (no characters are skipped), 0 must be returned.
Must print to STDOUT.
Standard loopholes are forbidden.
The first character is never skipped.
Obviously, it doesn't need to work for more characters than the code has (e.g. if your code is 11 characters long, it doesn't need to work for every 11th character)

Scoring
This is code golf, so the shortest code in bytes wins.

I'm sure I've seen a challenge like this before, but I have to question the "code golf" aspect: Fewer characters (say, a 2 byte program) would never need to output 3 because there would be no 3rd character. I'm pretty sure the older challenge was to output as many different results as when programs got longer there were more collisions to deal with. Shorter just gives an advantage to languages that can output 0 with 0 or 1 bytes (and is not challenging).

How is n=1 "fobr"? If I understand the challenge it should be "foa" because you remove each character in parenthesis: f(o)o(b)a(r)

Ooooh, this is a radiation-hardening type problem. I thought it was printing every n characters of the input or something.

Welcome to Code Golf SE! We have a sandbox where you can post a potential challenge and get meaningful feedback before posting it to Main, which can help clear up questions such as the ones currently in the comments.

I'm trying to understand this challenge a bit better.Are you portraying that foobar is the theoretical source code, and skipping every character of the original source code, foobar, resulting in foa, would print a different result?

Seems to be a duplicate of https://codegolf.stackexchange.com/questions/36397/run-the-nth-characters-to-get-n?rq=1 except this one lacks a minimum length

@AlienAtSystem Those are actually pretty different.  This one is remove every $kn+1$th character while that one is keep every $k$th character.

Still, I think a minimum length requirement would improve this challenge as well

@AlienAtSystem That might be the one I was thinking of.

Polyglot, 1 byte
0

Try it in Retina
Try it in Jelly
Try it in 05AB1E
Try it in Husk
Try it in ///
Try it in GolfScript
Try it in BrainGolf
Try it in Pyth
Try it in Japt
Try it in ink
Try it in PHP
Try it in Brachylog
Try it in MATL
Try it in Keg
Try it in Carrot

Definitely not Lua, Turing Machine Code, or Emoji

You can add m4 too.

You can add Jamal too, though without TIO link.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Don't get banned from stack exchange!
I'm sure this is going to spark some controversy, but let's do a practical demonstration.
The objective of this is simple, using the new code of conduct and no input, print out my pronouns ( "he/him", "he him" is also acceptable).
Here's the challenge. This is a classical polyglot contest!
This means that the first answer can be in any language, and the only requirement is that the user post their number (1), their language, and their code. The second user must then rework this code to satisfy the condition with the first answers language, and any other language that hasn't been used.  Adding code is the preferred method of polyglotting, but subtraction is ok too. This keeps going until we have a program which works simultaneously in many languages. No language should appear twice. Breaking the contest functionality in any previous language would make an answer invalid
An example:
First person to post code:
1. C++
[Code]
Second person to post code:
2. Python.
[Altered Code]
Third person to post code:
3. Java.
[Further altered code]
The winner will be the last answer that stands uncontested for 4 weeks.
This is a high steaks round, as the penalty for intentionally posting code which mis-genders me, could be a ban from the site itself (though I, unlike stack exchange, am able to overlook this)! Best of luck!
For Additional reference, he'res the clarification on chaining rules.

Additional rules

Your program must run without erroring out or crashing. Warnings (and other stderr output) are acceptable, but the program must exit
  normally (e.g. by running off the end of the program, or via a command
  such as exit that performs normal program termination).
Each answer must be no more than 20% or 20 bytes (whichever is larger) longer than the previous answer. (This is to prevent the use
  of languages like Lenguage spamming up the thread, and to encourage at
  least a minor amount of golfing.)
Tricks like excessive comment abuse, despite being banned in some polyglot competitions, are just fine here.
You don't have to use the previous answers as a guide to writing your own (you can rewrite the whole program if you like, as long as it
  complies with the spec); however, basing your answer mostly on a
  previous answer is allowed and probably the easiest way to make a
  solution.
You cannot submit two answers in a row. Let someone else post in between. This rule applies until victory condition is met.
As this challenge requires other competitors to post in the same languages you are, you can only use languages with a free
  implementation
  (much as though this were a cops-and-robbers contest).
In the case where a language has more than one interpreter, you can pick any interpreter for any given language so long as all programs
  which are meant to run successfully in that language do so in that
  interpreter. (In other words, if a program works in more than one
  interpreter, future posts can pick either of those interpreters,
  rather than a post "locking in" a particular choice of interpreter for
  a language.)
This challenge now uses the new PPCG rules about language choice:
  you can use a language, or a language interpreter, even if it's newer
  than the question. However, you may not use a language/interpreter
  that's newer than the question if a) the language was designed for the
  purpose of polyglotting or b) the language was inspired by this
  question. (So newly designed practical programming languages are
  almost certainly going to be OK, as are unrelated esolangs, but things
  like A Pear Tree, which was
  inspired by this question, are banned.) Note that this doesn't change
  the validity of languages designed for polyglotting that are older
  than this question.
Note that the victory condition (see below) is designed so that breaking the chain (i.e. making it impossible for anyone else to
  answer after you via the use of a language that is hard to polyglot
  with further languages) will disqualify you from winning. The aim is
  to keep going as long as we can, and if you want to win, you'll have
  to respect that.

For reference, this is the exact CoC I'm referring to, consolidated as per the request of many users for clairity:

We expect today’s changes to the Code of
  Conduct to generate a lot of
  questions. We’ve tried to anticipate some of the most common questions
  people may have here, and we’ll be adding to this list as more
  questions come up.
Q1: What are personal pronouns, and why are they relevant to the Code of Conduct?
Personal pronouns are a way to refer to a person without using their
  name, when the subject is known. From
  mypronouns.org:

The vast majority of people go by the pronouns sets “he/him” or “she/her.” A small but increasing number of people use “they/them”
    pronouns or another pronouns set -- sometimes simply because they
    don’t want to go by pronouns with a gender association (just as some
    folks go by “Ms.” whether or not they are married, because they don’t
    think their marital status should be a relevant issue), and sometimes
    people use pronouns that aren’t associated with one of those two most
    common (binary) genders because they are nonbinary (i.e. people who
    are neither exclusively a man nor exclusively a woman -- e.g.
    genderqueer, agender, bigender, fluid, third/additional gender in a
    cultural tradition, etc.).

The goal of our Code of Conduct is to help us “build a community that
  is rooted in kindness, collaboration, and mutual respect.” Using
  someone’s pronouns is a way of showing respect for them and refusing
  to do so causes harm.
Q2: What does the Code of Conduct say about gender pronouns?
The Code of Conduct has two direct references to gender pronouns:

“Use stated pronouns (when known).”
“Prefer gender-neutral language when uncertain.”

We’re asking everyone to do two things. First, if you do know
  someone’s pronouns (e.g. because they told you), then use them as you
  normally would use any pronoun. Second, if you don’t know someone’s
  pronouns, use gender-neutral language rather than making an
  assumption.
Q3: What should I do if I make a mistake and use the wrong pronouns?
If you make a mistake, apologize and correct your mistake if possible
  (e.g. by editing your post). We recognize that this may be new to many
  people, particularly members of our community who do not speak English
  as a first language, and so mistakes will happen as we all learn
  together.
Q4: What should I do if I see someone using the wrong pronouns?
If you notice someone who is using the wrong pronouns for someone else
  who has stated them (e.g. in a comment or on their profiles), we
  encourage you to gently correct them in a comment. Do not state
  pronouns for third parties who have not done so in Stack Exchange (eg.
  You know them in person). If the situation escalates, please flag what
  you see. A moderator or community manager will look into it further.
Q5: How will this be moderated? Will we ban people based on one mistake?
We understand that miscommunication or mistakes may happen, so most
  situations will just result in a gentle correction or warning. As with
  any violation of the Code of Conduct, in cases of willful, repeated,
  or abusive behavior, warnings may escalate to account suspensions
  and/or expulsion.
Q6: What should I do if I don't know someone's pronouns?
When in doubt, use gender-neutral language or refer to the user by
  name.
Q7: Are we going to force everyone to identify their pronouns?
No. Just as we do not force users to identify their real name, we will
  never force users to identify their pronouns. This is a voluntary
  decision by each user to share as much or as little as they are
  comfortable.
Q8: How should I identify my pronouns if I choose to do so?
Whether and how you identify your pronouns is up to you. If you choose
  to do so, add it to the “About Me” section of your user profile.
Q9: Do I have to use pronouns I’m unfamiliar or uncomfortable with (e.g., neopronouns like
  xe, zir, ne... )?
Yes, if those are stated by the individual.
Q10: What if I believe it is grammatically incorrect to use some pronouns (e.g. they/them to refer to a single person)?
If they are the pronouns stated by the individual, you must respect
  that and use them. Grammar concerns do not override a person’s right
  to self identify.
Q11: If I’m uncomfortable with a particular pronoun, can I just avoid using it?
We are asking everyone to use all stated pronouns as you would
  naturally write. Explicitly avoiding using someone’s pronouns because
  you are uncomfortable is a way of refusing to recognize their identity
  and is a violation of the Code of Conduct.
Q12: Does this mean I’m required to use pronouns when I normally wouldn’t?
We are asking everyone to use all stated pronouns as you would
  naturally write. You are not required to insert pronouns where you
  otherwise would not.
From @CesarM (staff): You have to use their stated pronouns in
  places where you'd include a pronoun. If you wouldn't include a
  pronoun in the sentence, you don't have to go out of your way to find
  a place to include one.
Q13: How does this apply to languages other than English?
For now, while the intent of being inclusive and respectful of all
  gender identities applies to all our communities, the specific
  requirements around pronoun usage apply only to English language
  sites. As we determine best practices in other languages, we’ll work
  with those communities and update guidance for those languages.
Q14: Should all posts be written using gender-inclusive language? Should we edit all old posts to be gender-inclusive?
The focus of this change is on using correct pronouns when addressing
  other members of the community. However, writing posts in a
  gender-inclusive way is encouraged and a great way to make the
  community more accessible to more people. If you are writing or
  editing a post and can make it gender-inclusive without changing the
  meaning, you are encouraged to do so.
Q15: Is it expected that people go to "About me" to check whether someone has pronouns there when interacting in Q&A?
No.  That would be good practice, but it is not required.
From @jnat (staff): We ask that you use gender-neutral language
  when uncertain, and use the stated pronouns once they're made known.
  If you wanna "go the extra mile," looking at the user's "about me"
  before interacting is certainly nice, but we're not requiring it.
From @CesarM (staff): Made known is when you become aware of
  the fact. If it's in the comments, then, fine. Correct and move on.
  There's no obligation to go out of your way to seek it out, but if
  someone tells you directly, comply.
Q16: May I use they/them by default?
Yes, but be prepared to make adjustments if so requested.
From @Catija (staff) If you use they/them by default, that's
  fine. If someone requests that you use other pronouns and you
  immediately continue to use they/them for that person, we may point
  it out to you. "Penalized" in most cases is generally going to be as
  minor as a comment being removed or adjusted to meet the request of
  the person being spoken about. Only in extreme cases of repeated
  requests to change, will it lead to a mod message or suspension.
Q17: What should I do if I think someone requests me to use a certain pronoun in bad faith? From @Cesar M(Staff)

If people are requesting things in bad faith, you are welcome to escalate to mods and mods can contact us CMs when in doubt too.

It is advised to use a custom (Something Else) flag for this. Please
  explain, as detailed as possible, what the issue is.
Return to FAQ index

@JoKing there's a link there, it simply means that no part out your answer should violate the CoC.

Ah, I guess we're going to have to close it as unclear if that's the case

@JoKing you're the one whose being unclear, the new CoC is very comprehensive.

I can only assume you're being sarcastic to prove a point, since there's more than a hundred answers to the linked question, many of which are asking for clarifications with no response. On the other hand, this just seems to be just a [tag:answer-chaining] polyglot with basically no restrictions? By adding code/subtracting code, can we only do one at once? because both just means the new code can be whatever

@JoKing right, same rules as here in the additional rules, except 2 and 4. Also the answer formatting does not apply,.

@JoKing right it's clear I must be verbosely specific. ignore any questions on the CoC. CoC is law.

Ideally, a challenge shouldn't need you to refer to multiple other resources to understand what the rules are, so long as the rules aren't too mathematically sophisticated.

@UnrelatedString should I copy them to this question?

High steaks round?

@Night2 all answers

@JoKing I can only hope you're being intentionally thick, in the evident case that you aren't I've added the most verbosity that I possibly could think of, let me know if there's anything else is unclear and I'll point you to a relevant google query.

@Night2 I've fixed that.

Really, answers are meant to abide by the CoC anyway, so there's you don't need to explicitly list them out. This could just be a [tag:answer-chaining] [tag:polyglot] that outputs "he/him", except that that would probably be closed as a duplicate of something since it is too simple

While I think this challenge doesn't deserve closure as unclear, I think it is a duplicate of Add a language to a polyglot, so voting to leave closed.

1. Keg, 6 bytes
he him

Try it online!
Real easy one for Keg, just print the desired output.


text:
type in a random mess of capital letters
SOMe PEOPle lIkE tO TYpE iN A LoGiCAL MAnNER, WITh CapITals aT tHe bEGiNnIng Of ThE SENtENCE and smaLl LETTErS EVeRYWHErE eLsE. NOT Us. NOt Us. Your joB iS to tAkE A SenTEncE Of A
LL SMAlL LeTTeRS, And rANDOmly ChAnGe sOMe to caPiTAl. ThiS iS a Code gOLF so tHE SmaLleST coDE WIll win.
the input will always be small letters and spaces with punctuation only.
random meaning running the code multiple times will always yield different results.
test cases for this will be hard since it involves random elements.
here is a shitty example with python
https://onlinegdb.com/Hy0_gEEKH

Welcome to CG&CC! This could do with some test cases, and some formal guarantees about the nature of the input. It can't hurt to define random, either. I think I've seen similar challenges, but can't find anything this is a duplicate of.

(Also, the link to your example seems to be broken. If it is in fact necessary, consider porting it to something like tio.run)

The input will be lower case letters only. Does that mean only a-z, or can there be spaces and other characters? Is it enough that the first letter is randomly capitalized, or is it required that all characters can be capitalized? Do you require uniform randomness?

Related: Random Capitalization That challenge differs in the input having already-capital letters which should stay capital. Maybe still a duplicate.

The "random" specification as it stands is incomplete

"unning the code multiple times will always yield different results", I don't think this is possible.  If you run the code enough times there will be a collision, since there are only a limited number of possibilities.

randomly change some could be defined more clearly. For example, is randomly changing only one character to uppercase each time a valid solution? What if the solution only randomly changed several consecutive characters to uppercase but in a random range? (For example the answer may yield abCDE or aBcde for abcde but never aBcDE). If they are considered invalid, it is better to define the randomness as: All possible combination of uppercase and lowercase should be able to exist in theory.

@xnor this challenge specifies lowercase input so any solution for Random Capitalization necessarily works for this, with very little room for meaningful code reduction (except removing some code in some places). I'm not sure I want to use my hammer though.

(changed my mind) I believe this is far too similar to not be considered an exact duplicate of the other challenge, since the dominant strategy (basically the only one used) is to choose between each character and the character uppercased, which, being valid for both challenges, makes answer tactics fundamentally identical.

Changing the spec and invalidating existing solutions is an automatic -1 from me.

Python 3, 59 bytes
i=input()
while i:print(end={i,i.upper()}.pop()[0]);i=i[1:]

Try it online!
-4 bytes thanks to Chas Brown
Uses set.pop() to randomize.

63 bytes. Never knew pop could be used for random choice... nice!

@ChasBrown good find, thanks! pop picks an item based on hash value. From Python 3.something onward, this is completely randomized for a.o. strings. The catch is that it is only assigned once per string per session, so it can only be used in a full program.

APL (Dyalog Extended), 6 bytesSBCS
Anonymous tacit prefix function. Assumes ⎕IO←0 (0-based indexing)
⊢×∘?2¨

Try it online!
2¨ number two for each character
? random index among the first that many indices (i.e. 0 or 1 for each character)
∘ then
× use that to change case (0:lower; 1:upper) on the following:
⊢ the unmodified argument

K (oK), 32 bytes
{,/{`c$x-32*1?2*(x<123)*x>96}'x}

Try it online!

Red, 80 78 58 bytes
func[s][foreach c s[prin do pick[c[uppercase c]]random 2]]

Try it online!

Japt -m, 5 bytes
c^HÑö

Try it

the challenge states input will have"small letters and spaces with punctuation", this fails when there are non-letters

@EmbodimentofIgnorance, it was lowercase letters only at time of posting. Would you believe, though, I also had your solution written up in another tab but copied the Markdown from the wrong one?!

Japt -m, 4 bytes
+u)ö

Try it
-m    //Map all characters in input
+     //Input prepended to
  u)  //Input to uppercase
    ö //Random character

Python 2, 72 bytes
lambda i:"".join(choice(x)for x in zip(i,i.upper()))
from random import*

Try it online!

PowerShell, 60 46 43 bytes
-3 bytes thanks to mazzy

-join($args|%{"$_"|%('t*g','*per'|random)})

Try it online!

perhaps toUpper will be better?

@mazzy Yep, it was. Thanks

nice. -3 bytes :)

Jelly, 5 bytes
żŒuX€

Try it online!
Stolen from totallyhuman's solution to Random Capitalization.
My original solution, since I forgot Jelly has ż:
Jelly, 6 bytes
Œu,X¥"

Try it online!
,ŒuXƊ€ works for the same byte count.
     "    For every element of the input and every corresponding element of
Œu        the input capitalized,
  ,X¥     choose one or the other at random.

PHP, 51 50 bytes
for(;$l=$argn[$i++];)echo$l>_&&rand()%2?$l^' ':$l;

Try it online!

PHP, 51 50 bytes
for(;$l=$argn[$i++];)echo rand()%2?ucfirst($l):$l;

Try it online!

Perl 5, 22 bytes
s/./.5<rand?uc$&:$&/ge

Try it online!

C# (Visual C# Interactive Compiler), 59 bytes
x=>x.Select(l=>z.Next()<1?l.ToUpper():l);var z=new Random()

Try it online!

51 bytes - x=>x.Select(l=>new Random().Next()<1?l.ToUpper():l)

C (gcc), 109 46 bytes
Thanks to Johan du Toit for -63 bytes
f(char*s){for(;*s++-=(*s-97u<26&rand())*32;);}

Try it online!

46 bytes

Charcoal, 8 bytes
⭆Ｓ‽⁺↥ι↧ι

Try it online! Link is to verbose version of code. Trivial modification of my answer to Random Capitalization.

Python 3, 94 bytes
s=input();from random import*;print("".join([i.upper() if randint(0,1)==1 else i for i in s]))

Try it online!


text:
Rational Number RNG
The Objective
Build a random number generator whose range is \$\left[0,1\right) \cap \mathbb{Q} .\$
This is, build a random number generator that can produce any value that's:

at least \$0 \,;\$
not \$1\$ or greater; and
expressible as the ratio of two integers.

What's the fuss?
This RNG is weird. Its range is nowhere connected, but is dense in the interval!

The probability mass function
We define an ordering for all values that the RNG can return, such that each return value \$ x\$ can be associated with an index \$ i .\$  Then, the probability of returning \$x_i\$ should be \$P\left(x_i\right) = {\left(\frac{1}{2}\right)}^{i} .\$  Since
$$
\sum\limits_{i=1}^{\infty}{{\left(\frac{1}{2}\right)}^{i}} = 1
\,,
$$
this yields a total probability of \$1 ,\$ where the numbers earlier in the ordering are significantly more likely than numbers later in the ordering.
The ordering is:

Start with the first value, \$ \frac{0}{1}.\$
Increment the numerator.
If the numerator equals the denominator, then:

reset the numerator to \$ 0 ;\$ and
increment the denominator.

Add the value to the ordering if it's not equivalent to a value already in the ordering.

For example, \$\frac{2}{4}\$ is constructed after \$\frac{1}{2} ,\$ so it's not added to the ordering.

Go back to Step (2).

For example, the first few values and their corresponding probabilities are:
$$
\begin{array}{r|c|c|c|c|c|c|c|c|c|c}
\textbf{Index}~\left(i\right)
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & \cdots
\\\hline
\textbf{Value}~\left(x\right)
& \frac{0}{1}
& \frac{1}{2}
& \frac{1}{3}
& \frac{2}{3}
& \frac{1}{4}
& \frac{3}{4}
& \frac{1}{5}
& \frac{2}{5}
& \frac{3}{5}
& \frac{4}{5}
& \cdots
\\\hline
\textbf{Probability}~\left(P\right)
& \frac{1}{   2}
& \frac{1}{   4}
& \frac{1}{   8}
& \frac{1}{  16}
& \frac{1}{  32}
& \frac{1}{  64}
& \frac{1}{ 128}
& \frac{1}{ 256}
& \frac{1}{ 512}
& \frac{1}{1024}
& \cdots
\end{array}
_{\large{.}}
$$

Rules

There is no input. The RNG outputs a number upon invocation.
You must use rational number arithmetic. In particular, X must be represented as a rational number. If your language doesn't natively support it, use a pair of integers. For example, in Haskell, Rational is a valid type.
As long as the numerator and the denominator are distinguishable, the output format doesn't matter.
As this is a code-golf, the shortest code in bytes wins.

Please specify how to compute the probability for each given X, not just an examples from which we are supposed to infer that. See Things to avoid when writing challenges.

@Night 0 is the infimum. If you are refering to the denominator, there is no limit.

@Arnauld The challenge is solvable without using FP at all, so that is forbidden.

@Arnauld Though it is forbidden only when it relates to X's precision.

2/7 and 4/14 are guaranteed to give the same (imprecise) floating point value. So floating-point values could be safely used for deduplication

@LuisMendo Right, but (2^100)/(2^100+3) and (2^100+1)/(2^100+3) are hardly distinguishable through single- or double-precision FP.

@lisyarus Even if you use uint64, there is a value above which integer numbers are indistinguishable. Using float instead of uint64 simply moves down the threshold from 2^64 to 2^53

This has a low nonzero probability of taking an exponentially long time to generate since deduplication requires factoring large numbers. It also has a nonzero probability of crashing the program with an out of memory error.

@Beefster That's inevitable anyway. In Haskell, even though Rational has unbounded precision, that problem will occur.

@LuisMendo: Fun fact: x87 80-bit float (64-bit significand) can exactly represent every int64_t.  (But not every uint64_t, IIRC).  Bonus fun fact: gcc -m32 -mno-sse will use x87 fild / fistp to implement atomic<int64_t> load/store because it's a 64-bit copy that preserves any possible integer.

APL (Dyalog Unicode), 27 bytes
i⊃⍸1=∘.(>×∨)⍨⍳2+i←1+⍣{?2}¯1

Try it online!
Thanks to @ngn for this function. Since this is not strictly my answer, I'll keep the older answer below this one. Uses ⎕IO←0.
The function returns a pair in the form denominator numerator.
How:
i⊃⍸1=∘.(>×∨)⍨⍳2+i←1+⍣{?2}¯1 ⍝ Dfn
                         ¯1 ⍝ Literal -1
                     {?2}   ⍝ Roll. Since IO is 0, this will roll either 0 or 1
                    ⍣       ⍝ Power. Repeats the function to the left until the right argument is 0.
                  1+        ⍝ 1 plus. The whole expression above will result in 1+1+1+...-1;
                            ⍝ each iteration has a 50% chance of being the last one.
                i←          ⍝ Assign the result to i
             ⍳2+            ⍝ Generate the vector [0..2+i]
            ⍨               ⍝ Use it as both arguments (⍺ and ⍵) to the fork:
     ∘.(>×∨)                ⍝ For each element of the left argument (⍺), apply: (⍺ > ⍵) × (⍺ ∨ ⍵);
                            ⍝ This will result in a matrix of 0s (if ⍵>⍺) and the GCDs between ⍺ and ⍵.
   1=                       ⍝ Check which elements are 1 (where ⍺ is coprime with ⍵)
  ⍸                         ⍝ Find the coordinates (which will be denominator and numerator) of truthy values
i⊃                          ⍝ pick the i-th element.

Old answer:
APL (Dyalog Unicode), 55 bytes
{(?0)<2÷⍨∨/⍵:∇∊((⊂0,2⊃⍵+1),⊂1 0+⍵)[1+(⊃⍵)<¯1+2⊃⍵]⋄⍵}0 1

Try it online!
Statistics
Terribly inefficient port of @Arnauld's answer, so go upvote him.

Actually 45 bytes because of the unicode characters. Still glorious!

@Mason Actually, we use Adám’s SBCS to count APL’s Unicode characters as a single byte each.

I see, my mistake!

JavaScript (ES6), 81 bytes
Returns \$p/q\$ as [p,q].
f=(p=0,q=1)=>Math.random()<(g=(a,b)=>b?g(b,a%b):a)(p,q)/2?f(++p-q?p:!++q,q):[p,q]

Try it online!
Or Try some statistics!
How?
We recursively build the fractions \$p/q\$ in the relevant order, but without any explicit deduplication, until a random number picked in \$[0,1[\$ is greater than or equal to \$gcd(p,q)/2\$.
If \$p\$ and \$q\$ are not coprime, we have \$gcd(p,q)/2\ge1\$, which always triggers the recursive call. This is the expected behavior because the corresponding fraction must be discarded.
If \$p\$ and \$q\$ are coprime, we have \$gcd(p,q)/2=1/2\$, which is the desired probability of triggering the next call.
Commented
f = (                 // f is a recursive function taking:
  p = 0,              //   p = numerator, starting at 0
  q = 1               //   q = denominator, starting at 1
) =>                  //
  Math.random() <     // pick a random number in [0,1[
  (g = (a, b) =>      // g is a recursive function computing the gcd of 2 integers
    b ?               //   if b is not equal to 0:
      g(b, a % b)     //     recursive call with (b, a mod b)
    :                 //   else:
      a               //     return a
  )(p, q) / 2 ?       // if our random number is less than gcd(p, q) / 2:
    f(                //   do a recursive call:
      ++p - q ? p     //     increment p if p < q - 1
              : !++q, //     otherwise: set p to 0 and increment q
      q               //
    )                 //   end of recursive call
  :                   // else:
    [p, q]            //   stop recursion and return [p, q]

This is a brilliant insight.  Nice job.

Ruby, 74 67 bytes
Probably not the golfiest solution for Ruby, but it was the first thing that sprung to mind. Increment the counter $. (starts at 0) each time rand is at least 0.5 to determine the index, then determine the list of rationals and output the right one.
-7 bytes from histocrat.
d,*a=1r
$.+=1until rand<0.5
a|=(0...d+=1).map{|n|n/d}until p *a[$.]

Try it online!

I'm not that knowledgable But I'm assuming a |= ...  appends a list and removes duplicates?

@Kroppeb yes, absolutely. | when operating on arrays more-or-less acts as a set union operator.

Elegant solution! You can get an empty array a little more tersely with d,*a=1r or using the arguments variable $*, and you can save having to write a[$.] twice with either an inline assignment until o=a[$.] or moving the print itself into the conditional with until p *a[$.]. The * converts the a[$.] into an argument list, which will be empty at first so p will do nothing and return a falsey value, then when it actually outputs something it becomes truthy.

@histocrat thanks for the tips! I did think about using $* earlier, but it errors when I try to run $* |= ... because it's a read-only variable so that's a no-go.

Julia, 61 49 71 bytes
p>q=rand()<.5 ? (p<q-1 ? (while gcd(p+=1,q)!=1 end;p>q) : 1>q+1) : p//q

In un-golfed form, this reads
function f(p,q)                      # define the function
    if rand() < 0.5                  # flip a coin.
        if p < (q - 1)               # if the coin gives heads, check if p < (q - 1)
            while gcd(p+1, q) != 1   # if the greatest common divisor or p+1 and q is not equal to 1
                p = p + 1            # we increment p, because otherwise we'd get a fraction we already saw.
            end
            return f(p, q)           # recursively call f(p, q) (where p has been incremented)
        else
            return f(1, q+1)         # if p is not greater than q - 1, we recursively call f(1, q+1)
        end
    else
        return p//q                  # If the coin flip gives tails, we return the Rational number p//q
    end
end

Now let's check to make sure we did this right:
julia> using UnicodePlots; data = [0>1 for _ in 1:10_000_000]; histogram(data)
                ┌                                        ┐
   [0.0 , 0.05) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 5000106
   [0.05, 0.1 ) ┤ 0
   [0.1 , 0.15) ┤ 1168
   [0.15, 0.2 ) ┤▇ 82600
   [0.2 , 0.25) ┤ 0
   [0.25, 0.3 ) ┤▇▇ 313684
   [0.3 , 0.35) ┤▇▇▇▇▇▇▇▇ 1250427
   [0.35, 0.4 ) ┤ 39124
   [0.4 , 0.45) ┤ 310
   [0.45, 0.5 ) ┤ 0
   [0.5 , 0.55) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2498798
   [0.55, 0.6 ) ┤ 168
   [0.6 , 0.65) ┤ 19403
   [0.65, 0.7 ) ┤▇▇▇▇ 625484
   [0.7 , 0.75) ┤ 77
   [0.75, 0.8 ) ┤▇ 166131
   [0.8 , 0.85) ┤ 2473
   [0.85, 0.9 ) ┤ 47
                └                                        ┘
                                Frequency

julia> for frac in [(0//1), (1//2), (1//3), (2//3), (1//4), (3//4), (1//5), (2//5), (3//5), (4//5), (1//6), (5//6)]
           freq = count(x -> x == frac, data)/length(data)
           println("P($(frac)) ≈ $freq")
       end
P(0//1) ≈ 0.5000106
P(1//2) ≈ 0.2498798
P(1//3) ≈ 0.1250427
P(2//3) ≈ 0.0625484
P(1//4) ≈ 0.0313065
P(3//4) ≈ 0.0156477
P(1//5) ≈ 0.0077772
P(2//5) ≈ 0.0039116
P(3//5) ≈ 0.0019398
P(4//5) ≈ 0.0009654
P(1//6) ≈ 0.0004828
P(5//6) ≈ 0.0002473

Notice that P(5//6) ≈ 0.5 * P(1//6) as required since 2//6, 3//6, and 4//6 are reducible fractions.
Try it online!

save 1 byte by replacing rand(Bool) with 2rand()>1 or rand()>.5

Save 6 bytes by redefining an infix operator.
Hard part is you need on that binds less tightly than +
which mean you need a relation optator. so:
>(p=0,q=1)=2rand()<1 ? (p<q-1 ? p+1>q : 1>q+1) : (p,q)

@LyndonWhite You're right!. Can be even shorter if I use infix definition syntax as well: p>q = .... Not sure if it's considered cheating to get rid of the p=0, q=1.

PHP, 139 bytes
for($r=rand()/(getrandmax()+1),$b=$p=1;$r<1/$p*=2;)for($f=0;!$f;)for(++$a-$b?:++$b&&$a=1,$f=$i=1;++$i<=$a;$f&=0<$b%$i+$a%$i);echo+$a."/$b";

Try it online!

J, 41 bytes
[:({[:~.@,(i.%x:)"0@i.@+&2)>:^:(?@2)^:_@0

Try it online!
At a high-level, I stole ValueInk's idea for first flipping a coin until it comes up heads, and using that number to index into the ordered list of rationals.

MATL, 31 bytes
`rEk}@EU:2M&\v1M/t1<fw6#uX&@)Z)

Output is numerator, then denominator. Try it online!
Or check relative frequencies in 1000 realizations (header and footer added; one more byte necessary in main code; TIO running time about 30 seconds). Format is: num den freq, each row corresponding to a number. Note that relative frequencies are increasingly imprecise down the table, because the corresponding numbers occur less often.
Here is a set of relative frequencies obtained from 100000 realizations (offline compiler):
0       1 0.49828
1       2 0.25022
1       3 0.12643
2       3  0.0611
1       4 0.03128
3       4 0.01657
1       5 0.00814
2       5 0.00383
3       5 0.00206
4       5 0.00099
1       6 0.00047
5       6 0.00024
1       7  0.0002
2       7   6e-05
3       7   6e-05
4       7   5e-05
5       7   2e-05

WDC 65816 machine code, 77 bytes
Hexdump:
00000000: 6407 6405 e607 3b85 09e2 31a2 039a 6869  d.d...;...1...hi
00000010: b248 6300 ca10 fac2 30a5 091b a501 102c  .Hc.....0......,
00000020: e605 a505 c507 d006 6405 e605 80d6 a607  ........d.......
00000030: 8609 c509 f00f 9004 e509 80f4 488a 38e3  ............H.8.
00000040: 01aa 6880 ebc9 0100 d0d6 80ba 60         ..h.........`

Assembly:
    STZ $07
    STZ $05
earlier_loop:
    INC $07
loop:
    TSC
    STA $09
    SEP #$31
    LDX #$03
    TXS
    PLA
    ADC #$B2
rngloop:
    PHA
    ADC $00,s
    DEX
    BPL rngloop
    REP #$30
    LDA $09
    TCS
    LDA $01
    BPL done
after_rng:
    INC $05
    LDA $05
    CMP $07
    BNE someplace
    STZ $05
    INC $05
    BRA earlier_loop
someplace:
    LDX $07
gcd:
    STX $09
    CMP $09
    BEQ gcd_end
    BCC gcd_else
    SBC $09
    BRA gcd
gcd_else:
    PHA
    TXA
    SEC
    SBC $01,s
    TAX
    PLA
    BRA gcd
gcd_end:
    CMP #$0001
    BNE after_rng
    BRA loop
done:
    RTS

I/O:

RNG seed in $01-$04 (32 bits, anything but 0)
output is in $05 (numerator), $07 (denom.)
overwrites $00, $09
assumes 16-bit accumulator on entry
messes with the stack so best called with all interrupts disabled

This was more difficult than I first expected. I misread the challenge description and skipped the part about repeats not being counted. The 65816 doesn't have any built-in RNG or floating point math, and it doesn't even have integer multiply/divide. I used the RNG algorithm from cc65, a 6502 C compiler, and adapted it a bit (made it smaller). Then I used the z80 GCD algorithm from Rosetta Code and translated it into 65816 assembly.
Here's a sample of outputs after running for some number of iterations:
0/1: 0x60e4 = 24804
1/2: 0x3122 = 12578
1/3: 0x187c = 6268
2/3: 0x0c7d = 3197
1/4: 0x05bd = 1469
3/4: 0x0313 = 787

As you can see, each next fraction is about half as likely as the previous one. There isn't a good online 65816 "IDE", but I'm working on making one. For now, if you want to test this, you can write a small bit of wrapper code which logs outputs of the subroutine into a table in RAM and view that table with a debugging SNES emulator (I recommend bsnes-plus).
Big thanks to @p4plus2 and @Alcaro for help with optimizing the code.

Javascript ES6, 98 chars
g=(x,y)=>y?g(y,x%y):x
for(x=y=1;y;++x)for(y=0;y<x;++y)if(Math.random()<.5==g(x,y))y=alert(y+"/"+x)

Demo with console.log instead of alert:

g=(x,y)=>y?g(y,x%y):x
for(x=y=1;y;++x)for(y=0;y<x;++y)if(Math.random()<.5==g(x,y))y=console.log(y+"/"+x)

Probability check:

g=(x,y)=>y?g(y,x%y):x
f=()=>{for(x=y=1;y;++x)for(y=0;y<x;++y)if(Math.random()<.5==g(x,y))return y+"/"+x}
r={}
for(q=0;q<32768;++q)r[x=f()]=~~r[x]+1
console.log(Object.keys(r).sort((x,y)=>r[y]-r[x]).map(x=>x+" "+r[x]).join`
`)
.as-console-wrapper.as-console-wrapper{max-height:100vh}

ink, 137 bytes
=r
~temp e=0
-(d)~e++
~temp n=-1
-(l)~n++
{e-n:{RANDOM(0,c(e,n)<2):{n}/{e}->->}->l}->d
==function c(a,b)
{b:
~return c(b,a%b)
}
~return a

Try it online!
Okay, strap in, this was an adventure.
My first attempts at solving this with a full program rather than a function (well, it's a stitch rather than a function, but the point still stands) failed horribly. The logic was sound, but for some reason I was getting 1/3 more than twice as often as 1/2, and that pattern held for more than 2000 test runs - that wasn't the only place where it failed, but it was the most noticable.
So I broke the code down into parts. I ungolfed it, I added debug messages, it didn't work. I ported the core logic to python, as faithfully as I possibly could, and it worked fine. To simplify the testing process, I changed a minor detail to allow me to call my code multiple times during a single run of a program (used a separate variable rather than a readcount for some logic, because readcounts can't be reset). I ran my code a few hundred times as part of a single program, rather than running the program a few hundred times.
And suddenly it worked.
So I figured the problem was related to the readcount I was using - those have been known to act up at times. So I went back to having my code be a full program, but kept the new variable. And it went back to not working.
So I figured, okay, maybe the RNG isn't uniform over the course of multiple runs of a program, but tends towards uniformity if called repeatedly in a single program. That sounded vaguely reasonable - well it kinda didn't, but I was getting desperate. So I wrote two small programs to test my hypothesis - one that generated 100 random values (which I ran once), and one which generated a single random value (which I ran 100 times). And they both gave me about 50 0s and 50 1s.
At my wits' end at this point, I had no idea what was going on, and frankly I still have no idea where to even begin when it comes to figuring it out.
So I'm posting a stitch. It would be 18 bytes shorter if I could have it be a full program (code is here), but even though the logic would be entirely identical, that appears to not work as it should, and any change I try to make only serves to break it in a different way. Only the gods know why, and they surely envy my ignorance.
With that rant out of the way, there are some neat tricks in the code, so let's look at it.
The basic idea is that after each number is generated, we have a 50% chance of outputting it, and a 50% chance of continuing to the next number - this strategy wasn't obvious to me at first, but looking at it it becomes obvious that each output will be half as likely as the one before, twice as likely as the next one, and equally as likely as the all the subsequent values combined - which is exactly what we want.
Now that RANDOM call doesn't obviously look like a 50/50 thing. Well, let's look a bit deeper. You'll notice that its second parameter is actually a boolean expression - meaning it will only ever be 0 or 1. If it's 1, RANDOM will output either 0 or 1 with equal probability, meaning we have a 50% chance of outputting the current numerator and denominator (it happens if RANDOM would generate a non-zero value), while if it's 0 we effectively skip a number.
So what is that c function then? Well, if you look further down, you'll find it's Euclid's algorithm for finding the greatest common divisor of two numbers. If that's greater than 1, we won't want to output the number - there's another representation of that number with a strictly smaller numerator and denominator, so we've already skipped that number. But if it is 1, it's a number we may want to output, so we check if the GCD is 1, plug the result of the comparison into the RANDOM call, and call it a day.
conveniently enough, anything is a divisor of 0, so if the numerator is 0 we will skip the number if the denominator isn't 1. Which happens to be exactly what we want.

05AB1E, 29 28 bytes
®1‚[0L+Ð5°D<Ýs/Ωs¿;@#`αi>®0ǝ

Inspired by @Arnauld's approach.
Try it online or see the counts of 100 outputs (it's a bit too slow to do more than 100 in TIO.. >.>).
Explanation:
NOTE: 05AB1E doesn't have a builtin to get a decimal in the range \$[0,1)\$, so instead I create a list in the range \$[0,1)\$ in increments of \$0.00001\$ manually, and get a random value from this list.
®1‚           # Push -1 and 1, and pair them: [-1,1]
   [          # Start an infinite loop:
    0L+       #  Increase only the first value by 1 (by adding [1,0])
       Ð      #  Triplicate this pair
    5°        #  Push 10 to the power 5: 10,000
      D<      #  Duplicate it, and decrease the copy by 1 to 9,999
        Ý     #  Create a list in the range [0,9999]
         s/   #  Swap to get the duplicated 10,000, and divide each item by it:
              #   [0, 0.00001, 0.00002, 0.00003, ..., 0.99997, 0.99998, 0.99999]
           Ω  #  Pop and push a random item from this list
    s         #  Swap to get one of the pairs at the top again
     ¿        #  Get the greatest common divisor (gcd) of the values in this pair
      ;       #  Halve it
    @         #  If the random value is larger than or equal to this:
     #        #   Stop the infinite loop
    `αi       #  If the absolute difference between the two values in the pair is exactly 1:
       >      #   Increase both values in the pair by 1
        ®0ǝ   #   And then replace the first value with -1
              # (after the loop, output the pair at the top of the stack implicitly)


text:
Mirror, Mirror, on the wall. Who's the fairest of them all?
Well, you know it's Snow White, and the evil Queen is at it again. Will Snow White be saved? Will she fall asleep once again? Will the Prince find her?
Challenge:
Given an arbitrary number (>= 2) of possibly duplicated hexadecimal color values (ranging from #000000 to #FFFFFF) and paired strings, calculate the following:

If #FF0800 (Candy apple red) appears in the input, return "Return to Sleeping Death"
If #000000 appears in the input, return "Saved by Grumpy"
If #A98AC7 or #111111 appears in the input, return "Saved by Happy"
If #21E88E or #222222 appears in the input, return "Saved by Sleepy"
If #32DCD5 or #333333 appears in the input, return "Saved by Bashful"
If #43D11C or #444444 appears in the input, return "Saved by Sneezy"
If #54C563 or #555555 appears in the input, return "Saved by Dopey"
If #65B9AA or #666666 appears in the input, return "Saved by Doc"
If #76ADF1 or #777777 appears in the input, return "Saved by the Seven Dwarfs"
If #FFFAFA (Snow) appears in the input, return "Saved by Love's first kiss"
If an F variant appears in the input, return "Press F to pay respects to Snow White"

An F variant is any number that contains at least one F in its hexadecimal form, and is otherwise all 0s (e.g. #0FF0F0, #FFFFFF, #00000F, #F00F00)

If multiple of the preceding occur, return the "fairest" answer. The "fairest" answer is calculated as follows:

For all N occurrences of special color values, choose the (N-1)/2-th (truncating division) occurrence. The associated special output is the "fairest" answer.

"Appears in the input" here refers to only the hexadecimal color values, and not to the paired strings.

If none of the preceding occur, return the "fairest" answer. The "fairest" answer is calculated as follows:

Take the hexadecimal color value at the end of input values, write it down, and exclude that single color-string pair from consideration as the "fairest" answer
Show its binary form to the mirror, computing a reflection of only the last 24 (#FFFFFF is the mask) bits.
Choose the hexadecimal color with least Hamming distance from the reflection. If there are multiple (N) such colors, choose the middle ((N-1)/2-th, truncating division) instance of the color. The "fairest" answer is the associated string for the color.

Inputs:
A sequence of hexadecimal color values and String values separated by a space. The input may also be read as two separate sequences of hexadecimal color values and String values, or a single sequence of 2-tuples (either (hexValue, stringValue) or (stringValue, hexValue) is permissible, as long as the ordering is consistent across all 2-tuples).  Input order matters - for each index, the corresponding element in the supply of color values is "associated" with the corresponding element in the supply of String values, and duplicates can affect the "fairest" answer. The effect is something like Function(List(HexColorValue),List(AssociatedStrings)) -> "fairest" answer. Hexadecimal color values may be represented as either (your choice of) a String "#"+6 digits, or 6 digits alone, as long as the representation is consistent across all color values.
Here's an example input:
76ADF1 Return to Sleeping Death
2FE84E Return whence ye came!

Here's another example input:
2FE84E Return to Sender
4FFAFC Return of the Obra Dinn
2FE84E Return to the house immediately, young lady!
2FE84E Return to Sleeping Death
2FE84E Return of the Jedi

Here's the third example input:
2FE84E Return to Sender
4FFAFC Return of the Obra Dinn
2FE84E Return to the house immediately, young lady!
2FE84E Return to Sleeping Death
7217F8 Return of the King

Here's the final sample input:
F4A52F Eating hearts and livers
F4A52F Eating apples
F4A52F Eating porridge
F4A52F Eating candy houses
F4A52F A Modest Proposal

Outputs:
The "fairest" answer as computed by the specified logic. For example, on the first sample input, the "fairest" answer would be Saved by the Seven Dwarfs, due to the special hex color 76ADF1 appearing within the input.
In the second sample, there are no special inputs. First, we take "2FE84E Return of the Jedi", which has value #2FE84E. In binary, this is:
001011111110100001001110

We take the reflection from the mirror, getting:
011100100001011111110100

We compare it against 2FE84E (001011111110100001001110) and 4FFAFC (010011111111101011111100), which have Hamming distances of 18 and 12 from the reflection, respectively. Since #4FFAFC has the uniquely lowest Hamming distance from the reflection, the "fairest" answer is Return of the Obra Dinn.
In the third sample input, there are no special inputs. First, we take "7217F8 Return of the King", which has value #7217F8. In binary, this is:
011100100001011111111000

We take the reflection from the mirror, getting:
000111111110100001001110

We compare it against 2FE84E (001011111110100001001110) and 4FFAFC (010011111111101011111100), which have Hamming distances of 2 and 8 from the reflection, respectively. All 3 instances of hexadecimal color value #2FE84E have minimum Hamming distance from the reflection, so we take the (3-1)/2=1th instance (0-indexed) of #2FE84E. Therefore, the "fairest" answer is Return to the house immediately, young lady!.
In the last sample input, there are no special inputs. First, we take "F4A52F A Modest Proposal", which has value #F4A52F. In binary, this is:
1111010011001100101111

We take the reflection from the mirror, getting:
1111010011001100101111

We compare it against F4A52F (1111010011001100101111), which has Hamming distance 0 from the reflection. All instances of hexadecimal color value #F4A52F have minimum Hamming distance from the reflection. There are FOUR instances of #F4A52F, because we always exclude the last hexadecimal color instance from evaluation. Therefore, we take the (4-1)/2=1th instance (0-indexed) of #F4A52F, and the "fairest" answer is Eating apples. If you don't exclude the last value from consideration, you actually get the (5-1)/2=2th instance of #F4A52F (Eating porridge), which is wrong.
Rules:

No standard loopholes
Input/output taken via standard input/output methods.
The output must be exactly equal to the "fairest" answer

Scoring:
This is code golf, so shortest program wins.
Here's the sandbox link

I'll be honest, 3 downvotes without any explanation whatsoever is a real downer. I left this in the sandbox for two weeks so that people could give feedback and spent hours clarifying the examples. If you didn't do your job of giving feedback, how am I supposed to improve my question?

I was not aware that it was my personal "job" to go through every single sandbox post in existence, but okay. There's a chat; I usually go to it to get feedback, because with no positive or negative feedback, it's really a toss-up how main reception will go, and I'm slightly more experienced so I can usually gauge how my challenges will go, but even then, I still go to chat for final feedback before posting.

I didn't downvote, but my eyes glaze over looking at this challenge and I can't motivate myself to read it. It's not just that it's long, but that by the time I'm hit with a bunch of specifics, I don't really know what the overall idea is or why this would be interesting to golf. And my initial impression is that I wouldn't enjoy coding or golfing it because I'd need to implement a long, rigid algorithm with finicky details that requires encoding a big lookup table.

Shouldn't #A98AC7 be #01B207 so that it's consistent with the other patterns? Or did you change it on purpose?

@Arnauld In decimal, #A98AC7 is 11111111

@Avi That's my point. We have 8 1's here, while the other values expends to 7 repeated digits in base 10. Just wanted to be sure that was on purpose.

@Arnauld I started with 8 1's and then brought it down to 7 digits for everything else, because they were too large to fit in 6 hex digits. The idea was the "max" of a digit repeated, converted to hex, as well as that digit 6 times in hex itself.

C# (Visual C# Interactive Compiler), 557 bytes
a=>b=>{var k=a.Select(l=>l==0xFF0800?"Return to Sleeping Death":$"{l:X}".All(x=>x>69|x<49)?"Press F to pay respects to Snow White":"Saved by "+"Grumpy,Happy,Sleepy,Bashful,Sneezy,Dopey,Doc,the Seven Dwarfs,Love's first kiss,	".Split(',')[l==0xFFFAFA?8:l==11111111?0:l%1118481<1?l/1118481:l%1111111<1?l/1111111:9]);int j=a.Last(),i=0,e=24;for(;e-->0;i|=j%2,j>>=1)i*=2;var m=k.Where(o=>o[9]!=9);var t=a.SkipLast(1).Select(o=>Convert.ToString(o^i,2).Sum(y=>y-48)).ToList();return(m.Any()?m:m=b.SkipLast(1).Where((x,y)=>t.Min()==t[y])).ToList()[~-m.Count()/2];}

Try it online!

Suggest j/=2)i+=i+j%2; instead of i|=j%2,j>>=1)i*=2;

JavaScript (Node.js), 433 bytes
Takes input as a list of tuples [color, string].
a=>(h=a=>a[a.length-1>>1])(a.flatMap(([c])=>(s=c-0xFFFAFA?"Grumpy/Happy/Sleepy/Bashful/Sneezy/Dopey/Doc/the Seven Dwarfs".split`/`[(d=c-11111111?c/1118481:1)%1?c/1111111:d]:"Love's first kiss")?"Saved by "+s:c-0xFF0800?(g=n=>n?n%16%15||g(n>>4):0)(C=c)?[]:"Press F to pay respects to Snow White":"Return to Sleeping Death"))||h(a.map(m=([c,s])=>[(d=g(c,i=24))>m?d:m=d,s],a.pop(g=n=>i--&&(n^C>>i)%2+g(n/2))).flatMap(([d,s])=>d-m?[]:s))

Try it online!

Very impressive - I especially liked the computation for correct hex indices :)


text:
L tromino tiling
Inspired by this challenge from puzzling.SE.
Polyominoes are fun - you can fill all sorts of shapes with them. But as soon as you have limits on what polyominoes you can use, you sadly start running into shapes you can't fill.
Today we'll be looking at the L tromino - a shape made up of three conjoined squares, in such a way that all three squares are of the same size, and there is a corner which they all share. It looks like this:

Now, given a shape made out of equal-size squares as input, the challenge is to find out whether that shape can be filled using only non-overlapping L-trominoes that are placed entirely within the input figure. You may have any number of these trominoes, and you may rotate each of them by any integer multiple of 90°.
Rules

The challenge is to make a program or function.
Your program will recieve as input a two-dimensional list of values.
Each entry in the list will contain one of two consistent values of your choice - one to signify that a square should be filled, and the other to signify that it shouldn't.
You may assume there will be at least one row and at least one column, and that every row and every column will contain at least one cell that needs to be filled. You may also either assume that all rows have been padded to be of equal length, or that they contain nothing after their last filled cell - you may also independently assume either of those for the columns. That is to say, with 1 as squares you need to fill, and 0 as squares you need to not fill, you only need to be able to handle one of these four inputs (if given one of the others, your program's behaviour is undefined):

1 1 0
1 1 1
0 1 0

1 1
1 1 1
0 1

1 1 0
1 1 1
  1

1 1
1 1 1
  1

To fill some square, you must also fill two other squares. Exactly two of the three squares filled must be diagonally adjacent to (sharing a corner with) eachothers, and they must both be orthogonally adjacent to (sharing a side with) the third.
You may assume the input shape is contiguous.
You may assume the input's dimensions will be no greater than 5x5.
You may not assume the number of rows and the number of columns in the input will be equal. Originally, all this question's test cases featured inputs with an equal number of rows and columns. This was a result of poorly chosen test cases and was not intended to indicate that this would be the case for all inputs.
Your program either needs to output a single consistent value of your choice if filling exactly the squares specified by the input with L-trominoes is possible, and any other value if it is impossible, or vice versa. For example, you may decide to output false if the input shape can be filled, in which case that is the only acceptable output for shapes that can be filled, and any output except false is acceptable for input shapes that can't be filled.
However, the output of your program must not vary between runs given identical input, if said input is valid. That means if you have output 2 for some particular valid input, any later runs with exactly that input must also output 2.
This is code-golf - make your code as short as you can.

Examples
The examples use 1 and 0 to represent squares that should and shouldn't be filled respectively, uses true as the only output for fillable shapes, and false as the only output for non-fillable shapes.
1  -> false

0 1
1 1 -> true

1 1 1
1 1 1
1 1 1 -> false

0 1 0
1 1 1
0 0 1  -> false

1 0 0
1 1 1
0 1 1  -> true

1 1 0
1 0 1
1 1 1
1 0 1  -> false

1 1 1 1
1 0 0 1
1 0 0 1
1 1 1 1  -> true

0 1 1 1
1 1 0 1
1 1 1 1
0 1 1 0  -> true

0 1 1 1
1 1 1 1
1 1 1 0
0 1 1 0  -> true

1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 0  -> true

1 1 1 1 1
1 0 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1  -> false

1 1 1 1 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1  -> true

Can we assume that there will be a multiple of 3 squares to fill?

@Neil, the first example has 5 1s so I'd assume it isn't always a multiple of 3.

Can we assume that the input is not empty?

@GB If by "not empty" you mean either "the input is at least 1x1" or "at least one square needs filling" then as the spec states "you may assume there will be at least one row and at least one column, and that every row and every column will contain at least one cell that needs to be filled". If you mean something else when you say "not empty", I can't answer unless you clarify what you mean.

@SaraJ: you already answered the question, thanks, now that I read the spec again, it makes sense.

JavaScript (ES6),  196 ... 185  182 bytes
Takes input as a binary matrix. Returns a Boolean value.
f=m=>!/1/.test(m)||m.some((r,y)=>r.some((v,x)=>v&&[0,1,2,3].some(d=>([X,V]=(g=d=>[v=x+--d%2,R=m[y+--d%2]||0,R[v]])(d))[2]&g(d+1&3)[2]&&(r[x]=V[X]=R[r[x]=V[X]=R[v]=0,o=f(m),v]=1)&o)))

Try it online!
This algorithm is too slow for the penultimate test case on TIO, but it does find the answer on my laptop in about 90 seconds.
How?
This is a brute force search that looks for all possible trominos in the input matrix and attempts to remove them (one at a time) until the matrix is cleared or all combinations are proven to fail.
Given a reference cell at \$(x,y)\$ (in blue below) and a direction \$0\le d\le 3\$:

We invoke the helper function \$g\$ with \$d\$ to get a first neighbor cell (in yellow) whose coordinates are x+(d-2)%2 and y+(d-1)%2.
We invoke \$g\$ again with \$(d+1)\bmod 4\$ to get a second neighbor cell (in red).

This gives:

Commented
f = m =>                         // f is a recursive function taking the matrix m[]
  !/1/.test(m) ||                // stop if m[] does not contain any 1 anymore (success)
  m.some((r, y) =>               // otherwise, for each row r[] at position y in m[]:
    r.some((v, x) =>             //   for each value v at position x in r[]:
      v &&                       //     abort right away if this cell is already empty
      [0, 1, 2, 3].some(d =>     //     otherwise, for each direction d:
        ( [X, V] = (             //       get the 1st neighbor cell
            g = d => [           //       g is a helper function taking a direction
                                 //       and returning the corresponding neighbor cell:
              v = x + --d % 2,   //         save the x-coordinate in v
              R = m[y + --d % 2] //         extract the row R[]
                  || 0,          //         (0 is used as a default object to prevent
                                 //         an access to an undefined row)
              R[v]               //         get the value of the cell
            ]                    //         return the tuple [v, R, value]
          )(d)                   //
        )[2] &                   //       get the value of the 1st neighbor cell
        g(d + 1 & 3)[2]          //       get the value of the 2nd neighbor cell
        && (                     //       if both neighbor cells are set, this is a
          r[x] = V[X] = R[       //       valid L-tromino:
            r[x] =               //         remove it by clearing the current cell
            V[X] = R[v] = 0,     //         and its 2 neighbors
            o = f(m),            //         save the result of a recursive call in o
            v                    //         and restore the tromino
          ] = 1                  //
        ) & o                    //         yield the result of the recursive call
      )                          //     end of loop over the directions
    )                            //   end of loop over the columns
  )                              // end of loop over the rows

Python 3, 136 131 bytes
lambda S:g(int((len(S)*'{:0<6}').format(*S),2))<1
g=lambda b:b*all(b>>i&t^t or g(t<<i^b)for i in range(30)for t in(67,131,193,194))

Try it online!
Input: A list of strings, each string must be a binary string. The length of the strings can be different.
Output: True if the shape can be tiled, False otherwise.
-5 bytes thanks to @Lynn!
Big idea:
As with most code golf solutions, this is a brute-force recursive search. The program simply tries to remove an L-tromino from the shape, then recurs on the new shape.
By representing the shape using a bitboard (one integer, where each bit represents whether a cell is occupied or not), we can:

Use bit-wise AND to check if an L-tromino fits within a shape
Use bit-wise XOR to remove an L-shaped part from the shape.

Program explanation
Constructing the bitboard:
int(
    (len(S)*'{:0<6}').format(*S)  # left pad each row with '0' to length 6
                                  # then concat all rows together
,2)               # interpret the result string as binary integer

Recursive function that returns 0 if the shape can be tiled, or a positive integer if the shape cannot be tiled.
g=lambda b:\  # receive a bitboard as argument
    b *              # tilable if b is 0
    all(             # tilable if any of the following is False, i.e. all(...)==0
        b>>i&t^t or      # tromino doesn't fit shape or
        g(t<<i^b)        # the remaining is not tilable, i.e. g(...)==0
        for i in range(30)        # for each position in shape
        for t in(67,131,193,194)  # for each tromino orientation
    )

More details
Bitboard layout
The following diagram specifies which cell in the shape correspond to which bit in the bitboard:
29 28 27 26 25 24
23 22 21 20 19 18
17 16 15 14 13 12
11 10  9  8  7  6
 5  4  3  2  1  0

The size of the bitboard is 5 x 6, which is enough to store 5 x 5 shapes. If the shape has less than 6 columns, it is padded with 0 to the left. For example:
 111         ...111
 1.1  ---->  ...1.1  ----> ...111 ...1.1 ...11.  ---->  0x7146
 11.         ...11.

shape        padded          bitboard (binary)          bitboard (hex)

(Note: 0 is denoted by . for visual clarity)
Since each shape has at most 5 columns as specified in the problem, there will always be an empty column to the left of the bitboard. This will be important to prevent wrap-around later.
Each tromino orientation can be represented by 1 bitboard:
          ......   ......   ......   ......
          ......   ......   ......   ......
tromino   ......   ......   ......   ......
          .....1   ....1.   ....11   ....11
          ....11   ....11   .....1   ....1.

bitboard     67      131      193      194
(decimal)

Check if a tromino fits within the shape
To check if an L-tromino t fits inside a certain position in shape b, we can use bit-wise AND:
......               ......                      ......
......   shift to    ....1.    AND tromino       ....1.
......   position    ...11.    with shape        ...11.
.....1   --------->  ......  -----+-------->     ......
....11               ......       |              ......
   t                 t << 13      |          (t << 13) & b
                                  |
                     ......       |
                     ...1..       |
                     ..111.  -----+
                     ...1..
                     ......
                        b

We can see that the tromino fits inside the shape if and only if (t << i) & b == (t << i) (where i is the desired position). This is equivalent to:
(b >> i) & t == t

Remove an L-shaped region from the shape
We can use bit-wise XOR to remove a tromino from the shape:
 ......         ..1111           ..1111
 ....1.         ..1111           ..11.1
 ...11.   XOR   ..1111   ---->   ..1..1
 ......         ..1111           ..1111
 ......         ..1111           ..1111
t << 13            b               b2

int((len(S)*'{:0>6}').format(*S),2) saves you some bytes.

APL (Dyalog Unicode), 81 bytesSBCS
L←⊂⍤2⊢4 2 2⍴∘.≠⍨⍳4
{∧/~,⍵:1⋄∨/∇¨⍵∘{r c l←-⍵⋄⍺>c⌽r⊖(⍴⍺)↑L⊃⍨-l}¨⍸{∧/∘,¨L≤⊂⍵}⌺2 2⊢⍵}

Try it online!
Monadic dfn that takes a binary matrix and gives 1 if it can be tiled with L-triominoes, 0 otherwise.
A brute-force recursive search by removing one triomino at a time. Uses the fact that every orientation of an L-triomino fits within a 2x2 box, so the code tests all 2x2 submatrices of the input array to search for possible L-triomino placements. The Stencil operator ⌺ fits perfectly for this purpose.
The algorithm becomes much faster if we limit the branches to the first 5 placements (which is guaranteed to include all possible placements that includes the top-left cell) at the cost of 8 bytes (⊢↑⍨5⌊≢):
L←⊂⍤2⊢4 2 2⍴∘.≠⍨⍳4
{∧/~,⍵:1⋄∨/∇¨⍵∘{r c l←-⍵⋄⍺>c⌽r⊖(⍴⍺)↑L⊃⍨-l}¨(⊢↑⍨5⌊≢)⍸{∧/∘,¨L≤⊂⍵}⌺2 2⊢⍵}

Try it online!
Ungolfed with comments
⍝ 4 rotations of L-triomino; looks like
⍝ ┌───┬───┬───┬───┐
⍝ │0 1│1 0│1 1│1 1│
⍝ │1 1│1 1│0 1│1 0│
⍝ └───┴───┴───┴───┘
L←,{0@(⊂⍵)⊢2 2⍴1}¨⍳2 2
                  ⍳2 2  ⍝ Indexes of 2-by-2 matrix
   {      ⊢2 2⍴1}¨      ⍝ For each, modify [1 1][1 1] so that
    0@(⊂⍵)              ⍝   that position becomes 0
  ,                     ⍝ Flatten top level

⍝ Main function; 1 if L-triomino tiling is possible, 0 otherwise
f←{
  ⍝ If no cells left, return True
  ∧/~,⍵: 1
    ~,⍵     ⍝ Boolean negation of flattened input matrix
  ∧/        ⍝ All; reduce by And
       : 1  ⍝ If true, return 1

  ⍝ Get possible placements as (row_idx, col_idx, L_idx) triples
  places←⍸{∧/∘,¨L≤⊂⍵}⌺2 2⊢⍵
          {         }⌺2 2⊢⍵  ⍝ Map over 2x2 submatrices...
           ∧/∘,¨L≤⊂⍵  ⍝ Can each of L be placed on a submatrix?
                L≤⊂⍵  ⍝   Compare each cell of each of L with each cell of the submatrix
                      ⍝   so that L(1) vs. ⍵(0) gives False and anything else gives True
           ∧/∘,¨      ⍝   Reduce by And on all cells of each comparison matrix
         ⍸            ⍝ Indexes of ones
  places←             ⍝ Assign to places

  ⍝ For each possible placement, remove the cells and
  ⍝ recursively try L-triomino placements
  ⍝ If no possible placement, ∨/ automatically gives False
  ∨/∇¨⍵∘{r c l←-⍵⋄⍺>c⌽r⊖(⍴⍺)↑L⊃⍨-l}¨places
      ⍵∘{                         }¨places  ⍝ Map each on the places...
         r c l←-⍵⋄                  ⍝ Dissect the placement; negate due to built-in rotation direction
                             L⊃⍨-l  ⍝ Fetch the target L-triomino
                        (⍴⍺)↑       ⍝ Overtake to fit the size of input matrix
                    c⌽r⊖            ⍝ Rotate to move the L-triomino to correct position
                  ⍺>                ⍝ Remove L-triomino cells from input matrix
    ∇¨  ⍝ Recursively test for L-triomino placements
  ∨/    ⍝ True if at least one is successful
}

Ruby, 146 112 108 bytes
->m{g=->q{[7,11,13,14].any?{|x|t=x/4|x%4>>~m[0].size;t*=2until t>=q||q&t==t&&g[q-t];t<=q}};g[(m*?0).to_i 2]}

Try it online!