The purpose of the current investigation is to distinguish between working memory ( ) in five patients with vascular dementia ( ), fifteen post-stroke patients with mild cognitive impairment ( ), and fifteen healthy control individuals ( ) based on background electroencephalography (EEG) activity. The elimination of EEG artifacts using wavelet (WT) pre-processing denoising is demonstrated in this study. In the current study, spectral entropy ( ), permutation entropy ( ), and approximation entropy ( ) were all explored. To improve the classification using the k-nearest neighbors ( NN) classifier scheme, a comparative study of using fuzzy neighbourhood preserving analysis with -decomposition ( ) as a dimensionality reduction technique and the improved binary gravitation search ( ) optimization algorithm as a channel selection method has been conducted. The NN classification accuracy was increased from 86.67% to 88.09% and 90.52% using the dimensionality reduction technique and the channel selection algorithm, respectively. According to the findings, reliably enhances discrimination of , , and participants. Therefore, WT, entropy features, IBGSA and NN classifiers provide a valid dementia index for looking at EEG background activity in patients with and .