Maximum number of jokers

There are two interpretations of this question. If it is taken to mean "What is the maximum number of jokers so that there is some configuration which identifies at least one knight", then our answer is 29 - if all but one person says "Knight", the sole dissenter is the only knight present.

If it is taken to mean "What is the maximum number of jokers so that all possible answers reveal at least one person as a knight?", then the problem is rather more difficult.

One can place an upper bound of 8: if you hear responses of the form KKKKJKKKKJKKKKJKKKKJKKKKJKKKKJ, then it is possible for the group's identities to be JJJJJKKKKKJKKKKJKKKKJKKKKJKKKK or any multiple-of-5 rotation thereof, so this is a situation where a cap of 9 does not suffice.

However, we can also place a lower bound of 8.

Observe that a string of $n$ consecutive people saying "joker" forces at least $\lceil\frac{n}2\rceil$ of the people in that string of jokers and the following knight to be jokers. (E.g., if people say in order JJJJJK, 3 of those 6 (at least) are jokers.)

Observe also that if $n$ consecutive people say "knight", either the last of them really is a knight or every one of them is a joker.

This means that, if we note the sizes of consecutive blocks of joker-sayers $c=(c_1,c_2,\ldots,c_m)$, we can locate $\sum_{i=1}^m\left\lceil\frac{c_i}2\right\rceil$ of the jokers. Denote by $s$ the total number of joker-sayers. Of the remaining $30-s$ knight-sayers, at least one of the $m$ consecutive blocks of them is of size at least $\lceil\frac{30-s}m\rceil$. If the final knight-sayer is a joker, then this gives us $\lceil\frac{30-s}m\rceil-1$ additional jokers not counted by the previous sum (all of those knights except the first). If this puts us above the maximum 8 jokers, we will know that this final knight-sayer must really be a knight, and so will have identified the desired individual.

Finally, note that if we have an even number of consecutive joker-sayers and exactly half are jokers, then the knight-sayer following this block must really be a knight, so cases where all $c_i$ are even give us a "free" point in our sum (because the longest block of knight-sayers is forced to follow one of these even-sized joker-sayer blocks).

Given this setup, it will suffice to show that every tuple $(c_1,c_2,\ldots,c_m)$ has such a sum of at least 9.

Our total number of jokers is greater than or equal to each of $\lceil(30-s)/m\rceil+m-1$ and $\lceil(30-s)/m\rceil+\frac{s}2-1$. If we simply check this for all possible values of $m\le s$, we find that the only options are $(m,s)=(5,10)$ or $(6,12)$, which force us to have $c=(2,2,2,2,2)$ or $c=(2,2,2,2,2,2)$ respectively. But either of these fail to the "free joker" condition given earlier, so in fact neither work. Thus the answer is an 8 joker cap in order to always solve the puzzle.

The casework in establishing the lower bound for this proof is pretty ugly - I would be curious to see if anyone else can improve on it.