Well the story says that he sees an inscription on a cigarrete case.We need to have in mind that Algernon also created a "double" whose name is "Bunbury". Bunbury lives in the country. When Algernon wants to get out of things he does not feel like doing, he goes to visit his fake friend "Bunbury" in the country as an excuse. Algernon thinks that "ERNEST" provides the same "double" for Jack.