Cody

Solution 1971399

Submitted on 11 Oct 2019 by Hau Van
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
x = 10; y_correct = 3.041840000000000; assert(isequal(pi_est1(x),y_correct))

h = 1 h = 0.6667 h = 0.8667 h = 0.7238 h = 0.8349 h = 0.7440 h = 0.8209 h = 0.7543 h = 0.8131 h = 0.7605 estimate = 3.0418

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

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

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

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

Suggested Problems

More from this Author4