***************************************************************************** * www.FindStat.org - The Combinatorial Statistic Finder * * * * Copyright (C) 2019 The FindStatCrew * * * * This information is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * ***************************************************************************** ----------------------------------------------------------------------------- Statistic identifier: St000090 ----------------------------------------------------------------------------- Collection: Integer compositions ----------------------------------------------------------------------------- Description: The variation of a composition. ----------------------------------------------------------------------------- References: [1] Archibald, M., Knopfmacher, A., Mansour, T. Variation statistics on compositions [[MathSciNet:2977908]] ----------------------------------------------------------------------------- Code: def statistic(alp): return sum([alp[i+1]-alp[i] for i in range(len(alp) - 1)]) ----------------------------------------------------------------------------- Statistic values: [1] => 0 [1,1] => 0 [2] => 0 [1,1,1] => 0 [1,2] => 1 [2,1] => -1 [3] => 0 [1,1,1,1] => 0 [1,1,2] => 1 [1,2,1] => 0 [1,3] => 2 [2,1,1] => -1 [2,2] => 0 [3,1] => -2 [4] => 0 [1,1,1,1,1] => 0 [1,1,1,2] => 1 [1,1,2,1] => 0 [1,1,3] => 2 [1,2,1,1] => 0 [1,2,2] => 1 [1,3,1] => 0 [1,4] => 3 [2,1,1,1] => -1 [2,1,2] => 0 [2,2,1] => -1 [2,3] => 1 [3,1,1] => -2 [3,2] => -1 [4,1] => -3 [5] => 0 [1,1,1,1,1,1] => 0 [1,1,1,1,2] => 1 [1,1,1,2,1] => 0 [1,1,1,3] => 2 [1,1,2,1,1] => 0 [1,1,2,2] => 1 [1,1,3,1] => 0 [1,1,4] => 3 [1,2,1,1,1] => 0 [1,2,1,2] => 1 [1,2,2,1] => 0 [1,2,3] => 2 [1,3,1,1] => 0 [1,3,2] => 1 [1,4,1] => 0 [1,5] => 4 [2,1,1,1,1] => -1 [2,1,1,2] => 0 [2,1,2,1] => -1 [2,1,3] => 1 [2,2,1,1] => -1 [2,2,2] => 0 [2,3,1] => -1 [2,4] => 2 [3,1,1,1] => -2 [3,1,2] => -1 [3,2,1] => -2 [3,3] => 0 [4,1,1] => -3 [4,2] => -2 [5,1] => -4 [6] => 0 [1,1,1,1,1,1,1] => 0 [1,1,1,1,1,2] => 1 [1,1,1,1,2,1] => 0 [1,1,1,1,3] => 2 [1,1,1,2,1,1] => 0 [1,1,1,2,2] => 1 [1,1,1,3,1] => 0 [1,1,1,4] => 3 [1,1,2,1,1,1] => 0 [1,1,2,1,2] => 1 [1,1,2,2,1] => 0 [1,1,2,3] => 2 [1,1,3,1,1] => 0 [1,1,3,2] => 1 [1,1,4,1] => 0 [1,1,5] => 4 [1,2,1,1,1,1] => 0 [1,2,1,1,2] => 1 [1,2,1,2,1] => 0 [1,2,1,3] => 2 [1,2,2,1,1] => 0 [1,2,2,2] => 1 [1,2,3,1] => 0 [1,2,4] => 3 [1,3,1,1,1] => 0 [1,3,1,2] => 1 [1,3,2,1] => 0 [1,3,3] => 2 [1,4,1,1] => 0 [1,4,2] => 1 [1,5,1] => 0 [1,6] => 5 [2,1,1,1,1,1] => -1 [2,1,1,1,2] => 0 [2,1,1,2,1] => -1 [2,1,1,3] => 1 [2,1,2,1,1] => -1 [2,1,2,2] => 0 [2,1,3,1] => -1 [2,1,4] => 2 [2,2,1,1,1] => -1 [2,2,1,2] => 0 [2,2,2,1] => -1 [2,2,3] => 1 [2,3,1,1] => -1 [2,3,2] => 0 [2,4,1] => -1 [2,5] => 3 [3,1,1,1,1] => -2 [3,1,1,2] => -1 [3,1,2,1] => -2 [3,1,3] => 0 [3,2,1,1] => -2 [3,2,2] => -1 [3,3,1] => -2 [3,4] => 1 [4,1,1,1] => -3 [4,1,2] => -2 [4,2,1] => -3 [4,3] => -1 [5,1,1] => -4 [5,2] => -3 [6,1] => -5 [7] => 0 ----------------------------------------------------------------------------- Created: Jun 13, 2013 at 15:47 by Chris Berg ----------------------------------------------------------------------------- Last Updated: Jun 01, 2015 at 16:00 by Martin Rubey