language agnostic - Is it possible to create an algorithm which generates an autogram? -


an autogram sentence describes characters contains, enumerating each letter of alphabet, possibly punctuation contains. here example given in wiki page.

this sentence employs 2 a’s, 2 c’s, 2 d’s, twenty-eight e’s, 5 f’s, 3 g’s, 8 h’s, eleven i’s, 3 l’s, 2 m’s, thirteen n’s, 9 o’s, 2 p’s, 5 r’s, twenty-five s’s, twenty-three t’s, 6 v’s, ten w’s, 2 x’s, 5 y’s, , 1 z.

coming 1 hard, because don't know how many letters contains until finish sentence. prompts me ask: possible write algorithm create autogram? example, given parameter start of sentence input e.g. "this sentence employs", , assuming uses same format above "x a's, ... y z's".

i'm not asking write algorithm, although means i'd love see if know 1 exist or want try , write one; rather i'm curious whether problem computable in first place.

you asking 2 different questions.

"is possible write algorithm create autogram?" 

there algorithms find autograms. far know, use randomization, means such algorithm might find solution given start text, if doesn't find one, doesn't mean there isn't one. takes second question.

"i'm curious whether problem computable in first place." 

computable mean there algorithm given start text either outputs solution, or states there isn't one. above-mentioned algorithms can't that, , exhaustive search not workable. therefore i'd problem not computable. however, rather of academic interest. in practice, randomized algorithms work enough.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -