function california_migration_matrix_backwards ( )

%*****************************************************************************80
%
%% california_migration_matrix_backwards() goes "backward" in time.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 January 2025
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'california_migration_matrix_backwards():\n' );
  fprintf ( 1, '  Go "backwards" in time using np.linalg.solve()\n' );

  A = [ ...
    0.70, 0.10 ; ...
    0.30, 0.90 ];

  pop = zeros ( 2, 2 );

  i = 2;
  pop(i,:) = [ 27600000, 152400000 ];
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Population data for 1961:\n' );
  fprintf ( 1, '  %4d  %9.0f  %9.0f  %9.0f\n', ...
    1961, pop(i,1), pop(i,2), pop(i,1) + pop(i,2) );
%
%  x = A\b solves A*x=b.
%  Use this to compute previous year 1960 from current year 1961.
%
  pop(i-1,:) = ( A \ pop(i,:)' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Population data for 1960:\n' );
  fprintf ( 1, '  %4d  %9.0f  %9.0f  %9.0f\n', ...
    1960, pop(i-1,1), pop(i-1,2), pop(i-1,1) + pop(i-1,2) );

  return
end

