Your submission is now in Draft mode.

Once it's ready, please submit your draft for review by our team of Community Moderators. Thank you!

Submit Essay

Once you submit your essay, you can no longer edit it.


This content now needs to be approved by community moderators.


This essay was submitted and is waiting for review.

KBC: comment threads h-index


We haven't had a KBC in a while, and it's sad that the newest users haven't experienced their unadulterated glory yet, so here is a new one.

What will be this question's comment threads h-index?

We define this question's comment threads h-index as:

Where is the highest number such that this question has comment threads with at least unique users each, and is the number of comment threads with at least unique users.

A thread's users are all the users who commented on it, including the top level comment. Only users who joined before 2021-03-29 and are level 2+ at time of resolution will be counted.

The author has generated a secret resolution time between 2021-04-03 09:00:00 and 2021-04-03 21:00:00 (UTC+).

At the secret resolution time, the h-index will be determined, and this question will be retroactively closed and resolved. Only comments posted before the resolution time will count.

I know this isn't actually a KBC.

The h-index will be computed with this script:

import requests, json
from collections import defaultdict
from functools import lru_cache

def get_comments():
    url = ""
    comments = []
    while url is not None:
        data = json.loads(requests.get(url).text)
        url = data["next"]
        comments += data["results"]
    return comments

def get_thread_user_counts(comments):
    comment_threads = defaultdict(set)
    for c in comments:
        if c["created_time"] > "2021-04-03 09:00:00":
        comment_threads[c["id"] if c["parent"] is None else c["parent"]].add(c["author"])
    return list(map(lambda s: len([u for u in s if is_user_valid(u)]), comment_threads.values()))

def is_user_valid(user_id):
    url = f"{user_id}/"
    data = json.loads(requests.get(url).text)
    return data["date_joined"] < "2021-03-29" and data["level"] >= 2

def get_h_index(values):
    h_index_arr = [0 for _ in range(len(values)+1)]
    for v in values:
        h_index_arr[min(v,len(values) )] += 1
    total = 0
    for (i, v) in reversed(list(enumerate(h_index_arr))):
        total += v
        if total >= i:
            return i + len([0 for j in values if j >= i+1])/(i+1)
    return 0

comments = get_comments()
values = get_thread_user_counts(comments)

Make a Prediction


Note: this question resolved before its original close time. All of your predictions came after the resolution, so you did not gain (or lose) any points for it.

Note: this question resolved before its original close time. You earned points up until the question resolution, but not afterwards.

Current points depend on your prediction, the community's prediction, and the result. Your total earned points are averaged over the lifetime of the question, so predict early to get as many points as possible! See the FAQ.