3 ms·
const randAlphaStr = length => String.fromCharCode( ...Array.from({ length }, () => 97 + Math.floor(Math.random() * 26)) ); const pitRustAgainst
by oefrha 6y ago
const randAlphaStr = length =>
String.fromCharCode(
...Array.from({ length }, () => 97 + Math.floor(Math.random() * 26))
);
const pitRustAgainstRandomFourCharAlphaStrings = async sampleSize => {
const rustScore = await getPrediction("rust");
let rustLosses = 0;
for (let i = 0; i < sampleSize; i++) {
if ((await getPrediction(randAlphaStr(4))) > rustScore) {
rustLosses++;
}
}
console.log(`rust lost ${rustLosses} times out of ${sampleSize}`);
};
pitRustAgainstRandomFourCharAlphaStrings(100000);
Result:
rust lost 55469 times out of 100000
I'd say rust fairs worse than the average random four character string with the letters a-z. That should tell you something about the usefulness of this model.
- Closi 6y agoCan you use your superpowers to find us the best 4 character string?