# Ghost (game)

Ghost (also known as ghosts or pig) is a written or spoken word game in which players take turns to extend the letters of a word without completing a valid word.
Ghost can be played by two or more players and requires no equipment, although it can be played with pencil and paper instead of being spoken aloud.

## Rules

Players take turns to call a letter, adding those letters to a shared, growing word fragment. (For example, if the first player calls "T", the second might call "R" to make "TR".)
Each fragment must be the beginning of an actual word.
The player whose turn it is may — instead of adding a letter — challenge the previous player to prove that the current fragment is actually the beginning of a word. If the challenged player can name such a word, the challenger loses the round; otherwise the challenged player loses the round. If a player bluffs, or completes a word without other players noticing, then play continues.
If a complete word is formed in this way, the player who called the final letter of it loses the round. (Usually some minimum is set on the length of a word that counts, such as three or four letters.) The losing player earns a "letter" (as in the basketball game horse), with players being eliminated when they have been given all five letters of the word "ghost".
When a round ends, play generally passes to the left.

## Winning strategy

Since the game tree of Ghost can be derived from the list of combinations of letters that are considered to be words, the game (as played by two players) can be easily "solved" to find a winning strategy for one player.
Alan Frank, a member of the National Puzzlers' League, constructed a sample winning strategy in 1987, based on the Official Scrabble Players Dictionary. Randall Munroe posted a sample winning strategy in 2007 on the news page of his webcomic, xkcd. He based his solution on the Ubuntu dictionary.

## Variants
### Superghost

Superghost is played by choosing either the beginning or end of the growing word fragment and adding a letter there. For example, given the fragment ERA, a player might offer BERA or ERAD. This version was played by James Thurber and his circle of friends.
This is also known as Fore-and-Aft in Hoyle's Rules of Games, Lexicant, or Llano.

### Superduperghost

This is played by deciding whether to reverse the letters of the word fragment before adding a letter to the fragment's beginning or end. For example, given the fragment ERA, a player might offer BERA, ERAD, NARE, or AREN. This variant was first broadly adopted at the 1978 World Science Fiction Convention in Phoenix, Arizona (IguanaCon) and is credited to Cary Hammer and Mark Malamud.

### Xghost

This is played by adding a letter anywhere in the growing word fragment, including between letters. For example, given the fragment ERA, a player might offer BERA, ERAD, EBRA, or ERMA.
This version was invented by Daniel Asimov around 1970. Originally and still often known as Superduperghost, it was played by his circle of mathematics grad student friends at U.C. Berkeley.
This variant is also sometimes known as Llama.

### Anaghost

This version allows the player to rearrange (anagram) the letters in addition to adding one. For example, given the fragment ERA, a player might offer EART, EBAR, or NREA.

### Spook

Spook is played by adding letters to a "pool" in which no fixed order is assumed. In this game, one's objective is to avoid completing a letter pool which can be ordered to form a word. For example, given the pool {A,B,F,L,S,U}, a player would be unwise to add H, which would form the word BASHFUL. However, they might add B, and cite the word FLASHBULB if challenged.
These variants usually require much more effort and time to play than the conventional game, and as such are lesser-known and less popular.

### Cheddar Gorge

Cheddar Gorge is played by adding a word to the end of a growing sentence fragment, and avoiding the completion of a sentence. This variant was popularized on the BBC Radio show I'm Sorry I Haven't a Clue.

## History

The name "ghost" is shortened from the original name "three thirds of a ghost"; a player, upon losing, became one, two, and finally three "thirds of a ghost", at which point they would float away and be out of the game.

## Computational complexity

Given a regular expression R, if two players take turns playing Ghost with the language generated by R, the problem of determining whether player 1 has a winning strategy is in EXPSPACE, and is PSPACE-hard.
It's proved to be PSPACE-hard by reducing Generalized Geography, a problem known to be PSPACE-hard, to a game of Ghost. Specifically, given a Generalized Geography graph, a nondeterministic finite automaton can be constructed, which gives a regular expression R, such that player 1 has a winning strategy in Ghost with R if and only if they have a winning strategy in the Generalized Geography game.
This proof extends to Superghost, Superduperghost, Xghost, played on regular languages generated by regular expressions. Thus Superghost, Superduperghost, Xghost played on regular languages are all PSPACE-hard and in EXPSPACE. Spook on regular language is PSPACE-hard, but it's unknown if it's in EXPSPACE.

### In German

In German, words can be formed quite freely by concatenation. Because of this, one can write a regular expression that generates a regular language L, such that every word in L is technically a word (which might be nonsensical) in German. A game of ghost played on such languages L is called German ghost. This variant was also shown to be PSPACE-hard.