Cody

Problem 953. Pi Estimate 1

Solution 3392028

Submitted on 26 Oct 2020 at 11:20 by Jiseon Shin
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
nMax = 10; y_correct = 3.041840000000000; assert(isequal(pi_est1(nMax),y_correct))

S = 0.6667 S = 0.8667 S = 0.7238 S = 0.8349 S = 0.7440 S = 0.8209 S = 0.7543 S = 0.8131 S = 0.7605

2   Pass
nMax = 1000; y_correct = 3.140593000000000; assert(isequal(pi_est1(nMax),y_correct))

S = 0.6667 S = 0.8667 S = 0.7238 S = 0.8349 S = 0.7440 S = 0.8209 S = 0.7543 S = 0.8131 S = 0.7605 S = 0.8081 S = 0.7646 S = 0.8046 S = 0.7676 S = 0.8020 S = 0.7698 S = 0.8001 S = 0.7715 S = 0.7985 S = 0.7729 S = 0.7973 S = 0.7740 S = 0.7963 S = 0.7750 S = 0.7954 S = 0.7758 S = 0.7947 S = 0.7765 S = 0.7940 S = 0.7771 S = 0.7935 S = 0.7776 S = 0.7930 S = 0.7780 S = 0.7925 S = 0.7785 S = 0.7922 S = 0.7788 S = 0.7918 S = 0.7791 S = 0.7915 S = 0.7794 S = 0.7912 S = 0.7797 S = 0.7910 S = 0.7800 S = 0.7907 S = 0.7802 S = 0.7905 S = 0.7804 S = 0.7903 S = 0.7806 S = 0.7901 S = 0.7808 S = 0.7899 S = 0.7809 S = 0.7898 S = 0.7811 S = 0.7896 S = 0.7812 S = 0.7895 S = 0.7814 S = 0.7894 S = 0.7815 S = 0.7892 S = 0.7816 S = 0.7891 S = 0.7817 S = 0.7890 S = 0.7818 S = 0.7889 S = 0.7819 S = 0.7888 S = 0.7820 S = 0.7887 S = 0.7821 S = 0.7886 S = 0.7822 S = 0.7886 S = 0.7823 S = 0.7885 S = 0.7823 S = 0.7884 S = 0.7824 S = 0.7883 S = 0.7825 S = 0.7883 S = 0.7826 S = 0.7882 S = 0.7826 S = 0.7881 S = 0.7827 S = 0.7881 S = 0.7827 S = 0.7880 S = 0.7828 S = 0.7880 S = 0.7828 S = 0.7879 S = 0.7829 S = 0.7879 S = 0.7829 S = 0.7878 S = 0.7830 S = 0.7878 S = 0.7830 S = 0.7877 S = 0.7831 S = 0.7877 S = 0.7831 S = 0.7877 S = 0.7832 S = 0.7876 S = 0.7832 S = 0.7876 S = 0.7832 S = 0.7875 S = 0.7833 S = 0.7875 S = 0.7833 S = 0.7875 S = 0.7833 S = 0.7874 S = 0.7834 S = 0.7874 S = 0.7834 S = 0.7874 S = 0.7834 S = 0.7873 S = 0.7835 S = 0.7873 S = 0.7835 S = 0.7873 S = 0.7835 S = 0.7872 S = 0.7836 S = 0.7872 S = 0.7836 S = 0.7872 S = 0.7836 S = 0.7872 S = 0.7836 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7861 S = 0.7846 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7859 S = 0.7848 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7858 S = 0.7849 S = 0...

3   Pass
nMax = 1e6; y_correct = 3.141592000000000; assert(isequal(pi_est1(nMax),y_correct))

S = 0.6667 S = 0.8667 S = 0.7238 S = 0.8349 S = 0.7440 S = 0.8209 S = 0.7543 S = 0.8131 S = 0.7605 S = 0.8081 S = 0.7646 S = 0.8046 S = 0.7676 S = 0.8020 S = 0.7698 S = 0.8001 S = 0.7715 S = 0.7985 S = 0.7729 S = 0.7973 S = 0.7740 S = 0.7963 S = 0.7750 S = 0.7954 S = 0.7758 S = 0.7947 S = 0.7765 S = 0.7940 S = 0.7771 S = 0.7935 S = 0.7776 S = 0.7930 S = 0.7780 S = 0.7925 S = 0.7785 S = 0.7922 S = 0.7788 S = 0.7918 S = 0.7791 S = 0.7915 S = 0.7794 S = 0.7912 S = 0.7797 S = 0.7910 S = 0.7800 S = 0.7907 S = 0.7802 S = 0.7905 S = 0.7804 S = 0.7903 S = 0.7806 S = 0.7901 S = 0.7808 S = 0.7899 S = 0.7809 S = 0.7898 S = 0.7811 S = 0.7896 S = 0.7812 S = 0.7895 S = 0.7814 S = 0.7894 S = 0.7815 S = 0.7892 S = 0.7816 S = 0.7891 S = 0.7817 S = 0.7890 S = 0.7818 S = 0.7889 S = 0.7819 S = 0.7888 S = 0.7820 S = 0.7887 S = 0.7821 S = 0.7886 S = 0.7822 S = 0.7886 S = 0.7823 S = 0.7885 S = 0.7823 S = 0.7884 S = 0.7824 S = 0.7883 S = 0.7825 S = 0.7883 S = 0.7826 S = 0.7882 S = 0.7826 S = 0.7881 S = 0.7827 S = 0.7881 S = 0.7827 S = 0.7880 S = 0.7828 S = 0.7880 S = 0.7828 S = 0.7879 S = 0.7829 S = 0.7879 S = 0.7829 S = 0.7878 S = 0.7830 S = 0.7878 S = 0.7830 S = 0.7877 S = 0.7831 S = 0.7877 S = 0.7831 S = 0.7877 S = 0.7832 S = 0.7876 S = 0.7832 S = 0.7876 S = 0.7832 S = 0.7875 S = 0.7833 S = 0.7875 S = 0.7833 S = 0.7875 S = 0.7833 S = 0.7874 S = 0.7834 S = 0.7874 S = 0.7834 S = 0.7874 S = 0.7834 S = 0.7873 S = 0.7835 S = 0.7873 S = 0.7835 S = 0.7873 S = 0.7835 S = 0.7872 S = 0.7836 S = 0.7872 S = 0.7836 S = 0.7872 S = 0.7836 S = 0.7872 S = 0.7836 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7837 S = 0.7871 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7838 S = 0.7870 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7869 S = 0.7839 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7868 S = 0.7840 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7867 S = 0.7841 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7842 S = 0.7866 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7865 S = 0.7843 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7864 S = 0.7844 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7863 S = 0.7845 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7862 S = 0.7846 S = 0.7861 S = 0.7846 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7861 S = 0.7847 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7860 S = 0.7848 S = 0.7859 S = 0.7848 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7859 S = 0.7849 S = 0.7858 S = 0.7849 S = 0...

Suggested Problems

More from this Author4

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!