# Revision history [back]

This is just standard linear algebra: form a 21 by 20 matrix whose rows consist of the linearly dependent vectors and the 20 linearly independent vectors, and find the one-dimensional left kernel (nullspace); alternatively transpose and find the right kernel. The coefficients of the single element in a basis of the kernel provide a linear combination of all 21 vectors which is zero. Hence the dependent vector can be written as a linear combination of the 20 independent vectors.

A small scale version in Sage:

sage: V = VectorSpace(QQ, 6)
sage: vectors = [V.random_element() for _ in range(6)]
sage: V.subspace(vectors).rank()
6


Confirming that the vectors are linearly independent, otherwise repeat. Then form a random linear combination, and create the matrix:

sage: w = sum(randint(-4, 4)*v for v in vectors)
sage: A = matrix([w] + vectors)


Now take the first (and only) generator of the kernel, and verify the result:

sage: c = A.kernel().basis()
sage: w == -sum(c[i+1]*vectors[i] for i in range(6))
True
{"ft_lang_label":"__label__en","ft_lang_prob":0.812075,"math_prob":0.9797851,"size":1036,"snap":"2021-21-2021-25","text_gpt3_token_len":262,"char_repetition_ratio":0.16666667,"word_repetition_ratio":0.0,"special_character_ratio":0.25772202,"punctuation_ratio":0.13170731,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99846506,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-12T08:13:37Z\",\"WARC-Record-ID\":\"<urn:uuid:360c73fc-7b7e-4b7b-be7e-75ae4bd78864>\",\"Content-Length\":\"15419\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ee7431e7-3480-4f99-844a-fcf3268c05e1>\",\"WARC-Concurrent-To\":\"<urn:uuid:cdff3a62-3214-4326-af3f-4deb035e097e>\",\"WARC-IP-Address\":\"194.254.163.53\",\"WARC-Target-URI\":\"https://ask.sagemath.org/answers/15744/revisions/\",\"WARC-Payload-Digest\":\"sha1:SGE2X4UHLINKHXXOHTPHXFBVBUCJG5YL\",\"WARC-Block-Digest\":\"sha1:GXEWYNRBA7JWTMRVU7MARIBH6ALBPJVO\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243991685.16_warc_CC-MAIN-20210512070028-20210512100028-00397.warc.gz\"}"}